/*
|--------------------------------------------------------------------------
| Page
|--------------------------------------------------------------------------
*/

.page{
    display:flex;
    flex-direction:column;
    gap:var(--space-8);
    padding:var(--space-8);
}

.page-header{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:var(--space-6);
}

.page-heading{
    flex:1;
}

.page-heading h1{
    margin-bottom:var(--space-2);
    color:var(--color-gray-900);
}

.page-heading p{
    color:var(--color-gray-600);
}

.page-actions{
    margin-top:20px;
    display:flex;
    align-items:center;
    gap:var(--space-3);
}

.page-content{
    display:flex;
    flex-direction:column;
    gap:var(--space-5);
}


/*
|--------------------------------------------------------------------------
| Toolbar
|--------------------------------------------------------------------------
*/

.toolbar{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:var(--space-4);
}

.toolbar-left,
.toolbar-right{
    display:flex;
    align-items:center;
    gap:var(--space-3);
}


/*
|--------------------------------------------------------------------------
| Table
|--------------------------------------------------------------------------
*/

.table{
    background:var(--color-white);
    border:1px solid var(--color-gray-200);
    border-radius:var(--radius-lg);
    overflow:hidden;
    box-shadow:var(--shadow-sm);
}

.table table{
    width:100%;
    border-collapse:collapse;
}

.table thead th{
    padding:var(--space-4) var(--space-5);
    background:var(--color-gray-50);
    border-bottom:1px solid var(--color-gray-200);
    color:var(--color-gray-600);
    font-size:var(--font-size-xs);
    font-weight:var(--font-weight-semibold);
    text-align:left;
    text-transform:uppercase;
    white-space:nowrap;
}

.table tbody td{
    padding:var(--space-5);
    border-bottom:1px solid var(--color-gray-200);
    color:var(--color-gray-800);
    vertical-align:middle;
}

.table tbody tr:last-child td{
    border-bottom:none;
}

.table tbody tr{
    transition:var(--transition);
}

.table tbody tr:hover{
    background:var(--color-gray-50);
}


/*
|--------------------------------------------------------------------------
| Pagination
|--------------------------------------------------------------------------
*/

.pagination{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:var(--space-4);
}


/*
|--------------------------------------------------------------------------
| Responsive
|--------------------------------------------------------------------------
*/

@media (max-width:991px){

    .page{
        padding:var(--space-6);
    }

    .page-header{
        flex-direction:column;
        align-items:flex-start;
    }

    .toolbar{
        flex-direction:column;
        align-items:stretch;
    }

    .toolbar-left,
    .toolbar-right{
        width:100%;
    }

    .table{
        overflow-x:auto;
    }

}


/* ==========================================================
   STATS
========================================================== */

.stats{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
    gap:20px;
    margin-bottom:30px;
}

.stat{
    background:#fff;
    border:1px solid var(--border-color,#e5e7eb);
    border-radius:12px;
    padding:24px;
}

.stat-value{
    font-size:32px;
    font-weight:700;
    line-height:1;
    color:var(--text-color,#111827);
}

.stat-label{
    margin-top:8px;
    font-size:14px;
    color:var(--text-light,#6b7280);
}

/* ==========================================================
   BADGES
========================================================== */

.badge{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:4px 10px;
    border-radius:999px;
    font-size:12px;
    font-weight:600;
    line-height:1;
}

.badge-default{
    background:#f3f4f6;
    color:#374151;
}

.badge-primary{
    background:#e8f1ff;
    color:#2563eb;
}

.badge-success{
    background:#ecfdf5;
    color:#059669;
}

.badge-warning{
    background:#fffbeb;
    color:#d97706;
}

.badge-danger{
    background:#fef2f2;
    color:#dc2626;
}

/* ==========================================================
   AVATAR
========================================================== */

.avatar{
    width:42px;
    height:42px;
    border-radius:50%;
    background:#eef2ff;
    color:#4338ca;
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:700;
    font-size:14px;
    flex-shrink:0;
}

/* ==========================================================
   ALERT
========================================================== */

.alert{
    padding:16px 20px;
    border-radius:10px;
    margin-bottom:20px;
    border:1px solid transparent;
}

.alert-info{
    background:#eff6ff;
    color:#1d4ed8;
    border-color:#bfdbfe;
}

.alert-success{
    background:#ecfdf5;
    color:#047857;
    border-color:#a7f3d0;
}

.alert-warning{
    background:#fffbeb;
    color:#b45309;
    border-color:#fde68a;
}

.alert-danger{
    background:#fef2f2;
    color:#b91c1c;
    border-color:#fecaca;
}

/* ==========================================================
   TABS
========================================================== */

.tabs{
    display:flex;
    gap:10px;
    border-bottom:1px solid var(--border-color,#e5e7eb);
    margin-bottom:24px;
}

.tabs a{
    padding:12px 18px;
    color:#6b7280;
    text-decoration:none;
    border-bottom:2px solid transparent;
    transition:.2s;
}

.tabs a:hover{
    color:#111827;
}

.tabs a.active{
    color:#2563eb;
    border-color:#2563eb;
}

/* ==========================================================
   PROGRESS
========================================================== */

.progress{
    width:100%;
    height:8px;
    background:#e5e7eb;
    border-radius:999px;
    overflow:hidden;
}

.progress-bar{
    height:100%;
    background:#2563eb;
    border-radius:999px;
}

/* ==========================================================
   EMPTY STATE
========================================================== */

.empty-state{
    padding:60px 30px;
    text-align:center;
    border:2px dashed #d1d5db;
    border-radius:12px;
    background:#fafafa;
}

.empty-state h3{
    margin:0 0 10px;
    font-size:20px;
}

.empty-state p{
    margin:0;
    color:#6b7280;
}

/* ==========================================================
   DIVIDER
========================================================== */

.divider{
    border:0;
    border-top:1px solid var(--border-color,#e5e7eb);
    margin:30px 0;
}

/* =======================
   CARD
======================= */

.card{
    background:#fff;
    border:1px solid var(--border-color);
    border-radius:12px;
    overflow:hidden;
}

.card-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    padding:20px 24px;
    border-bottom:1px solid var(--border-color);
}

.card-title{
    margin:0;
    font-size:18px;
    font-weight:600;
}

.card-body{
    padding:24px;
}

.card-footer{
    padding:20px 24px;
    border-top:1px solid var(--border-color);
    background:var(--background-light);
}