/* ==========================================
   ERAPROMON v3 - Modern UI Stylesheet
   ========================================== */

/* === CSS Variables === */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #a5b4fc;
    --secondary: #0ea5e9;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    
    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --bg-sidebar: #1e293b;
    --bg-sidebar-hover: #334155;
    --bg-sidebar-active: #6366f1;
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-white: #ffffff;
    
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --header-height: 64px;
    
    --transition: all 0.3s ease;
}

/* === Reset & Base === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 14px;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* === Layout === */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* === Sidebar === */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: var(--text-white);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--bg-sidebar-hover);
    border-radius: 4px;
}

.sidebar-brand {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand .brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
}

.sidebar-brand .brand-text {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.sidebar-brand .brand-sub {
    font-size: 11px;
    color: var(--text-muted);
}

/* === Sidebar Collapsed State === */
.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar.collapsed .brand-text,
.sidebar.collapsed .brand-sub,
.sidebar.collapsed .user-info,
.sidebar.collapsed .nav-section,
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .nav-toggle,
.sidebar.collapsed .nav-submenu {
    display: none !important;
}

.sidebar.collapsed .sidebar-brand {
    justify-content: center;
    padding: 16px 0;
}

.sidebar.collapsed .sidebar-brand .brand-icon {
    margin-right: 0;
}

.sidebar.collapsed .sidebar-user {
    justify-content: center;
    padding: 12px 0;
}

.sidebar.collapsed .sidebar-user img {
    margin-right: 0;
}

.sidebar.collapsed .sidebar-nav .nav-item {
    position: relative;
}

.sidebar.collapsed .sidebar-nav .nav-link {
    justify-content: center;
    padding: 12px 0;
}

.sidebar.collapsed .sidebar-nav .nav-link i {
    margin-right: 0;
    font-size: 18px;
}

/* Tooltip on hover when collapsed */
.sidebar.collapsed .nav-item:hover .nav-tooltip {
    display: block;
}

.nav-tooltip {
    display: none;
    position: absolute;
    left: 100%;
    top: 0;
    background: var(--bg-sidebar);
    color: var(--text-white);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    white-space: nowrap;
    z-index: 200;
    box-shadow: var(--shadow-md);
    margin-left: 4px;
}

.nav-tooltip::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 50%;
    transform: translateY(-50%);
    border: 4px solid transparent;
    border-right-color: var(--bg-sidebar);
}

/* Main content when sidebar collapsed */
.main-content.collapsed {
    margin-left: var(--sidebar-collapsed);
}

/* Sidebar User Profile */
.sidebar-user {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-user img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-light);
}

.sidebar-user .user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user .user-name {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user .user-role {
    font-size: 11px;
    color: var(--primary-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Sidebar Navigation */
.sidebar-nav {
    padding: 12px 0;
}

.sidebar-nav .nav-section {
    padding: 8px 20px 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
}

.sidebar-nav .nav-item {
    margin: 2px 8px;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: rgba(255,255,255,0.7);
    border-radius: var(--radius);
    transition: var(--transition);
    font-size: 13px;
    font-weight: 500;
}

.sidebar-nav .nav-link:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-white);
}

.sidebar-nav .nav-link.active {
    background: var(--bg-sidebar-active);
    color: var(--text-white);
    box-shadow: 0 4px 12px rgba(99,102,241,0.4);
}

.sidebar-nav .nav-link i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.sidebar-nav .nav-link .badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
}

/* Submenu */
.sidebar-nav .nav-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sidebar-nav .nav-item.open .nav-submenu {
    max-height: 500px;
}

.sidebar-nav .nav-submenu .nav-link {
    padding-left: 48px;
    font-size: 13px;
}

.sidebar-nav .nav-toggle {
    margin-left: auto;
    transition: transform 0.3s ease;
}

.sidebar-nav .nav-item.open .nav-toggle {
    transform: rotate(90deg);
}

/* === Main Content === */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: var(--transition);
}

/* === Header === */
.header {
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-left .page-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.header-left .breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.header-left .breadcrumb a {
    color: var(--text-muted);
}

.header-left .breadcrumb a:hover {
    color: var(--primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
    position: relative;
}

.header-btn:hover {
    background: var(--bg-body);
    border-color: var(--primary);
    color: var(--primary);
}

.header-btn .badge-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--bg-card);
}

/* === Page Content === */
.page-content {
    padding: 10px;
}

/* === Cards === */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

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

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 20px;
}

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

/* === Stat Cards === */
.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-card .stat-icon.primary {
    background: rgba(99,102,241,0.1);
    color: var(--primary);
}

.stat-card .stat-icon.success {
    background: rgba(34,197,94,0.1);
    color: var(--success);
}

.stat-card .stat-icon.warning {
    background: rgba(245,158,11,0.1);
    color: var(--warning);
}

.stat-card .stat-icon.danger {
    background: rgba(239,68,68,0.1);
    color: var(--danger);
}

.stat-card .stat-icon.info {
    background: rgba(6,182,212,0.1);
    color: var(--info);
}

.stat-card .stat-info h4 {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-card .stat-info .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-card .stat-info .stat-change {
    font-size: 12px;
    margin-top: 4px;
}

.stat-change.up {
    color: var(--success);
}

.stat-change.down {
    color: var(--danger);
}

/* === Bootstrap Joli Style Tables === */
.table-container {
    overflow-x: hidden;
    background: #fff;
    border-radius: 0 0 4px 4px;
}

/* Table Toolbar (search + actions) */
.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    flex-wrap: wrap;
    gap: 8px;
}

.table-toolbar .toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-toolbar .toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-search {
    display: flex;
    align-items: center;
    gap: 0;
}

.table-search input {
    padding: 5px 10px;
    border: 1px solid #ced4da;
    border-right: none;
    border-radius: 4px 0 0 4px;
    font-size: 12px;
    outline: none;
    width: 160px;
    transition: border-color 0.15s;
}

.table-search input:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.15rem rgba(0,123,255,0.25);
}

.table-search button {
    padding: 5px 10px;
    background: #6c757d;
    color: #fff;
    border: 1px solid #6c757d;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 12px;
}

.table-search button:hover {
    background: #5a6268;
}

.table-length select {
    padding: 6px 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 13px;
    background: #fff;
}

.table-info {
    font-size: 13px;
    color: #6c757d;
}

/* Table wrapper with border */
.table-wrapper {
    border: 1px solid #dee2e6;
    border-top: none;
    overflow-x: hidden;
}

/* The Table */
.table-modern {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-size: 11px;
    color: #212529;
    table-layout: fixed;
}

/* Header */
.table-modern thead {
    background: #f8f9fa;
}

.table-modern th {
    padding: 10px 6px;
    text-align: left;
    font-size: 10px;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
    user-select: none;
    position: relative;
    cursor: pointer;
    transition: background 0.15s;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table-modern th:hover {
    background: #e9ecef;
}

/* Sort icon */
.table-modern th .sort-icon {
    display: inline-block;
    margin-left: 4px;
    font-size: 10px;
    color: #adb5bd;
    opacity: 0.4;
}

.table-modern th.sort-asc .sort-icon,
.table-modern th.sort-desc .sort-icon {
    opacity: 1;
    color: #0d6efd;
}

.table-modern th.text-right,
.table-modern th.num-col {
    text-align: right;
}

.table-modern th.text-center {
    text-align: center;
}

/* Body */
.table-modern td {
    padding: 5px 6px;
    border-bottom: 1px solid #dee2e6;
    font-size: 11px;
    color: #212529;
    vertical-align: middle;
    white-space: nowrap;
    background: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 0;
}

/* Tooltip for truncated cells */
.table-modern td[title]:hover {
    position: relative;
}

.table-modern td[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background: #212529;
    color: #fff;
    font-size: 10px;
    border-radius: 3px;
    white-space: nowrap;
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Alternating rows */
.table-modern tbody tr:nth-child(even) td {
    background: #f8f9fa;
}

/* Hover */
.table-modern tbody tr:hover td {
    background: #e9ecef;
}

/* Last row */
.table-modern tbody tr:last-child td {
    border-bottom: none;
}

/* ID column */
.table-modern td:first-child {
    font-weight: 600;
    color: #6c757d;
    font-size: 12px;
}

/* Number columns */
.table-modern td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 10px;
}

/* Status labels */
.status-label {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-label.selesai {
    background: #d1e7dd;
    color: #0f5132;
}

.status-label.proses {
    background: #fff3cd;
    color: #664d03;
}

.status-label.partial {
    background: #cff4fc;
    color: #055160;
}

.status-label.menunggu {
    background: #e2e3e5;
    color: #41464b;
}

/* PIC badge */
.pic-badge {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
    background: #e7f1ff;
    color: #084298;
}

/* TW badge */
.tw-badge {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 500;
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

/* Action buttons */
.table-modern .action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 3px;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 10px;
    transition: all 0.15s;
    background: transparent;
}

.table-modern .action-btn.edit {
    color: #0d6efd;
    border-color: #0d6efd;
    background: #fff;
    width: 20px;
    height: 20px;
    font-size: 9px;
}

.table-modern .action-btn.edit:hover {
    background: #0d6efd;
    color: #fff;
}

.table-modern .action-btn.delete {
    color: #dc3545;
    border-color: #dc3545;
    background: #fff;
    width: 20px;
    height: 20px;
    font-size: 9px;
}

.table-modern .action-btn.delete:hover {
    background: #dc3545;
    color: #fff;
}

.table-modern .action-btn.plus {
    color: #198754;
    border-color: #198754;
    background: #fff;
    width: 18px;
    height: 18px;
    font-size: 12px;
    font-weight: 700;
}

.table-modern .action-btn.plus:hover {
    background: #198754;
    color: #fff;
}

.table-modern .action-btn.foto {
    color: #0dcaf0;
    border-color: #0dcaf0;
    background: #fff;
    width: 20px;
    height: 20px;
    font-size: 9px;
}

.table-modern .action-btn.foto:hover {
    background: #0dcaf0;
    color: #fff;
}

/* Modal indicator */
.table-modern .modal-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.table-modern .modal-indicator .amount {
    font-variant-numeric: tabular-nums;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 10px;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

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

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

.btn-success:hover {
    background: #16a34a;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

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

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(99,102,241,0.05);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-xs {
    padding: 4px 8px;
    font-size: 11px;
    border-radius: var(--radius-sm);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius);
}

/* === Forms === */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-card);
    transition: var(--transition);
}

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

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* === Badges === */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-primary {
    background: rgba(99,102,241,0.1);
    color: var(--primary);
}

.badge-success {
    background: rgba(34,197,94,0.1);
    color: var(--success);
}

.badge-warning {
    background: rgba(245,158,11,0.1);
    color: var(--warning);
}

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

.badge-info {
    background: rgba(6,182,212,0.1);
    color: var(--info);
}

/* === Alerts === */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: rgba(34,197,94,0.1);
    color: #15803d;
    border: 1px solid rgba(34,197,94,0.2);
}

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

.alert-warning {
    background: rgba(245,158,11,0.1);
    color: #d97706;
    border: 1px solid rgba(245,158,11,0.2);
}

.alert-info {
    background: rgba(6,182,212,0.1);
    color: #0891b2;
    border: 1px solid rgba(6,182,212,0.2);
}

/* === Modal === */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-box.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    visibility: visible;
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-body);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--danger);
    color: white;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* === Tabs === */
.tabs {
    display: flex;
    gap: 2px;
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 10px;
    overflow-x: auto;
}

.tab-btn {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    transition: all 0.15s;
    white-space: nowrap;
}

.tab-btn:hover {
    color: #0d6efd;
}

.tab-btn.active {
    color: #0d6efd;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #0d6efd;
    border-radius: 2px 2px 0 0;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* === Login Page === */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.login-header {
    padding: 40px 40px 0;
    text-align: center;
}

.login-logo {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    color: white;
    margin: 0 auto 16px;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.login-header p {
    font-size: 14px;
    color: var(--text-muted);
}

.login-body {
    padding: 32px 40px 40px;
}

.login-body .form-group {
    margin-bottom: 20px;
}

.login-body .form-control {
    padding: 14px 16px;
    font-size: 15px;
}

.login-body .btn {
    width: 100%;
    padding: 14px;
    font-size: 15px;
}

/* === Utilities === */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* === Responsive === */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .page-content {
        padding: 16px;
    }
}

/* === Animation === */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

/* === Loading === */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === Dropdown === */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 180px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: var(--transition);
}

.dropdown.show .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 13px;
    color: var(--text-primary);
    transition: var(--transition);
    cursor: pointer;
}

.dropdown-item:hover {
    background: var(--bg-body);
    color: var(--primary);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

/* === Tooltip === */
[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 10px;
    background: var(--text-primary);
    color: white;
    font-size: 11px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    z-index: 100;
    margin-bottom: 6px;
}

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

::-webkit-scrollbar-track {
    background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}
