@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.08);
    --bg: #f1f5f9;
    --surface: #ffffff;
    --surface-hover: #f8fafc;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --radius: 12px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ────────────── Auth / Login ────────────── */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #e0e7ff 0%, #f1f5f9 40%, #fce7f3 100%);
}

.glass-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    width: 100%;
    max-width: none;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.auth-container .glass-card {
    max-width: 420px;
}

.glass-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.12);
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ────────────── Forms ────────────── */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-control::placeholder {
    color: #94a3b8;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 2rem;
}

/* ────────────── Buttons ────────────── */
.btn {
    width: 100%;
    padding: 0.7rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary-light);
    box-shadow: none;
}

.btn-success {
    background: var(--success);
}

.btn-success:hover {
    background: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* ────────────── App Layout ────────────── */
.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 260px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    box-shadow: 1px 0 4px rgba(0,0,0,0.04);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-nav {
    padding: 0.75rem 0;
    flex: 1;
    overflow-y: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.65rem 1.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    gap: 0.75rem;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    color: var(--text);
    background: var(--primary-light);
    border-left-color: var(--primary);
}

.nav-link.active {
    color: var(--primary);
    background: var(--primary-light);
    border-left-color: var(--primary);
    font-weight: 600;
}

.sidebar-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--surface-hover);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    background: var(--bg);
}

.topbar {
    height: 64px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.content-area {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    overflow-x: auto;
    min-width: 0;
}

/* ────────────── Alerts ────────────── */
.alert {
    padding: 0.875rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-success {
    background: rgba(16, 185, 129, 0.08);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.text-error {
    color: #dc2626;
    font-size: 0.85rem;
    margin-top: 0.25rem;
    display: block;
}

/* ────────────── Dashboard Cards ────────────── */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
}

.stat-title {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-top: 0.5rem;
    color: var(--text);
}

/* ────────────── Tables ────────────── */
table {
    width: 100%;
    text-align: left;
    border-collapse: collapse;
}

table thead tr {
    border-bottom: 2px solid var(--border);
}

table thead th {
    padding: 0.875rem 0.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

table tbody tr:hover {
    background: var(--surface-hover);
}

table tbody td {
    padding: 0.875rem 0.5rem;
    color: var(--text);
    font-size: 0.9rem;
}

/* ────────────── Section Headers ────────────── */
.section-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 700;
    padding: 1.5rem 1.5rem 0.5rem;
}

/* ────────────── Status Badges ────────────── */
.badge {
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

/* ────────────── Pagination ────────────── */
nav[role="navigation"] {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

nav[role="navigation"] > div {
    display: flex;
    align-items: center;
    gap: 0;
}

nav[role="navigation"] > div:first-child {
    display: none;  /* Hide the "Showing X to Y of Z results" on mobile */
}

nav[role="navigation"] > div:last-child {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

nav[role="navigation"] > div:last-child > div:first-child {
    order: 2;
    color: var(--text-muted);
    font-size: 0.85rem;
}

nav[role="navigation"] > div:last-child > div:last-child {
    order: 1;
}

nav[role="navigation"] span[aria-current="page"] > span,
nav[role="navigation"] a,
nav[role="navigation"] span:not([aria-current="page"]):not([aria-disabled]) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    border: 1px solid var(--border);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--text-muted);
    background: var(--surface);
    transition: all 0.2s ease;
    cursor: pointer;
}

nav[role="navigation"] a:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

nav[role="navigation"] span[aria-current="page"] > span {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    font-weight: 600;
    cursor: default;
}

/* Disabled prev/next buttons */
nav[role="navigation"] span[aria-disabled="true"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    border: 1px solid var(--border);
    background: var(--surface-hover);
    color: #cbd5e1;
    cursor: not-allowed;
}

/* First and last button border radius */
nav[role="navigation"] span:first-child > span,
nav[role="navigation"] span:first-child > a,
nav[role="navigation"] a:first-child {
    border-radius: 8px 0 0 8px;
}

nav[role="navigation"] span:last-child > span,
nav[role="navigation"] span:last-child > a,
nav[role="navigation"] a:last-child {
    border-radius: 0 8px 8px 0;
}

/* Shrink the SVG arrows */
nav[role="navigation"] svg {
    width: 16px;
    height: 16px;
}

/* ────────────── Scrollbar ────────────── */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

 / *    % % % % % % % % % % % % % %  B a d g e s    % % % % % % % % % % % % % %  * / 
 . b a d g e   { 
         d i s p l a y :   i n l i n e - b l o c k ; 
         p a d d i n g :   0 . 2 5 r e m   0 . 6 r e m ; 
         f o n t - s i z e :   0 . 7 5 r e m ; 
         f o n t - w e i g h t :   6 0 0 ; 
         b o r d e r - r a d i u s :   9 9 9 9 p x ; 
         b a c k g r o u n d - c o l o r :   # e 2 e 8 f 0 ; 
         c o l o r :   # 4 7 5 5 6 9 ; 
 } 
 . b a d g e - p r i m a r y   {   b a c k g r o u n d - c o l o r :   r g b a ( 9 9 ,   1 0 2 ,   2 4 1 ,   0 . 1 5 ) ;   c o l o r :   v a r ( - - p r i m a r y ) ;   } 
 . b a d g e - s u c c e s s   {   b a c k g r o u n d - c o l o r :   r g b a ( 1 6 ,   1 8 5 ,   1 2 9 ,   0 . 1 5 ) ;   c o l o r :   v a r ( - - s u c c e s s ) ;   } 
 . b a d g e - w a r n i n g   {   b a c k g r o u n d - c o l o r :   r g b a ( 2 4 5 ,   1 5 8 ,   1 1 ,   0 . 1 5 ) ;   c o l o r :   v a r ( - - w a r n i n g ) ;   } 
 . b a d g e - d a n g e r   {   b a c k g r o u n d - c o l o r :   r g b a ( 2 3 9 ,   6 8 ,   6 8 ,   0 . 1 5 ) ;   c o l o r :   v a r ( - - d a n g e r ) ;   } 
 . b a d g e - i n f o   {   b a c k g r o u n d - c o l o r :   r g b a ( 5 6 ,   1 8 9 ,   2 4 8 ,   0 . 1 5 ) ;   c o l o r :   # 0 2 8 4 c 7 ;   } 
  
 