/* ============================================
   BOR NET CRM & ERP - Comprehensive Style Framework
   Mobile-First Responsive Design
   ============================================ */

:root {
    --primary: #2563EB;
    --primary-hover: #1D4ED8;
    --primary-light: rgba(37, 99, 235, 0.1);
    --primary-dark: #1e40af;
    --secondary: #64748b;
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.1);
    --info: #06b6d4;
    --info-light: rgba(6, 182, 212, 0.1);
    --dark: #0f172a;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --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);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
    --sidebar-width: 280px;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--gray-800);
    background: var(--gray-50);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-hover); }
ul, ol { list-style: none; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }

/* ===== HELP TOOLTIP SYSTEM ===== */
.help-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 10px;
    font-weight: 700;
    cursor: help;
    margin-left: 6px;
    transition: all 0.2s;
    position: relative;
    flex-shrink: 0;
}
.help-tip:hover {
    background: var(--primary);
    color: var(--white);
    transform: scale(1.15);
}
.help-tip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) scale(0.95);
    background: var(--gray-900);
    color: var(--white);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    white-space: normal;
    min-width: 220px;
    max-width: 320px;
    width: max-content;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 99999;
    pointer-events: none;
    box-shadow: var(--shadow-lg);
    text-align: left;
}
.help-tip::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--gray-900);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 99999;
}
.help-tip:hover::after,
.help-tip:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
}
.help-tip:hover::before {
    transform: translateX(-50%) translateY(0);
}
@media (max-width: 768px) {
    .help-tip::after {
        min-width: 180px;
        max-width: 260px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-lg);
    font-weight: 500;
    font-size: 0.875rem;
    line-height: 1.25rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: var(--white); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--white); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,0.3); }
.btn-success { background: var(--success); color: var(--white); }
.btn-success:hover { background: #059669; color: var(--white); transform: translateY(-1px); }
.btn-warning { background: var(--warning); color: var(--white); }
.btn-warning:hover { background: #d97706; color: var(--white); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #dc2626; color: var(--white); }
.btn-outline-primary { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: var(--white); }
.btn-outline-secondary { background: transparent; color: var(--gray-600); border-color: var(--gray-300); }
.btn-outline-secondary:hover { background: var(--gray-100); border-color: var(--gray-400); }
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.75rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }
.btn-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border: none;
}
.btn-gradient:hover { color: var(--white); transform: translateY(-1px); box-shadow: 0 4px 15px rgba(37,99,235,0.4); }
.btn-block { width: 100%; display: flex; }

/* ===== CARDS ===== */
.card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all 0.25s ease;
    box-shadow: var(--shadow-sm);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-body { padding: 1.25rem; }
.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
    font-weight: 600;
}
.card-modern {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
}
.card-modern:hover { box-shadow: var(--shadow-md); }

/* ===== STAT CARDS ===== */
.stat-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: 1.25rem;
    transition: all 0.25s ease;
    height: 100%;
    box-shadow: var(--shadow-sm);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

/* ===== BADGES & LABELS ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: #92400e; }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-info { background: var(--info-light); color: #0e7490; }
.badge-secondary { background: var(--gray-100); color: var(--gray-600); }

/* ===== FORMS ===== */
.form-group { margin-bottom: 1rem; }
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.375rem;
}
.form-control {
    display: block;
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--gray-800);
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.form-control::placeholder { color: var(--gray-400); }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 0.75rem center; background-size: 16px 12px; padding-right: 2.5rem; }
textarea.form-control { min-height: 100px; resize: vertical; }

/* ===== TABLES ===== */
.table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.table th {
    background: var(--gray-50);
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--gray-600);
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}
.table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}
.table tbody tr:hover { background: var(--gray-50); }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ===== ALERTS ===== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    border: 1px solid transparent;
    font-size: 0.875rem;
}
.alert-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.alert-danger { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.alert-info { background: #ecfeff; color: #0e7490; border-color: #a5f3fc; }

/* ===== MODALS ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}
.modal-overlay.show { display: flex; }
.modal-content {
    background: var(--white);
    border-radius: var(--radius-2xl);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
    position: relative;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}
.modal-header h3 { font-size: 1.125rem; font-weight: 600; }
.modal-close {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border: none; background: var(--gray-100);
    border-radius: 50%; cursor: pointer;
    transition: all 0.2s; font-size: 1rem;
}
.modal-close:hover { background: var(--gray-200); }
.modal-body { padding: 1.5rem; }
.modal-footer {
    display: flex; align-items: center; justify-content: flex-end;
    gap: 0.75rem; padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
}

/* ===== SIDEBAR (Dashboard) ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1040;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}
.sidebar-brand {
    padding: 1.25rem;
    text-align: center;
    border-bottom: 1px solid var(--gray-200);
}
.sidebar-nav { flex: 1; padding: 0.5rem 0; }
.sidebar-nav .nav-item { margin: 0; }
.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.25rem;
    color: var(--gray-600);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    border-radius: 0;
    margin: 0;
    text-decoration: none;
}
.sidebar-nav .nav-link:hover {
    background: var(--gray-100);
    color: var(--primary);
}
.sidebar-nav .nav-link.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}
.hover-shadow:hover { box-shadow: 0 8px 25px rgba(0,0,0,0.1); transform: translateY(-2px); }
.sidebar-nav .sidebar-label {
    padding: 0.75rem 1.25rem 0.25rem;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-400);
    font-weight: 700;
}
.sidebar-nav .sidebar-label i { width: 16px; text-align: center; font-size: 0.7rem; }
.sidebar-nav .nav-link i { width: 20px; text-align: center; font-size: 1rem; }
.sidebar-nav .nav-link .sidebar-notif-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    font-size: 0.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}
.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--gray-200);
}
.main-content {
    margin-left: var(--sidebar-width);
    padding: 1.5rem;
    min-height: 100vh;
    transition: margin-left 0.3s;
}
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 1050;
    width: 42px;
    height: 42px;
    border: none;
    background: var(--white);
    border-radius: 50%;
    box-shadow: var(--shadow-md);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}
.mobile-notif-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--danger);
    border: 2px solid white;
    pointer-events: none;
}
.mobile-menu-btn:hover { box-shadow: var(--shadow-lg); transform: scale(1.05); }

/* ===== WIDGET SYSTEM ===== */
.widget-container { min-height: 200px; }
.widget-item { margin-bottom: 1.5rem; }
.widget-header {
    cursor: grab;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    user-select: none;
}
.widget-header:active { cursor: grabbing; }
.widget-header i.fa-grip-vertical { color: var(--gray-400); font-size: 0.875rem; }
.sortable-ghost { opacity: 0.3; }
.sortable-chosen { box-shadow: var(--shadow-lg); }

/* ===== LOADING OVERLAY ===== */
.loading-overlay {
    position: fixed; inset: 0; z-index: 99999;
    background: rgba(255,255,255,0.85);
    display: none; align-items: center; justify-content: center;
    flex-direction: column; gap: 1rem;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.loading-overlay.show { display: flex; }
.loading-overlay .spinner {
    width: 50px; height: 50px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.loading-overlay .loading-text {
    font-size: 0.9rem; color: var(--gray-600);
    font-weight: 500;
}

/* Loading state for buttons */
.btn-loading {
    position: relative; pointer-events: none; opacity: 0.8;
}
.btn-loading::after {
    content: ''; display: inline-block;
    width: 1rem; height: 1rem;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center; padding: 3rem 1.5rem;
    color: var(--gray-500);
}
.empty-state .empty-icon {
    font-size: 3rem; margin-bottom: 1rem;
    color: var(--gray-300);
    display: block;
}
.empty-state .empty-title {
    font-size: 1.1rem; font-weight: 600;
    color: var(--gray-600); margin-bottom: 0.5rem;
}
.empty-state .empty-desc {
    font-size: 0.9rem; color: var(--gray-500);
    margin-bottom: 1rem; max-width: 400px;
    margin-left: auto; margin-right: auto;
}
.empty-state .empty-action {
    display: inline-block;
}

/* ===== MISSING COMMON CLASSES ===== */
.container-custom { max-width: 1400px; margin: 0 auto; padding: 0 1rem; }
.page-header {
    display: flex; justify-content: space-between;
    align-items: center; flex-wrap: wrap; gap: 1rem;
    margin-bottom: 1.5rem;
}
.search-box {
    display: flex; align-items: center; gap: 0.5rem;
    background: #fff; border: 1px solid var(--gray-200);
    border-radius: 0.75rem; padding: 0.4rem 0.8rem;
    transition: border-color 0.2s;
}
.search-box:focus-within { border-color: var(--primary); }
.search-box input { border: none; outline: none; flex: 1; font-size: 0.9rem; background: transparent; }
.search-box i { color: var(--gray-400); }
.table-premium { margin-bottom: 0; }
.table-premium thead th {
    background: var(--gray-50); font-weight: 600;
    font-size: 0.8rem; text-transform: uppercase;
    letter-spacing: 0.03em; color: var(--gray-600);
    border-bottom: 2px solid var(--gray-200);
    padding: 0.75rem 1rem;
}
.badge-balance { font-weight: 600; font-size: 0.9rem; }
.badge-balance.positive { color: var(--success); }
.badge-balance.negative { color: var(--danger); }
.badge-balance.zero { color: var(--gray-400); }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }

/* ===== RESPONSIVE BREAKPOINTS ===== */

/* Tablet (768px-1024px) */
@media (max-width: 1024px) {
    :root { --sidebar-width: 240px; }
    .sidebar { width: var(--sidebar-width); }
    .main-content { margin-left: var(--sidebar-width); padding: 1.25rem; }
    .container { padding-left: 1rem; padding-right: 1rem; }
}

/* Mobile (768px and below) */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        box-shadow: var(--shadow-xl);
    }
    .sidebar.show { transform: translateX(0); }
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.4);
        z-index: 1035;
    }
    .sidebar-overlay.show { display: block; }
    .main-content { margin-left: 0; padding: 1rem; padding-top: 4rem; }
    .mobile-menu-btn { display: flex; }

    .stat-card { padding: 1rem; }
    .stat-card h3 { font-size: 1.25rem; }
    .card-body { padding: 1rem; }

    .table th, .table td { padding: 0.5rem 0.625rem; font-size: 0.8125rem; }

    .modal-content { max-width: 100%; margin: 0.5rem; border-radius: var(--radius-xl); }
    .modal-header { padding: 1rem 1.25rem; }
    .modal-body { padding: 1.25rem; }

    .btn { padding: 0.5rem 1rem; font-size: 0.8125rem; }
    .btn-sm { padding: 0.3125rem 0.625rem; font-size: 0.75rem; }
    .btn-lg { padding: 0.625rem 1.25rem; font-size: 0.9375rem; }

    .help-tip::after {
        min-width: 180px;
        max-width: 260px;
        font-size: 11px;
    }

    .row { margin-left: -0.5rem; margin-right: -0.5rem; }
    .row > [class*="col-"] { padding-left: 0.5rem; padding-right: 0.5rem; }
    .g-4 > [class*="col-"] { padding-top: 0.5rem; padding-bottom: 0.5rem; }
}

/* Small Mobile (480px and below) */
@media (max-width: 480px) {
    .sidebar { width: 260px; }
    .main-content { padding: 0.75rem; padding-top: 3.75rem; }
    .stat-card { padding: 0.75rem; }
    .stat-icon { width: 36px; height: 36px; font-size: 1rem; }
    .stat-card h3 { font-size: 1.125rem; }
    .card-body { padding: 0.75rem; }
    .btn { padding: 0.4375rem 0.875rem; font-size: 0.75rem; }
    .badge { font-size: 0.6875rem; padding: 0.1875rem 0.5rem; }
    .table th, .table td { padding: 0.375rem 0.5rem; font-size: 0.75rem; }
    .help-tip { width: 16px; height: 16px; font-size: 9px; }
    .help-tip::after { min-width: 150px; max-width: 220px; }
    .modal-content { border-radius: var(--radius-lg); }
}

/* ===== UTILITY CLASSES ===== */
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--gray-500); }
.text-white { color: var(--white); }
.bg-white { background: var(--white); }
.bg-primary { background: var(--primary); }
.bg-light { background: var(--gray-50); }
.bg-gradient-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.fw-medium { font-weight: 500; }
.fs-sm { font-size: 0.75rem; }
.fs-md { font-size: 0.875rem; }
.fs-lg { font-size: 1rem; }
.text-center { text-align: center; }
.text-end { text-align: right; }
.d-flex { display: flex; }
.d-none { display: none; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.5rem; }
.rounded-circle { border-radius: 50%; }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.position-relative { position: relative; }
.position-fixed { position: fixed; }
.w-100 { width: 100%; }
.h-100 { height: 100%; }
.list-unstyled { list-style: none; padding: 0; }
.border-bottom { border-bottom: 1px solid var(--gray-200); }
.border-top { border-top: 1px solid var(--gray-200); }
.overflow-hidden { overflow: hidden; }

/* Grid system */
.row { display: flex; flex-wrap: wrap; margin: 0; }
.col-12 { flex: 0 0 100%; max-width: 100%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }

@media (min-width: 576px) {
    .col-sm-6 { flex: 0 0 50%; max-width: 50%; }
    .col-sm-4 { flex: 0 0 33.333%; max-width: 33.333%; }
    .col-sm-3 { flex: 0 0 25%; max-width: 25%; }
}
@media (min-width: 768px) {
    .col-md-3 { flex: 0 0 25%; max-width: 25%; }
    .col-md-4 { flex: 0 0 33.333%; max-width: 33.333%; }
    .col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .col-md-8 { flex: 0 0 66.667%; max-width: 66.667%; }
    .d-md-none { display: none; }
    .d-md-block { display: block; }
}
@media (min-width: 992px) {
    .col-lg-3 { flex: 0 0 25%; max-width: 25%; }
    .col-lg-4 { flex: 0 0 33.333%; max-width: 33.333%; }
    .col-lg-6 { flex: 0 0 50%; max-width: 50%; }
    .col-lg-8 { flex: 0 0 66.667%; max-width: 66.667%; }
}
@media (min-width: 1200px) {
    .col-xl-3 { flex: 0 0 25%; max-width: 25%; }
    .col-xl-4 { flex: 0 0 33.333%; max-width: 33.333%; }
    .col-xl-6 { flex: 0 0 50%; max-width: 50%; }
    .col-xl-8 { flex: 0 0 66.667%; max-width: 66.667%; }
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    margin-top: 1.5rem;
}
.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--gray-600);
    background: var(--white);
    border: 1px solid var(--gray-200);
    text-decoration: none;
    transition: all 0.2s;
}
.pagination a:hover { background: var(--gray-100); border-color: var(--gray-300); }
.pagination .active { background: var(--primary); color: var(--white); border-color: var(--primary); }

/* Tabs */
.nav-tabs {
    display: flex;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 1.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0;
}
.nav-tabs .tab-link {
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-500);
    border: none;
    background: none;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}
.nav-tabs .tab-link:hover { color: var(--primary); }
.nav-tabs .tab-link.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeIn 0.3s ease; }

/* List group */
.list-group { display: flex; flex-direction: column; }
.list-group-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.2s;
}
.list-group-item:hover { background: var(--gray-50); }
.list-group-item:last-child { border-bottom: none; }

/* Progress bar */
.progress {
    height: 8px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

/* Responsive iframe container */
.responsive-video {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}
.responsive-video iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}

/* ===== NOTIFICATION BELL & DROPDOWN ===== */
.notif-bell-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--gray-100);
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.1rem;
}
.notif-bell-btn:hover { background: var(--primary-light); color: var(--primary); }
.notif-bell-btn .notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--danger);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid white;
    line-height: 1;
}
.notif-bell-btn .notif-badge.hidden { display: none; }

.notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    max-height: 420px;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    border: 1px solid var(--gray-200);
    z-index: 10000;
    overflow: hidden;
    display: none;
    animation: slideDown 0.2s ease;
}
.notif-dropdown.show { display: block; }
.notif-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}
.notif-dropdown-header h6 { font-size: 0.8rem; font-weight: 600; margin: 0; }
.notif-dropdown-body {
    max-height: 340px;
    overflow-y: auto;
}
.notif-dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
}
.notif-dropdown-item:hover { background: var(--gray-50); }
.notif-dropdown-item.unread { background: #EFF6FF; }
.notif-dropdown-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.75rem;
}
.notif-dropdown-title { font-size: 0.78rem; font-weight: 600; color: #1E293B; line-height: 1.3; }
.notif-dropdown-msg { font-size: 0.7rem; color: #64748B; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.notif-dropdown-time { font-size: 0.65rem; color: #94A3B8; margin-top: 2px; }
.notif-dropdown-footer {
    padding: 0.6rem;
    text-align: center;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}
.notif-dropdown-footer a { font-size: 0.75rem; font-weight: 500; }

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

@media (max-width: 576px) {
    .notif-dropdown { width: 300px; right: -60px; }
}



/* Print */
@media print {
    .sidebar, .mobile-menu-btn, .sidebar-overlay, .no-print, .btn, nav { display: none !important; }
    .main-content { margin-left: 0 !important; padding: 0 !important; }
    .card, .stat-card { box-shadow: none; border: 1px solid #ddd; }
    body { font-size: 12pt; }
}
