* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: #f8fafc;
    color: #0f172a;
}

/* =========================
   Layout
========================= */

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: #0f172a;
    color: white;
    padding: 22px;
    flex-shrink: 0;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 34px;
}

.brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.brand-title {
    font-weight: 800;
    font-size: 16px;
}

.brand-subtitle {
    font-size: 12px;
    color: #94a3b8;
}

.menu a {
    display: block;
    color: #cbd5e1;
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 7px;
    font-size: 14px;
}

    .menu a:hover {
        background: #2563eb;
        color: white;
    }

.main {
    flex: 1;
    min-width: 0;
}

.topbar {
    height: 68px;
    background: white;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 28px;
}

.page-title {
    font-weight: 800;
}

.user-box {
    color: #475569;
    font-weight: 600;
}

.content {
    padding: 28px;
}

/* =========================
   Headers
========================= */

.dashboard-header,
.page-header {
    margin-bottom: 24px;
}

    .dashboard-header h1,
    .page-header h1 {
        margin: 0 0 6px;
        font-size: 30px;
        font-weight: 800;
    }

    .dashboard-header p,
    .page-header p {
        margin: 0;
        color: #64748b;
    }

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

/* =========================
   Dashboard Cards
========================= */

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.stat-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
    padding: 24px;
}

    .stat-card span {
        display: block;
        color: #64748b;
        margin-bottom: 12px;
    }

    .stat-card strong {
        font-size: 34px;
    }

/* =========================
   Buttons
========================= */

.btn-primary,
.btn-secondary,
.btn-danger {
    display: inline-block;
    padding: 11px 18px;
    border-radius: 10px;
    border: none;
    text-decoration: none;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
}

.btn-primary {
    background: #2563eb;
    color: #ffffff !important;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25);
}

    .btn-primary:hover {
        background: #1d4ed8;
    }

.btn-secondary {
    background: #e2e8f0;
    color: #0f172a;
}

    .btn-secondary:hover {
        background: #cbd5e1;
    }

.btn-danger {
    background: #dc2626;
    color: white;
}

    .btn-danger:hover {
        background: #b91c1c;
    }

.btn-table {
    display: inline-block;
    padding: 7px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    margin-left: 6px;
}

.btn-edit {
    background: #dbeafe;
    color: #1d4ed8;
}

    .btn-edit:hover {
        background: #bfdbfe;
    }

.btn-delete {
    background: #fee2e2;
    color: #b91c1c;
}

    .btn-delete:hover {
        background: #fecaca;
    }

/* =========================
   Alerts
========================= */

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-weight: 700;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-weight: 700;
}

/* =========================
   Search
========================= */

.search-form,
.search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
    width: 100%;
}

    .search-form input,
    .search-box .form-control {
        flex: 1;
        width: 100%;
        max-width: 520px;
        height: 46px;
        padding: 0 16px;
        border: 1px solid #cbd5e1;
        border-radius: 12px;
        font-size: 14px;
        background: #ffffff;
        color: #0f172a;
        outline: none;
    }

        .search-form input:focus,
        .search-box .form-control:focus {
            border-color: #2563eb;
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
        }

    .search-form button,
    .search-form a,
    .search-box button,
    .search-box a {
        height: 46px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
/* =========================
   Tables
========================= */

.table-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
    padding: 22px;
    overflow-x: auto;
}

.table-card-header {
    padding: 0 0 18px 0;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 16px;
}

    .table-card-header h2 {
        margin: 0;
        font-size: 20px;
    }

.table-wrapper {
    overflow-x: auto;
}

.data-table,
.app-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

    .data-table thead,
    .app-table thead {
        background: #f8fafc;
    }

    .data-table th,
    .app-table th {
        text-align: left;
        padding: 14px 12px;
        font-weight: 800;
        color: #0f172a;
        border-bottom: 1px solid #e5e7eb;
        white-space: nowrap;
    }

    .data-table td,
    .app-table td {
        padding: 14px 12px;
        border-bottom: 1px solid #e5e7eb;
        color: #334155;
        vertical-align: middle;
    }

    .data-table tbody tr:hover,
    .app-table tbody tr:hover {
        background: #f8fafc;
    }

.empty-row {
    text-align: center;
    color: #64748b;
    padding: 28px !important;
}

.text-end {
    text-align: right !important;
}

/* =========================
   Forms
========================= */

.form-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 28px;
    max-width: 720px;
    width: 100%;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

    .form-card form {
        width: 100%;
    }

.form-group {
    display: block;
    margin-bottom: 20px;
}

    .form-group label,
    .form-label {
        display: block;
        margin-bottom: 8px;
        font-size: 14px;
        font-weight: 700;
        color: #0f172a;
    }

    .form-control,
    .form-group input,
    .form-group select {
        width: 100%;
        max-width: 100%;
        height: 46px;
        padding: 0 14px;
        border: 1px solid #cbd5e1;
        border-radius: 10px;
        font-size: 14px;
        background: #ffffff;
        color: #0f172a;
        box-sizing: border-box;
    }

        .form-control:focus,
        .form-group input:focus,
        .form-group select:focus {
            outline: none;
            border-color: #2563eb;
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
        }

.form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.checkbox-group input {
    width: 18px;
    height: 18px;
}

.text-danger {
    display: block;
    margin-top: 6px;
    color: #dc2626;
    font-size: 13px;
    font-weight: 600;
}

/* =========================
   Details / Delete
========================= */

.details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.delete-page {
    display: flex;
    justify-content: center;
    padding-top: 40px;
}

.delete-card {
    width: 100%;
    max-width: 620px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    padding: 34px;
    box-shadow: 0 16px 35px rgba(15, 23, 42, 0.08);
    text-align: center;
}

.delete-icon {
    width: 54px;
    height: 54px;
    border-radius: 999px;
    background: #fee2e2;
    color: #b91c1c;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 900;
    margin-bottom: 18px;
}

.delete-card h1 {
    margin: 0 0 10px;
    font-size: 28px;
}

.delete-message {
    color: #64748b;
    margin-bottom: 24px;
    line-height: 1.6;
}

.delete-details {
    text-align: left;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 24px;
}

    .delete-details div {
        display: flex;
        justify-content: space-between;
        gap: 20px;
        padding: 12px 0;
        border-bottom: 1px solid #e2e8f0;
    }

        .delete-details div:last-child {
            border-bottom: none;
        }

    .delete-details span {
        color: #64748b;
        font-weight: 700;
    }

    .delete-details strong {
        color: #0f172a;
    }

.delete-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

/* =========================
   Badges
========================= */

.badge-success,
.badge-muted {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-muted {
    background: #e2e8f0;
    color: #475569;
}

/* =========================
   Responsive
========================= */

@media (max-width: 992px) {
    .dashboard-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .app-shell {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .page-header,
    .search-form,
    .search-box {
        align-items: stretch;
        flex-direction: column;
    }

    .form-card {
        max-width: 100%;
        padding: 20px;
    }

    .details-grid {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-primary,
    .btn-secondary,
    .btn-danger {
        text-align: center;
    }
}

@media (max-width: 576px) {
    .dashboard-cards {
        grid-template-columns: 1fr;
    }

    .content {
        padding: 18px;
    }
}
