/* ============================================================
   TVL Project TRACE — Main Application Stylesheet
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
    --trace-blue: #0b4aa2;
    --trace-blue-dark: #083b82;
    --trace-blue-light: #1a6fd4;
    --trace-accent: #00b4d8;
    --trace-green: #10b981;
    --trace-orange: #f59e0b;
    --trace-red: #ef4444;
    --trace-purple: #8b5cf6;
    --sidebar-width: 260px;
    --topbar-height: 60px;
    --font-primary: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ---------- Global Reset & Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-size: 0.9rem;
    color: #1f2937;
    background: #f0f2f5;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ---------- Sidebar ---------- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #0b4aa2 0%, #062d61 100%);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1050;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

/* Sidebar scrollbar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

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

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* Sidebar Brand */
.brand-logo-img {
    width: 34px !important;
    height: 34px !important;
    max-width: 34px !important;
    max-height: 34px !important;
    border-radius: 50%;
    object-fit: contain;
    background: rgba(255,255,255,0.15);
    padding: 2px;
    flex-shrink: 0;
}

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

.sidebar-brand .brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-brand .brand-logo img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.sidebar-brand .brand-logo i {
    font-size: 1.3rem;
    color: #fff;
}

.sidebar-brand .brand-text {
    display: flex;
    flex-direction: column;
}

.sidebar-brand .brand-text .brand-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    letter-spacing: 0.5px;
}

.sidebar-brand .brand-text .brand-sub {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 0.3px;
}

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

.nav-section {
    padding: 18px 20px 6px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255, 255, 255, 0.4);
}

.nav-item {
    padding: 2px 12px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.84rem;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

.nav-link i {
    font-size: 1.05rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--trace-accent);
}

.nav-link .badge {
    margin-left: auto;
    font-size: 0.65rem;
    padding: 2px 7px;
    border-radius: 10px;
}

/* Sidebar user info */
.sidebar-user {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

.sidebar-user .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-user .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.sidebar-user .user-name {
    font-size: 0.82rem;
    color: #fff;
    font-weight: 600;
}

.sidebar-user .user-role {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Sidebar footer - removed, now in page-footer */

/* ---------- Page Footer ---------- */
.page-footer {
    margin-left: var(--sidebar-width);
    padding: 16px 24px;
    text-align: center;
    color: #9ca3af;
    font-size: 0.78rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    transition: margin-left 0.3s ease;
}

/* ---------- Topbar ---------- */
.topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1040;
    transition: left 0.3s ease;
}

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

.topbar-left .page-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.topbar-left .page-title i {
    margin-right: 8px;
    color: var(--trace-blue);
}

#sidebarToggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: #374151;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: background 0.2s;
}

#sidebarToggle:hover {
    background: #f3f4f6;
}

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

.topbar-right .topbar-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: none;
    background: #f3f4f6;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    position: relative;
}

.topbar-right .topbar-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.topbar-right .topbar-btn .notification-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--trace-red);
    border-radius: 50%;
    border: 2px solid #fff;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 12px 4px 4px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.topbar-user:hover {
    background: #f3f4f6;
}

.topbar-user .avatar-sm {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--trace-blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
}

.topbar-user .user-display-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
}

.topbar-user .user-display-role {
    font-size: 0.7rem;
    color: #9ca3af;
}

.topbar-right .user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 12px 4px 4px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.topbar-right .user-menu:hover {
    background: #f3f4f6;
}

.topbar-right .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--trace-blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.topbar-right .user-info .name {
    font-size: 0.84rem;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
}

.topbar-right .user-info .name .text-muted {
    font-weight: 400;
    font-size: 0.78rem;
}

/* ---------- Main Content ---------- */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height);
    padding: 24px;
    min-height: calc(100vh - var(--topbar-height));
    transition: margin-left 0.3s ease;
}

/* ---------- Glass Cards ---------- */
.glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 14px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.8);
    padding: 24px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.glass-card .card-header-custom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f0f0f0;
}

.glass-card .card-header-custom h5,
.glass-card .card-header-custom h6 {
    margin: 0;
    font-weight: 700;
    color: #1f2937;
}

/* ---------- Stat Cards ---------- */
.stat-card {
    border-radius: 14px;
    padding: 22px 20px;
    color: #fff;
    position: relative;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.stat-card .stat-icon {
    position: absolute;
    top: 14px;
    right: 18px;
    font-size: 2.8rem;
    opacity: 0.3;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 0.82rem;
    opacity: 0.85;
    font-weight: 500;
}

.stat-card .stat-change {
    font-size: 0.72rem;
    margin-top: 8px;
    opacity: 0.8;
}

.stat-card .stat-change i {
    margin-right: 3px;
}

/* Stat card gradient backgrounds */
.bg-blue {
    background: linear-gradient(135deg, #0b4aa2 0%, #1a6fd4 100%);
}

.bg-green {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
}

.bg-orange {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
}

.bg-red {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
}

.bg-purple {
    background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 100%);
}

.bg-teal {
    background: linear-gradient(135deg, #0891b2 0%, #00b4d8 100%);
}

/* ---------- Tables ---------- */
.table-container {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.table-header h6 {
    margin: 0;
    font-weight: 700;
    color: #1f2937;
}

.table-responsive {
    overflow-x: auto;
}

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

.table thead th {
    background: #f8f9fc;
    padding: 12px 16px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #6b7280;
    border-bottom: 2px solid #e5e7eb;
    white-space: nowrap;
}

.table tbody td {
    padding: 12px 16px;
    font-size: 0.84rem;
    color: #374151;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.table tbody tr:hover {
    background: #f9fafb;
}

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

.table .actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.table .actions .btn {
    padding: 5px 10px;
    font-size: 0.75rem;
}

/* Table info row */
.table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-top: 1px solid #f0f0f0;
    font-size: 0.8rem;
    color: #6b7280;
}

/* ---------- Buttons ---------- */
.btn-trace {
    background: linear-gradient(135deg, var(--trace-blue) 0%, var(--trace-blue-light) 100%);
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-trace:hover {
    background: linear-gradient(135deg, var(--trace-blue-dark) 0%, var(--trace-blue) 100%);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(11, 74, 162, 0.35);
}

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

.btn-outline-trace {
    background: transparent;
    color: var(--trace-blue);
    border: 1.5px solid var(--trace-blue);
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-outline-trace:hover {
    background: var(--trace-blue);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(11, 74, 162, 0.25);
}

.btn-sm {
    padding: 5px 14px;
    font-size: 0.78rem;
}

.btn-xs {
    padding: 3px 10px;
    font-size: 0.72rem;
    border-radius: 6px;
}

.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.85rem;
}

/* ---------- Forms ---------- */
.form-control,
.form-select {
    border-radius: 8px;
    border: 1.5px solid #d1d5db;
    padding: 9px 14px;
    font-size: 0.84rem;
    color: #374151;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--trace-blue);
    box-shadow: 0 0 0 3px rgba(11, 74, 162, 0.12);
    outline: none;
}

.form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.form-text {
    font-size: 0.75rem;
    color: #9ca3af;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* Input groups with icons */
.input-group-icon {
    position: relative;
}

.input-group-icon .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 0.9rem;
    z-index: 2;
    pointer-events: none;
}

.input-group-icon .form-control {
    padding-left: 40px;
}

/* ---------- Badges ---------- */
.badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0.3px;
}

/* Role badges */
.badge-superadmin {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.badge-admin {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

.badge-user {
    background: rgba(11, 74, 162, 0.1);
    color: var(--trace-blue);
}

/* Certification badges */
.badge-nc-i {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.badge-nc-ii {
    background: rgba(11, 74, 162, 0.1);
    color: var(--trace-blue);
}

.badge-nc-iii {
    background: rgba(139, 92, 246, 0.12);
    color: #7c3aed;
}

.badge-nc-iv {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

.badge-tmc {
    background: rgba(236, 72, 153, 0.12);
    color: #db2777;
}

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

/* Strand badges */
.badge-afa {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.badge-he {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

.badge-ia {
    background: rgba(11, 74, 162, 0.1);
    color: var(--trace-blue);
}

.badge-ict {
    background: rgba(139, 92, 246, 0.12);
    color: #7c3aed;
}

/* Type badges */
.badge-elementary {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.badge-secondary {
    background: rgba(11, 74, 162, 0.1);
    color: var(--trace-blue);
}

/* Status badges */
.badge-active {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.badge-inactive {
    background: rgba(107, 114, 128, 0.12);
    color: #6b7280;
}

.badge-pending {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

/* ---------- Chart Cards ---------- */
.chart-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.chart-card .chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.chart-card .chart-header h6 {
    margin: 0;
    font-weight: 700;
    color: #1f2937;
}

.chart-card .chart-body {
    padding: 20px;
}

/* ---------- Modals ---------- */
.modal-content {
    border: none;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-header-gradient {
    background: linear-gradient(135deg, var(--trace-blue) 0%, var(--trace-blue-light) 100%);
    color: #fff;
    padding: 18px 24px;
    border-bottom: none;
}

.modal-header-gradient .modal-title {
    font-weight: 700;
    font-size: 1.05rem;
}

.modal-header-gradient .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.modal-header-gradient .btn-close:hover {
    opacity: 1;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #f0f0f0;
}

/* ---------- Flash / Alert Messages ---------- */
.flash-alert {
    border-radius: 10px;
    padding: 14px 20px;
    font-size: 0.84rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    border: none;
    animation: flashSlideIn 0.4s ease;
}

.flash-alert i {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.flash-alert .btn-close {
    margin-left: auto;
    font-size: 0.7rem;
}

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

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

.flash-alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.flash-alert-info {
    background: rgba(0, 180, 216, 0.1);
    color: #0891b2;
}

@keyframes flashSlideIn {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- Empty State ---------- */
.empty-state {
    text-align: center;
    padding: 50px 20px;
}

.empty-state .empty-icon {
    font-size: 3.5rem;
    color: #d1d5db;
    margin-bottom: 16px;
}

.empty-state h5 {
    font-weight: 700;
    color: #6b7280;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.84rem;
    color: #9ca3af;
    max-width: 360px;
    margin: 0 auto 20px;
}

/* ---------- Search Bar ---------- */
.search-bar {
    position: relative;
    max-width: 320px;
}

.search-bar .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 0.85rem;
    pointer-events: none;
}

.search-bar .search-input {
    width: 100%;
    padding: 9px 16px 9px 42px;
    border-radius: 20px;
    border: 1.5px solid #e5e7eb;
    font-size: 0.82rem;
    background: #f9fafb;
    transition: all 0.2s;
}

.search-bar .search-input:focus {
    border-color: var(--trace-blue);
    box-shadow: 0 0 0 3px rgba(11, 74, 162, 0.1);
    background: #fff;
    outline: none;
}

.search-bar .search-input::placeholder {
    color: #9ca3af;
}

/* ---------- Filter Bar ---------- */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: #fafbfc;
    border-bottom: 1px solid #f0f0f0;
}

.filter-bar .form-select,
.filter-bar .form-control {
    max-width: 200px;
    font-size: 0.8rem;
    padding: 7px 12px;
    border-radius: 8px;
}

.filter-bar .filter-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #6b7280;
    white-space: nowrap;
}

.filter-bar .btn {
    font-size: 0.8rem;
    padding: 7px 16px;
}

/* ---------- Breadcrumb ---------- */
.breadcrumb-trace {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #9ca3af;
    margin-bottom: 16px;
}

.breadcrumb-trace a {
    color: var(--trace-blue);
    font-weight: 500;
}

.breadcrumb-trace a:hover {
    text-decoration: underline;
}

.breadcrumb-trace .separator {
    color: #d1d5db;
}

.breadcrumb-trace .current {
    color: #6b7280;
    font-weight: 600;
}

/* ---------- Sidebar Overlay (Mobile) ---------- */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1045;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

/* ---------- Pagination ---------- */
.pagination-trace .page-link {
    border-radius: 8px;
    margin: 0 2px;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #374151;
    border: 1px solid #e5e7eb;
    transition: all 0.2s;
}

.pagination-trace .page-link:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.pagination-trace .page-item.active .page-link {
    background: var(--trace-blue);
    border-color: var(--trace-blue);
    color: #fff;
}

/* ---------- Utility Classes ---------- */
.text-trace {
    color: var(--trace-blue) !important;
}

.text-muted-sm {
    font-size: 0.78rem;
    color: #9ca3af;
}

.fw-700 {
    font-weight: 700;
}

.gap-1 {
    gap: 4px;
}

.gap-2 {
    gap: 8px;
}

.gap-3 {
    gap: 12px;
}

.rounded-14 {
    border-radius: 14px;
}

/* ---------- Responsive: Tablet & Small Desktop ---------- */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .topbar {
        left: 0;
    }

    .main-content {
        margin-left: 0;
    }

    .page-footer {
        margin-left: 0;
    }

    #sidebarToggle {
        display: block;
    }

    .sidebar-overlay.show {
        display: block;
    }
}

/* ---------- Responsive: Mobile ---------- */
@media (max-width: 575.98px) {
    .main-content {
        padding: 16px 12px;
    }

    .topbar {
        padding: 0 12px;
    }

    .topbar-left .page-title {
        font-size: 0.95rem;
    }

    .stat-card {
        padding: 16px 14px;
    }

    .stat-card .stat-value {
        font-size: 1.5rem;
    }

    .stat-card .stat-icon {
        font-size: 2rem;
    }

    .glass-card {
        padding: 16px;
        border-radius: 10px;
    }

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

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

    .filter-bar .form-select,
    .filter-bar .form-control {
        max-width: 100%;
    }

    .search-bar {
        max-width: 100%;
    }

    .table-footer {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .modal-body {
        padding: 16px;
    }

    .page-footer {
        padding: 12px 16px;
        font-size: 0.72rem;
    }

    /* Responsive form columns on mobile */
    .row.g-3 > [class*="col-md-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .d-flex.justify-content-between {
        flex-direction: column;
        gap: 12px;
    }
}

/* ---------- Print Styles ---------- */
@media print {
    .sidebar,
    .topbar,
    .sidebar-overlay,
    #sidebarToggle,
    .btn,
    .filter-bar,
    .search-bar,
    .flash-alert,
    .modal {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        margin-top: 0 !important;
        padding: 0 !important;
    }

    .stat-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #e5e7eb;
        color: #000 !important;
        background: #fff !important;
    }

    .glass-card,
    .table-container,
    .chart-card {
        box-shadow: none;
        break-inside: avoid;
    }

    .table thead th {
        background: #f0f0f0 !important;
    }

    body {
        background: #fff;
        font-size: 10pt;
    }
}
