/* ============================================================
   SSEB Stock Control — Standalone Enterprise Theme
   Based on Original Plugin Design System
   ============================================================ */

:root {
    /* Brand palette */
    --primary:          #1a237e;
    --primary-light:    #283593;
    --primary-dark:     #0d1257;
    --accent:           #2196f3;
    --accent-light:     #e3f2fd;

    /* Semantic colours */
    --success:          #43a047;
    --warning:          #fb8c00;
    --danger:           #e53935;
    --info:             #00bcd4;

    /* Text */
    --text-dark:        #1a1a2e;
    --text-mid:         #4a4a6a;
    --text-light:       #8888aa;

    /* Surfaces */
    --bg-page:          #f4f6fb;
    --bg-card:          #ffffff;
    --border:           #e0e4ef;

/* Layout */
    --sidebar-w:        240px;
    --sidebar-w-collapsed: 64px;
    --topbar-h:         60px;
    --radius:           10px;
    --radius-sm:        6px;
    --radius-lg:        14px;

    /* Shadows */
    --shadow-sm:        0 1px 4px rgba(26,35,126,0.07), 0 2px 8px rgba(26,35,126,0.05);
    --shadow-md:        0 4px 16px rgba(26,35,126,0.11), 0 1px 4px rgba(26,35,126,0.07);
    --shadow-focus:     0 0 0 3px rgba(33,150,243,0.22);

    /* Typography */
    --font-body:        'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-mono:        'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

    /* Transitions */
    --ease:             cubic-bezier(0.22, 0.68, 0, 1.2);
    --t-fast:           0.14s ease;
    --t-med:            0.22s ease;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-page);
    color: var(--text-dark);
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

/* ── LAYOUT ───────────────────────────────────────────────────── */
.wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-bar {
    height: var(--topbar-h);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: var(--shadow-sm);
}

.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.content-area {
    flex: 1;
    overflow-y: auto;
    height: calc(100vh - var(--topbar-h));
    position: relative;
    z-index: 1;
}

/* ── SIDEBAR ───────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    background: linear-gradient(160deg, var(--primary-dark) 0%, var(--primary) 55%, var(--primary-light) 100%);
    box-shadow: 3px 0 20px rgba(13,18,87,0.22);
    transition: width var(--t-med), min-width var(--t-med);
    z-index: 1020;
    position: relative;
}

.sidebar.collapsed,
.sidebar-collapsed .sidebar {
    width: var(--sidebar-w-collapsed);
    min-width: var(--sidebar-w-collapsed);
}

.sidebar.collapsed .nav-link span,
.sidebar-collapsed .sidebar .nav-link span,
.sidebar.collapsed .nav-label,
.sidebar-collapsed .sidebar .nav-label,
.sidebar.collapsed .bi-chevron-down,
.sidebar-collapsed .sidebar .bi-chevron-down {
    display: none;
}

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

.sidebar.collapsed .sidebar-content,
.sidebar-collapsed .sidebar .sidebar-content {
    overflow: hidden;
}

.sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.025'%3E%3Cpath d='M0 40L40 0H20L0 20M40 40V20L20 40'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.sidebar .nav-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.6px;
    color: rgba(255,255,255,0.38);
    text-transform: uppercase;
    padding: 14px 18px 5px;
    display: block;
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.72);
    padding: 9px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background var(--t-fast), color var(--t-fast);
    border-left: 3px solid transparent;
    white-space: nowrap;
    overflow: hidden;
}

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

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

.sidebar .nav-link.active {
    background: rgba(255,255,255,0.14);
    color: #fff;
    font-weight: 600;
    border-left-color: #90caf9;
}

/* ── COMPONENTS ────────────────────────────────────────────────── */

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--t-med);
}
.card:hover {
    box-shadow: var(--shadow-md);
}

/* Tables */
.table-responsive {
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.table {
    font-size: 13px;
}

.table thead th {
    background-color: var(--primary) !important;
    color: rgba(255,255,255,0.9) !important;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    border: none;
}

.table tbody tr:hover {
    background-color: #f5f7ff !important;
}

/* Forms */
.form-control, .form-select {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: var(--shadow-focus) !important;
    outline: none;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}
.btn-primary:hover {
    background-color: var(--primary-light);
}

/* Toast Container */
#sseb-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ── PRINT STYLES ──────────────────────────────────────────────── */
@media print {
    .sidebar, .top-bar, .btn, .no-print, .nav-link {
        display: none !important;
    }
    .main-container {
        display: block !important;
    }
    .content-area {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        overflow: visible !important;
        height: auto !important;
        position: static !important;
    }
    .table-responsive {
        overflow: visible !important;
    }
    table {
        page-break-inside: auto !important;
    }
    tr {
        page-break-inside: avoid !important;
        page-break-after: auto !important;
    }
    body { background: white; }
}
