:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #0ea5e9;
    
    --bg-main: #f1f5f9;
    --bg-sidebar: #0f172a;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 80px;
    
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --card-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Sarabun', sans-serif !important;
    background-color: var(--bg-main);
    color: #1e293b;
    overflow-x: hidden;
}

/* --- MAIN LAYOUT --- */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* --- SIDEBAR --- */
#sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: white;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

#sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.05);
}

.logo-text {
    font-weight: 800;
    font-size: 20px;
    white-space: nowrap;
    opacity: 1;
    transition: 0.3s;
}

.collapsed .logo-text {
    display: none;
}

.sidebar-menu {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 10px 24px;
    color: #94a3b8;
    text-decoration: none;
    transition: 0.2s;
    gap: 16px;
}

.menu-item:hover, .menu-item.active {
    background: rgba(255,255,255,0.1) !important;
    color: white !important;
}

.menu-item i {
    width: 20px;
    text-align: center;
    font-size: 18px;
}

.menu-text {
    white-space: nowrap;
}

.collapsed .menu-text {
    display: none;
}

/* --- MAIN CONTENT --- */
#content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.top-navbar {
    height: 70px;
    background: white;
    display: flex;
    align-items: center;
    padding: 0 32px;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.toggle-sidebar {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--secondary);
}

.main-body {
    padding: 24px;
    flex: 1;
}

/* --- CARDS & UI --- */
.card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    transition: 0.3s;
    border: none;
    margin-bottom: 16px;
}

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

/* --- PAGE HEADERS --- */
.page-header {
    margin-bottom: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-header-title h1 {
    font-size: 28px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
}

.page-header-title p {
    color: var(--secondary);
    margin-top: 2px;
    font-size: 14px;
}

/* --- STANDARDIZED TABLES --- */
.table-card {
    padding: 0 !important;
    overflow: hidden;
    background: white;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
}

.table-card-header {
    padding: 24px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-card-header h2 {
    font-size: 20px;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
}

.standard-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.standard-table thead tr {
    background: #f8fafc;
}

.standard-table th {
    padding: 16px 24px;
    text-align: left;
    font-weight: 700;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.standard-table td {
    padding: 16px 24px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    color: #334155;
    font-size: 14px;
}

.standard-table tr:hover td {
    background: #fcfdfe;
}

/* --- BUTTONS --- */
.btn-std {
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
}

.btn-std-primary {
    background: var(--primary) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.btn-std-secondary {
    background: white !important;
    color: var(--secondary) !important;
    border: 1px solid #e2e8f0 !important;
}

.btn-std-primary:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

/* --- PAGINATION --- */
.pagination-container {
    padding: 20px 24px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pagination-info {
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
}

.pagination-controls {
    display: flex;
    gap: 8px;
}

/* --- FORMS --- */
.form-control-std {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #f1f5f9;
    border-radius: 12px;
    background: #f8fafc;
    font-size: 14px;
    color: #1e293b;
    outline: none;
}

.badge-pill {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    display: inline-block;
}

/* --- LOGIN PAGE --- */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: white;
    border-radius: 24px;
    padding: 48px 40px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.btn-login {
    width: 100%;
    background: var(--primary);
    color: white;
    padding: 14px;
    border-radius: 14px;
    border: none;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-login:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3);
}

.btn-login:active {
    transform: translateY(0);
}

