:root {
    --blue: #1b405f;
    --gray: #545454;
    --orange: #f78510;
    --white: #ffffff;
    --light: #f3f4f6;
    --border: #d1d5db;
    --border-soft: #e5e5e5;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-soft: 0 1px 4px rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    color: var(--gray);
    line-height: 1.6;
}

/* =========================
   LAYOUT / UTILITIES
========================= */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }

.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

.text-center { text-align: center; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mt-4 { margin-top: 1rem; }

.p-4 { padding: 1rem; }

.rounded { border-radius: 6px; }
.shadow { box-shadow: var(--shadow); }

.bg-white { background: var(--white); }

.text-blue { color: var(--blue); }
.text-orange { color: var(--orange); }
.text-gray { color: var(--gray); }

.font-bold { font-weight: 700; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }

.w-full { width: 100%; }

/* =========================
   SIDEBAR
========================= */
.sidebar {
    width: 260px;
    background: var(--blue);
    color: var(--white);
    height: 100vh;
    position: fixed;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.5rem 1rem;
    border-bottom: 2px solid var(--orange);
}

.sidebar-menu {
    list-style: none;
    padding: 1rem 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    color: var(--white);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: rgba(255, 255, 255, 0.1);
    border-left-color: var(--orange);
}

.sidebar-menu i {
    width: 20px;
    margin-right: 0.75rem;
}

/* =========================
   MAIN CONTENT
========================= */
.main-content {
    margin-left: 260px;
    min-height: 100vh;
}

.top-bar {
    background: var(--white);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.content {
    padding: 1.5rem;
}

/* =========================
   STAT CARDS
========================= */
.stat-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--blue);
}

.stat-card.orange {
    border-left-color: var(--orange);
}

.stat-card h3 {
    font-size: 0.875rem;
    color: var(--gray);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--blue);
}

/* =========================
   TABLES
========================= */
.table-container {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--blue);
    color: var(--white);
}

th,
td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-soft);
    vertical-align: top;
}

tbody tr:hover {
    background: #f9f9f9;
}

/* =========================
   BUTTONS
========================= */
.btn {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--blue);
    color: var(--white);
}

.btn-primary:hover {
    background: #132d43;
}

.btn-orange {
    background: var(--orange);
    color: var(--white);
}

.btn-orange:hover {
    background: #d66e0a;
}

.btn-light {
    background: var(--light);
    color: var(--gray);
    border: 1px solid var(--border);
}

.btn-light:hover {
    background: #e5e7eb;
}

.btn-danger {
    background: #dc3545;
    color: var(--white);
}

.btn-danger:hover {
    background: #b52a37;
}

.btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
}

/* =========================
   FORMS
========================= */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--gray);
}

input,
select,
textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.875rem;
    background: var(--white);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(27, 64, 95, 0.1);
}

/* =========================
   BADGES
========================= */
.badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* =========================
   ALERTS
========================= */
.alert {
    padding: 0.875rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-success {
    background: #d4edda;
    border-left-color: #28a745;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    border-left-color: #dc3545;
    color: #721c24;
}

/* =========================
   MODALS
========================= */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-sm {
    max-width: 460px;
}

.modal-header {
    padding: 1rem 1.5rem;
    background: var(--blue);
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px 8px 0 0;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-soft);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
}

/* =========================
   FILTER STRIP
========================= */
.filter-strip {
    background: var(--white);
    padding: 0.85rem 1rem;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.filter-strip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.filter-strip input,
.filter-strip select {
    width: auto;
    min-width: 180px;
    margin: 0;
}

/* =========================
   PAGINATION
========================= */
.pagination-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    background: var(--white);
    padding: 0.85rem 1rem;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.page-nav {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: var(--blue);
    color: var(--white);
    font-weight: 500;
}

.page-nav:hover {
    background: #132d43;
}

.page-nav.disabled {
    background: #e5e7eb;
    color: #9ca3af;
    pointer-events: none;
}

.page-info {
    font-weight: 600;
    color: var(--blue);
}

/* =========================
   MISC
========================= */
.details-grid {
    display: grid;
    gap: 0.75rem;
}

.action-stack {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.summary-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

/* =========================
   MOBILE MENU BUTTON
========================= */
.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--blue);
}

/* =========================
   MOBILE
========================= */
@media (max-width: 768px) {
    body {
        font-size: 15px;
    }

    .content {
        padding: 1rem;
    }

    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .top-bar h1 {
        font-size: 1.25rem;
    }

    .top-bar .flex {
        width: 100%;
        justify-content: space-between;
    }

    .grid-cols-4,
    .grid-cols-3,
    .grid-cols-2 {
        grid-template-columns: 1fr !important;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-card .value {
        font-size: 1.5rem;
    }

    input,
    select,
    textarea {
        font-size: 1rem;
        padding: 0.75rem;
    }

    .btn {
        width: 100%;
        padding: 0.875rem;
    }

    .btn-sm {
        width: auto;
    }

    .modal-content {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .hamburger {
        display: inline-block;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 240px;
        z-index: 2000;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .table-container {
        overflow: visible;
    }

    table {
        border: 0;
    }

    thead {
        display: none;
    }

    tbody tr {
        display: block;
        background: var(--white);
        margin-bottom: 1rem;
        border-radius: 8px;
        padding: 1rem;
        box-shadow: var(--shadow-soft);
    }

    tbody td {
        display: flex;
        justify-content: space-between;
        gap: 1rem;
        padding: 0.5rem 0;
        border: none;
        font-size: 0.9rem;
    }

    tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--blue);
    }

    .filter-strip-group {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-strip input,
    .filter-strip select,
    .filter-strip .btn {
        width: 100%;
        min-width: 100%;
    }

    .pagination-wrap {
        flex-direction: column;
    }

    .table-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .action-stack {
        justify-content: flex-end;
    }
}