* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f2f5; color: #333; font-size: 0.9rem;
    -webkit-font-smoothing: antialiased;
}

/* Sidebar */
#wrapper { min-height: 100vh; }
.sidebar {
    width: 250px; background: linear-gradient(180deg, #1a2332 0%, #0f1724 100%);
    color: #fff; position: fixed; top: 0; left: 0; height: 100vh; z-index: 1000;
    overflow-y: auto; transition: transform 0.3s ease;
}
.sidebar-header { padding: 1.2rem 1rem; border-bottom: 1px solid rgba(255,255,255,0.06); }
.sidebar-header h5 { font-weight: 700; letter-spacing: -0.5px; }
.sidebar-header h5 i { color: #3b82f6; margin-right: 6px; }
.sidebar .nav-link {
    color: rgba(255,255,255,0.55); padding: 0.65rem 1rem; font-size: 0.875rem;
    border-left: 3px solid transparent; transition: all 0.2s; display: flex; align-items: center;
}
.sidebar .nav-link:hover { color: #fff; background: rgba(255,255,255,0.05); border-left-color: #3b82f6; }
.sidebar .nav-link i { margin-right: 10px; width: 18px; text-align: center; font-size: 1rem; }
.sidebar .collapse .nav-link { padding-left: 2.8rem; font-size: 0.82rem; }
.sidebar .nav-item .nav-link[data-bs-toggle="collapse"] i.bi-chevron-down { transition: transform 0.2s; font-size: 0.7rem; }
.sidebar .nav-item .nav-link[data-bs-toggle="collapse"][aria-expanded="true"] i.bi-chevron-down { transform: rotate(180deg); }

#page-content { flex: 1; transition: margin-left 0.3s; }
#page-content.with-sidebar { margin-left: 250px; }

/* Topbar */
.topbar {
    background: linear-gradient(135deg, #1a2332, #243044);
    padding: 0.5rem 1rem; box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    min-height: 52px;
}
.topbar .navbar-brand { font-weight: 600; font-size: 1rem; }

/* Cards */
.card { border: none; box-shadow: 0 1px 3px rgba(0,0,0,0.06); border-radius: 0.75rem; margin-bottom: 1rem; background: #fff; transition: box-shadow 0.2s; }
.card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.card-header {
    background: #fff; border-bottom: 1px solid #f0f0f0; font-weight: 600;
    padding: 0.85rem 1.25rem; border-radius: 0.75rem 0.75rem 0 0 !important; font-size: 0.9rem;
}

/* Stat Cards */
.stat-card { border-radius: 0.75rem; padding: 1.25rem; position: relative; overflow: hidden; text-align: center; }
.stat-card .stat-icon { font-size: 2.2rem; opacity: 0.25; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); }
.stat-card h6 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.85; margin-bottom: 0.3rem; }
.stat-card h3 { font-weight: 700; margin: 0; }

/* Tables */
.table th {
    background: #f8f9fa; font-weight: 600; font-size: 0.75rem;
    text-transform: uppercase; letter-spacing: 0.5px; color: #6b7280;
    padding: 0.7rem 0.75rem !important; border-bottom-width: 1px !important;
}
.table td { padding: 0.65rem 0.75rem !important; vertical-align: middle; }
.table-hover tbody tr:hover { background: #f8faff; }

/* Forms */
.form-control, .form-select {
    border: 1px solid #e2e8f0; border-radius: 0.5rem; font-size: 0.875rem;
    padding: 0.45rem 0.75rem; transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus, .form-select:focus {
    border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.12); outline: none;
}
.form-label { font-size: 0.8rem; font-weight: 500; margin-bottom: 0.25rem; color: #475569; }
.item-row input[readonly] { border: none; background: transparent; padding-left: 0; cursor: default; }

/* Buttons */
.btn { border-radius: 0.5rem; font-size: 0.85rem; padding: 0.4rem 0.9rem; font-weight: 500; transition: all 0.15s; }
.btn-dark { background: #1a2332; border-color: #1a2332; }
.btn-dark:hover { background: #243044; border-color: #243044; }
.btn-outline-dark { color: #1a2332; border-color: #d1d5db; }
.btn-outline-dark:hover { background: #1a2332; color: #fff; }
.btn-sm { font-size: 0.78rem; padding: 0.3rem 0.65rem; border-radius: 0.4rem; }
.btn-outline-danger { border-color: #fecaca; color: #dc2626; }
.btn-outline-danger:hover { background: #dc2626; color: #fff; border-color: #dc2626; }
.btn-outline-primary { border-color: #bfdbfe; color: #2563eb; }
.btn-outline-primary:hover { background: #2563eb; color: #fff; border-color: #2563eb; }

/* Badges */
.badge { font-weight: 500; font-size: 0.7rem; padding: 0.25em 0.6em; border-radius: 0.35rem; }

/* Alerts */
.alert { border: none; border-radius: 0.75rem; font-size: 0.85rem; }

/* Pagination */
.page-link { color: #1a2332; border-radius: 0.4rem !important; margin: 0 1px; font-size: 0.85rem; }
.page-item.active .page-link { background: #1a2332; border-color: #1a2332; box-shadow: 0 1px 3px rgba(26,35,50,0.3); }
.pagination { gap: 2px; }

/* Search */
.search-box { max-width: 280px; }
.search-box .input-group-text { background: #fff; border-right: none; }

/* Print */
@media print {
    .sidebar, .topbar, nav.navbar, #page-content>nav, .no-print { display: none !important; }
    #page-content.with-sidebar, #page-content { margin-left: 0 !important; }
    .container-fluid { padding: 0 !important; }
    .card { box-shadow: none !important; border: 1px solid #ddd !important; }
}

/* Mobile */
@media (max-width: 767px) {
    .sidebar { transform: translateX(-100%); box-shadow: 2px 0 12px rgba(0,0,0,0.2); }
    .sidebar.show { transform: translateX(0); }
    #page-content.with-sidebar { margin-left: 0; }
    .search-box { max-width: 100%; }
    .table-responsive-cards .table thead { display: none; }
    .table-responsive-cards .table tbody tr { display: block; border: 1px solid #e2e8f0; border-radius: 0.5rem; padding: 0.5rem; margin-bottom: 0.5rem; }
    .table-responsive-cards .table tbody td { display: flex; justify-content: space-between; border: none; padding: 0.25rem 0 !important; font-size: 0.82rem; }
    .table-responsive-cards .table tbody td:before { content: attr(data-label); font-weight: 600; color: #6b7280; margin-right: 8px; }
}

/* Misc */
.text-end { text-align: right !important; }
.img-thumbnail { border-radius: 0.4rem; padding: 2px; }
hr { opacity: 0.15; }
small { font-size: 0.78rem; }

/* Nav tabs */
.nav-tabs .nav-link { color: #6b7280; border: none; border-bottom: 2px solid transparent; padding: 0.6rem 1rem; font-size: 0.85rem; }
.nav-tabs .nav-link.active { color: #1a2332; border-bottom-color: #3b82f6; background: none; }
.nav-tabs .nav-link:hover { border-bottom-color: #bfdbfe; }
