/* =============================================
   SUPERMARKETS.Admin — Admin CSS
   Inspired by napopustu.me consumer design
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ─── CSS VARIABLES ─────────────────────────────────────────────────────── */
:root {
    --primary: #E63946;
    --primary-dark: #c1121f;
    --primary-light: #ff6b6b;
    --primary-muted: rgba(230, 57, 70, 0.1);

    --sidebar-bg: #1a1a2e;
    --sidebar-width: 260px;
    --sidebar-text: #c8cdd8;
    --sidebar-text-muted: #7a8195;
    --sidebar-active-bg: rgba(230, 57, 70, 0.15);
    --sidebar-hover-bg: rgba(255,255,255,0.06);
    --sidebar-section-label: #556080;
    --sidebar-border: rgba(255,255,255,0.07);

    --topbar-height: 58px;
    --bottom-nav-height: 62px;

    --surface: #ffffff;
    --surface-2: #f5f6fa;
    --border: #e4e6ef;
    --text-primary: #181c32;
    --text-secondary: #5e6278;
    --text-hint: #a1a5b7;

    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --shadow: 0 2px 12px rgba(0,0,0,0.07);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --shadow-sidebar: 4px 0 24px rgba(0,0,0,0.18);

    --transition: 0.25s ease;
}

/* ─── RESET & BASE ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body.admin-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.875rem;
    background: var(--surface-2);
    color: var(--text-primary);
    margin: 0;
    overflow-x: hidden;
}

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

/* ─── LAYOUT ─────────────────────────────────────────────────────────────── */
.admin-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1050;
    transition: transform var(--transition);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.admin-sidebar::-webkit-scrollbar { width: 4px; }
.admin-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.admin-main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition);
}

/* Mobile: sidebar hidden by default */
@media (max-width: 991.98px) {
    .admin-sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-sidebar);
    }
    .admin-sidebar.open {
        transform: translateX(0);
    }
    .admin-main {
        margin-left: 0;
        padding-bottom: var(--bottom-nav-height);
    }
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1040;
    backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* ─── SIDEBAR BRAND ─────────────────────────────────────────────────────── */
.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 16px 14px;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.brand-logo {
    width: 34px;
    height: 34px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    flex-shrink: 0;
}

.brand-text {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.brand-dot { color: var(--primary-light); }

.sidebar-close-btn {
    background: none;
    border: none;
    color: var(--sidebar-text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    line-height: 1;
    transition: color var(--transition);
}
.sidebar-close-btn:hover { color: #fff; }

/* ─── SIDEBAR USER ──────────────────────────────────────────────────────── */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    background: rgba(230, 57, 70, 0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-light);
    font-size: 1rem;
    flex-shrink: 0;
}

.sidebar-user-name {
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}
.sidebar-user-role {
    color: var(--sidebar-text-muted);
    font-size: 0.7rem;
}

/* ─── SIDEBAR NAVIGATION ────────────────────────────────────────────────── */
.sidebar-nav {
    flex: 1;
    padding: 8px 0 16px;
    overflow-y: auto;
}

.nav-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--sidebar-section-label);
    padding: 14px 16px 4px;
}

/* Simple nav link (no children) */
.nav-link-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    color: var(--sidebar-text);
    font-size: 0.825rem;
    font-weight: 500;
    border-radius: 0;
    transition: background var(--transition), color var(--transition);
    border-left: 3px solid transparent;
}
.nav-link-item i { font-size: 1rem; flex-shrink: 0; width: 18px; text-align: center; }
.nav-link-item:hover {
    background: var(--sidebar-hover-bg);
    color: #fff;
}
.nav-link-item.active {
    background: var(--sidebar-active-bg);
    color: var(--primary-light);
    border-left-color: var(--primary);
    font-weight: 600;
}

/* Group toggle button */
.nav-group { margin-bottom: 2px; }

.nav-group-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    background: none;
    border: none;
    border-left: 3px solid transparent;
    color: var(--sidebar-text);
    font-size: 0.825rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: background var(--transition), color var(--transition);
}
.nav-group-toggle:hover { background: var(--sidebar-hover-bg); color: #fff; }
.nav-group-toggle:not(.collapsed) { color: #fff; background: var(--sidebar-hover-bg); }

.nav-group-icon { font-size: 1rem; width: 18px; text-align: center; flex-shrink: 0; }

.nav-group-arrow {
    margin-left: auto;
    font-size: 0.65rem;
    transition: transform var(--transition);
    flex-shrink: 0;
}
.nav-group-toggle:not(.collapsed) .nav-group-arrow { transform: rotate(180deg); }

/* Sub-items */
.nav-group-items {
    background: rgba(0,0,0,0.15);
    padding: 2px 0;
}

.nav-sub-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px 7px 44px;
    color: var(--sidebar-text-muted);
    font-size: 0.8rem;
    font-weight: 400;
    border-left: 3px solid transparent;
    transition: background var(--transition), color var(--transition);
}
.nav-sub-item i { font-size: 0.85rem; flex-shrink: 0; }
.nav-sub-item:hover { background: var(--sidebar-hover-bg); color: var(--sidebar-text); }
.nav-sub-item.active {
    color: var(--primary-light);
    background: var(--sidebar-active-bg);
    border-left-color: var(--primary);
    font-weight: 600;
}

/* ─── SIDEBAR FOOTER ────────────────────────────────────────────────────── */
.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.sidebar-logout-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    color: var(--sidebar-text-muted);
    font-size: 0.825rem;
    font-weight: 500;
    border-radius: var(--radius-xs);
    transition: background var(--transition), color var(--transition);
    width: 100%;
}
.sidebar-logout-btn i { font-size: 1rem; }
.sidebar-logout-btn:hover { background: rgba(230,57,70,0.15); color: var(--primary-light); }

/* ─── TOPBAR ─────────────────────────────────────────────────────────────── */
.admin-topbar {
    height: var(--topbar-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.topbar-menu-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: var(--radius-xs);
    line-height: 1;
    display: flex;
    align-items: center;
    transition: background var(--transition), color var(--transition);
}
.topbar-menu-btn:hover { background: var(--surface-2); color: var(--text-primary); }

.breadcrumb {
    font-size: 0.8rem;
    margin: 0;
}
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-hint); }
.breadcrumb-item a { color: var(--text-secondary); }
.breadcrumb-item a:hover { color: var(--primary); }
.breadcrumb-item.active { color: var(--text-hint); }

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.topbar-page-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.topbar-user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 5px 12px 5px 5px;
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: background var(--transition);
}
.topbar-user-btn:hover { background: var(--border); }

.topbar-avatar {
    width: 28px;
    height: 28px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* ─── PAGE CONTENT ──────────────────────────────────────────────────────── */
.admin-content {
    flex: 1;
    padding: 24px 20px;
}

@media (max-width: 575.98px) {
    .admin-content { padding: 16px 12px; }
}

/* ─── FOOTER ─────────────────────────────────────────────────────────────── */
.admin-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 12px 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ─── MOBILE BOTTOM NAV ─────────────────────────────────────────────────── */
.admin-bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--bottom-nav-height);
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: stretch;
    z-index: 1030;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-hint);
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 6px 4px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: color var(--transition);
    text-decoration: none;
}
.bottom-nav-item i { font-size: 1.3rem; }
.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-item:hover { color: var(--primary); }

/* ─── CARDS & PANELS ─────────────────────────────────────────────────────── */
.admin-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

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

.admin-card-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.admin-card-title i { color: var(--primary); }

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

/* Bootstrap card override for consistency */
.card {
    border-radius: var(--radius) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow) !important;
    margin-bottom: 20px;
}

.card-header {
    border-radius: var(--radius) var(--radius) 0 0 !important;
    font-weight: 600;
    font-size: 0.9rem;
}

/* ─── STAT / KPI BOXES (replaces AdminLTE small-box) ────────────────────── */
.stat-box {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    transition: box-shadow var(--transition);
}
.stat-box:hover { box-shadow: var(--shadow-lg); }

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.stat-icon.primary { background: var(--primary-muted); color: var(--primary); }
.stat-icon.success { background: rgba(25,135,84,0.1); color: #198754; }
.stat-icon.warning { background: rgba(255,193,7,0.1); color: #ffc107; }
.stat-icon.info { background: rgba(13,202,240,0.1); color: #0dcaf0; }

.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}
.stat-label {
    font-size: 0.78rem;
    color: var(--text-hint);
    font-weight: 500;
    margin-top: 2px;
}

/* Legacy AdminLTE small-box — keep working */
.small-box {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    background: var(--surface);
    overflow: hidden;
}
.small-box > .inner { padding: 14px 16px; }
.small-box h3 { font-size: 2rem; font-weight: 800; margin: 0 0 4px; }
.small-box p { font-size: 0.85rem; margin: 0; }
.small-box .icon { position: absolute; top: -8px; right: 10px; font-size: 72px; color: rgba(0,0,0,0.12); }
.small-box > .small-box-footer {
    padding: 6px;
    text-align: center;
    background: rgba(0,0,0,0.07);
    display: block;
    font-size: 0.8rem;
}

/* ─── TABLES ─────────────────────────────────────────────────────────────── */
.table {
    font-size: 0.85rem;
}

.table th {
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border) !important;
    white-space: nowrap;
    padding: 10px 12px;
    background: var(--surface-2);
}

.table td {
    padding: 10px 12px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border) !important;
    color: var(--text-primary);
}

.table-hover tbody tr:hover { background: rgba(230,57,70,0.04) !important; }

.table-responsive { border-radius: var(--radius-sm); }

/* DataTables */
.dataTables_wrapper .dataTables_filter input {
    border-radius: var(--radius-sm) !important;
    border: 1.5px solid var(--border) !important;
    padding: 6px 12px !important;
    font-size: 0.85rem;
}
.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--primary) !important;
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-muted);
}
.dataTables_wrapper .dataTables_length select {
    border-radius: var(--radius-sm) !important;
    border: 1.5px solid var(--border) !important;
    padding: 4px 8px;
}
.dataTables_paginate .paginate_button {
    border-radius: var(--radius-xs) !important;
    font-size: 0.8rem !important;
}
.dataTables_paginate .paginate_button.current {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: white !important;
}
.dataTables_paginate .paginate_button:hover {
    background: var(--primary-muted) !important;
    border-color: var(--primary) !important;
    color: var(--primary) !important;
}

/* ─── BUTTONS ─────────────────────────────────────────────────────────────── */
.btn {
    font-weight: 600;
    font-size: 0.825rem;
    border-radius: var(--radius-xs);
    padding: 7px 16px;
    transition: all 0.15s;
}
.btn-sm { padding: 4px 10px; font-size: 0.775rem; }
.btn-lg { padding: 10px 24px; font-size: 0.95rem; }

.btn-primary {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: white !important;
}
.btn-primary:hover { background: var(--primary-dark) !important; border-color: var(--primary-dark) !important; }

.btn-outline-primary {
    color: var(--primary) !important;
    border-color: var(--primary) !important;
}
.btn-outline-primary:hover { background: var(--primary) !important; color: white !important; }

/* ─── FORMS ──────────────────────────────────────────────────────────────── */
.form-control, .form-select {
    border-radius: var(--radius-xs) !important;
    border: 1.5px solid var(--border) !important;
    font-size: 0.875rem;
    padding: 8px 12px;
    color: var(--text-primary);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--primary-muted) !important;
    outline: none;
}

.form-label {
    font-weight: 600;
    font-size: 0.825rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.input-group-text {
    border-radius: var(--radius-xs) !important;
    border: 1.5px solid var(--border) !important;
    background: var(--surface-2);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ─── BADGES ─────────────────────────────────────────────────────────────── */
.badge {
    font-weight: 600;
    font-size: 0.72rem;
    border-radius: 6px;
    padding: 3px 8px;
}

/* ─── ALERTS ─────────────────────────────────────────────────────────────── */
.alert { border-radius: var(--radius-sm); border: none; font-size: 0.875rem; }
.alert-danger { background: rgba(230,57,70,0.1); color: var(--primary-dark); }
.alert-success { background: rgba(25,135,84,0.1); color: #0f5132; }
.alert-info { background: rgba(13,202,240,0.1); color: #055160; }
.alert-warning { background: rgba(255,193,7,0.12); color: #664d03; }

/* ─── MODAL ──────────────────────────────────────────────────────────────── */
.modal-content {
    border-radius: var(--radius) !important;
    border: none !important;
    box-shadow: var(--shadow-lg) !important;
}
.modal-header {
    border-radius: var(--radius) var(--radius) 0 0 !important;
    border-bottom: 1px solid var(--border) !important;
    padding: 16px 20px;
}
.modal-footer {
    border-top: 1px solid var(--border) !important;
    padding: 12px 20px;
}

/* ─── DROPDOWN ───────────────────────────────────────────────────────────── */
.dropdown-menu {
    border-radius: var(--radius-sm) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow-lg) !important;
    font-size: 0.85rem;
    padding: 6px;
    max-height: 340px;
    overflow-y: auto;
}
.dropdown-item {
    border-radius: var(--radius-xs);
    padding: 7px 12px;
    font-weight: 500;
}
.dropdown-item:hover { background: var(--surface-2); color: var(--primary); }
.dropdown-item.active, .dropdown-item:active { background: var(--primary); color: white; }
.dropdown-divider { border-color: var(--border); margin: 4px 0; }

/* ─── PHOTO GRID ─────────────────────────────────────────────────────────── */
#photoPreviewContainer {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
}

.photo-item {
    position: relative;
    text-align: center;
    border: 1.5px solid var(--border);
    padding: 10px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
}
.photo-item img { display: block; max-width: 100px; height: auto; border-radius: var(--radius-xs); }

.photo-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 6px;
    gap: 4px;
}

/* ─── CONFIRMATION DIALOG ─────────────────────────────────────────────────── */
.confirmation-dialog {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: var(--surface);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    width: 320px;
    max-width: 90vw;
}
.confirmation-dialog p { margin-bottom: 16px; font-size: 0.9rem; }

.confirmation-buttons { text-align: right; margin-top: 16px; display: flex; gap: 8px; justify-content: flex-end; }
.confirm-yes { background: var(--primary); color: white; border: none; border-radius: var(--radius-xs); padding: 7px 18px; font-weight: 600; cursor: pointer; }
.confirm-yes:hover { background: var(--primary-dark); }
.confirm-no { background: var(--surface-2); color: var(--text-secondary); border: 1px solid var(--border); border-radius: var(--radius-xs); padding: 7px 18px; font-weight: 600; cursor: pointer; }
.confirm-no:hover { background: var(--border); }

.dialog-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1999;
    backdrop-filter: blur(2px);
}

/* ─── STICKY PRODUCT PANEL ────────────────────────────────────────────────── */
#selectedProduct2 {
    position: fixed;
    top: 0; right: 0;
    z-index: 1050;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 3px solid var(--primary);
    opacity: 0.97;
    padding: 10px 16px;
    box-shadow: var(--shadow-lg);
    border-radius: 0 0 var(--radius) var(--radius);
    margin: 0 auto;
    width: 70%;
    max-width: 960px;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}
#selectedProduct2.visible { transform: translateY(0); }

/* ─── IMAGE HOVER ZOOM ────────────────────────────────────────────────────── */
.hover-enlarge {
    transition: transform 0.25s ease;
    cursor: zoom-in;
}
.hover-enlarge:hover {
    transform: scale(1.8);
    z-index: 200;
    position: relative;
    box-shadow: var(--shadow-lg);
}

#imagePreviewModal .modal-dialog { max-width: 90%; }

/* ─── CATEGORY SELECT ─────────────────────────────────────────────────────── */
select.category-select optgroup { font-weight: 700; color: var(--text-primary); }
select.category-select option { padding-left: 16px; color: var(--text-secondary); }

/* ─── SEARCH INPUT ────────────────────────────────────────────────────────── */
#productSearch { transition: border-color 0.15s, box-shadow 0.15s; }
#productSearch:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--primary-muted) !important;
}

/* ─── BOX (AdminLTE legacy) ──────────────────────────────────────────────── */
.box {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.box.box-primary { border-top: 3px solid var(--primary); }
.box.box-success { border-top: 3px solid #198754; }
.box.box-info { border-top: 3px solid #0dcaf0; }
.box.box-warning { border-top: 3px solid #ffc107; }
.box.box-danger { border-top: 3px solid #dc3545; }

.box-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.box-title { font-size: 0.9rem; font-weight: 700; }
.box-body { padding: 16px; }
.box-footer { padding: 10px 16px; border-top: 1px solid var(--border); background: var(--surface-2); }

/* ─── UTILITY ─────────────────────────────────────────────────────────────── */
.text-primary-red { color: var(--primary) !important; }
.bg-primary-red { background: var(--primary) !important; }
.border-primary-red { border-color: var(--primary) !important; }

/* Mobile responsive buttons */
@media (max-width: 575.98px) {
    .dugmici1, .dugmici2 { float: none !important; justify-content: center; }
    .justMoj { justify-content: center; }
    .btn { width: 100%; margin-bottom: 4px; }
    .btn-group .btn { width: auto; margin-bottom: 0; }
}

@media (min-width: 576px) {
    .dugmici1, .dugmici2 { float: right !important; }
}

/* ─── PAGE HEADER ─────────────────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.page-header-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.page-header-title i { color: var(--primary); }
.page-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ─── LOGIN PAGE ─────────────────────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--sidebar-bg) 0%, #16213e 60%, #0f3460 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}
.login-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    padding: 40px 36px;
    width: 100%;
    max-width: 400px;
}
@media (max-width: 575.98px) {
    .login-card { padding: 28px 20px; }
}
.login-logo {
    text-align: center;
    margin-bottom: 28px;
}
.login-logo .brand-logo {
    width: 52px; height: 52px;
    font-size: 1.4rem;
    margin: 0 auto 10px;
}
.login-logo h1 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}
.login-logo p { color: var(--text-hint); font-size: 0.85rem; margin: 4px 0 0; }

/* ─── TOAST NOTIFICATIONS ────────────────────────────────────────────────── */
.admin-toast-container {
    position: fixed;
    bottom: 80px; left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}
@media (min-width: 992px) { .admin-toast-container { bottom: 20px; } }

.admin-toast {
    background: var(--text-primary);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.25s, transform 0.25s;
    pointer-events: auto;
    white-space: nowrap;
    max-width: 90vw;
}
.admin-toast.show { opacity: 1; transform: translateY(0); }
.admin-toast.success { background: #198754; }
.admin-toast.error { background: var(--primary); }

/* ─── MOBILE TABLE OPTIMIZATIONS ─────────────────────────────────────────── */
@media (max-width: 767.98px) {
    .table-responsive-stack tr { display: block; border-bottom: 2px solid var(--border); }
    .table-responsive-stack td { display: flex; justify-content: space-between; padding: 6px 12px; }
    .table-responsive-stack td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-secondary);
        flex-shrink: 0;
        margin-right: 12px;
    }
    .table-responsive-stack th { display: none; }
}

/* ─── PAGINATION ─────────────────────────────────────────────────────────── */
.pagination .page-link {
    border-radius: var(--radius-xs) !important;
    margin: 0 2px;
    border: 1.5px solid var(--border) !important;
    color: var(--text-primary);
    font-size: 0.825rem;
}
.pagination .page-item.active .page-link {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: white !important;
}
.pagination .page-link:hover { color: var(--primary); border-color: var(--primary) !important; }
