:root {
    --bg-color: #f4f7f9;
    --sidebar-bg: rgba(255, 255, 255, 0.9);
    --border-color: rgba(0, 168, 255, 0.1);

    --primary: #0081ff;
    --primary-alt: #00c6ff;
    --secondary: #6366f1;
    --secondary-alt: #a855f7;
    --success: #22c55e;
    --success-alt: #4ade80;
    --warning: #f59e0b;
    --warning-alt: #fbbf24;
    --danger: #ef4444;
    --danger-alt: #f87171;

    --text-main: #1e293b;
    --text-dim: #64748b;
    --text-bright: #ffffff;

    --glass: rgba(255, 255, 255, 0.7);
    --shadow-main: 0 10px 30px -10px rgba(0, 0, 0, 0.1);

    /* Layout Constants */
    --sidebar-width: 240px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background: var(--bg-color);
    background-image:
        radial-gradient(at 0% 0%, rgba(0, 129, 255, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(99, 102, 241, 0.05) 0px, transparent 50%);
    color: var(--text-main);
    min-height: 100vh;
}

.glass {
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
}

/* Sidebar Styling */
.sidebar {
    position: fixed;
    top: 20px;
    left: 20px;
    bottom: 20px;
    width: var(--sidebar-width);
    padding: 25px 15px;
    z-index: 1000;
    box-shadow: var(--shadow-main);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), left 0.4s ease;
    overflow-y: auto;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(0, 129, 255, 0.2);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 129, 255, 0.4);
}

.logo {
    font-size: 26px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.5px;
}

.nav-item {
    padding: 12px 14px;
    margin-bottom: 6px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-dim);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.nav-item:hover {
    color: var(--primary);
    background: rgba(0, 129, 255, 0.05);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-alt));
    color: white;
    box-shadow: 0 8px 20px -5px rgba(0, 129, 255, 0.4);
}

/* Main Layout */
.main-content {
    margin-left: calc(var(--sidebar-width) + 40px);
    padding: 30px 40px 40px 10px;
    min-height: 100vh;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body.sidebar-hidden .sidebar {
    transform: translateX(-120%);
    pointer-events: none;
}

body.sidebar-hidden .main-content {
    margin-left: 0;
    padding-left: 40px;
}

/* Header Tools (Hamburger + Fullscreen) */
.header-actions {
    display: flex;
    gap: 12px;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
}

.action-btn {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: var(--glass);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-main);
    color: var(--primary);
    transition: all 0.3s ease;
    border-radius: 14px;
}

.action-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.action-btn i {
    width: 22px;
    height: 22px;
}

.title {
    font-size: clamp(24px, 5vw, 32px);
    font-weight: 800;
    background: linear-gradient(135deg, var(--text-main), var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

/* Callout Cards */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    padding: 30px;
    border-radius: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-main);
}

/* Callout Variants */
.callout-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-alt));
    color: white;
}

.callout-success {
    background: linear-gradient(135deg, var(--success), var(--success-alt));
    color: white;
}

.callout-danger {
    background: linear-gradient(135deg, var(--danger), var(--danger-alt));
    color: white;
}

.callout-secondary {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-alt));
    color: white;
}

.stat-value {
    font-size: clamp(28px, 4vw, 36px);
    font-weight: 800;
    margin-bottom: 10px;
    display: block;
}

/* Content Area Glass */
.content-area {
    background: white;
    border-radius: 24px;
    padding: 25px;
    box-shadow: var(--shadow-main);
    border: 1px solid var(--border-color);
    margin-bottom: 25px;
    overflow: hidden;
}

/* Tables - Responsive scroll */
.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
    font-size: 14px;
}

thead {
    background: linear-gradient(90deg, var(--primary), var(--primary-alt));
}

thead th {
    padding: 16px 15px;
    color: white;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    border-bottom: none;
    white-space: nowrap;
}

/* Ensure no border radius gaps on the header */
thead th:first-child {
    border-top-left-radius: 11px;
}

thead th:last-child {
    border-top-right-radius: 11px;
}

tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid #e2e8f0;
}

tbody tr:nth-child(even) {
    background: rgba(0, 129, 255, 0.02);
}

tbody tr:last-child {
    border-bottom: none;
}

tbody tr:hover {
    background: rgba(0, 129, 255, 0.06) !important;
}

tbody td {
    padding: 15px;
    vertical-align: middle;
    color: var(--text-main);
}

/* Forms & Buttons */
.grid-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

input,
select,
textarea {
    width: 100%;
    background: #f8fafc;
    border: 2px solid #f1f5f9;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 15px;
}

.btn {
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 700;
    white-space: nowrap;
}

/* ---------------------------------------------------
   RESPONSIVE QUERIES
------------------------------------------------------ */

@media (max-width: 1200px) {
    :root {
        --sidebar-width: 240px;
    }

    .main-content {
        margin-left: calc(var(--sidebar-width) + 30px);
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-120%);
        left: 0;
        top: 0;
        bottom: 0;
        border-radius: 0;
        width: 250px;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0 !important;
        padding: 80px 20px 20px 20px;
    }

    body.sidebar-hidden .main-content {
        padding-top: 80px;
    }

    .grid {
        grid-template-columns: 1fr 1fr;
    }

    .grid-split {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 600px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
    }

    .header .btn {
        width: 100%;
        justify-content: center;
    }

    .modal-content {
        width: 95% !important;
        left: 2.5% !important;
        top: 5% !important;
    }

    .stat-value {
        font-size: 28px;
    }

    .pos-grid {
        grid-template-columns: 1fr !important;
    }
}

.grid-split {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
}

.pos-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 25px;
}

/* Sidebar Groups & Submenus */
.nav-group {
    margin-bottom: 5px;
}

.nav-label {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dim);
    padding: 20px 25px 10px;
    opacity: 0.6;
}

.nav-parent {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 20px !important;
    cursor: pointer;
}

.nav-parent .chevron {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.nav-group.open .nav-parent .chevron {
    transform: rotate(180deg);
}

.nav-parent.active {
    background: rgba(0, 129, 255, 0.05);
    color: var(--primary);
}

.nav-submenu {
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(0, 129, 255, 0.02);
    border-radius: 0 0 16px 16px;
    margin: 0 10px;
}

.nav-group.open .nav-submenu {
    max-height: 500px;
    padding: 5px 0 10px 0;
    margin-bottom: 10px;
}

.nav-sub-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px 10px 45px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 600;
    transition: all 0.2s ease;
    border-radius: 10px;
    margin: 2px 8px;
}

.nav-sub-item:hover {
    color: var(--primary);
    background: rgba(0, 129, 255, 0.05);
}

.nav-sub-item.active {
    color: var(--primary);
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.nav-sub-item i {
    width: 16px;
    height: 16px;
}

.sidebar nav {
    padding: 10px 0;
    display: flex;
    flex-direction: column;
}

/* Circle Pagination Style (Matched to Image) */
.pagination-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 50px;
    padding: 25px;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.pagination-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: white;
    border: 2px solid #e2e8f0;
    color: #64748b;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.pagination-item:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 129, 255, 0.2);
}

.pagination-item.active {
    background: var(--primary);
    color: white !important;
    border-color: var(--primary);
    box-shadow: 0 10px 20px -5px rgba(0, 129, 255, 0.4);
}

.pagination-item.disabled {
    opacity: 0.3;
    pointer-events: none;
    background: #f8fafc;
    border-color: #f1f5f9;
}

.pagination-info {
    font-size: 13px;
    color: var(--text-dim);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(0, 129, 255, 0.05);
    padding: 6px 18px;
    border-radius: 30px;
    color: var(--primary);
}

.pagination-item i {
    width: 18px;
    height: 18px;
}