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

/* =========================================================
   Eurasian Campus Uni Cafe Stock - global styles
   Blue theme, matches login.php and dashboard.php
   ========================================================= */
:root {
    --primary: #1d4ed8;
    --primary-hover: #1a44bd;
    --primary-dark: #1e3a8a;
    --primary-deep: #0b1f4d;
    --primary-soft: #e8efff;
    --ink: #0f1a33;
    --muted: #5b6785;
    --line: #d6def0;
    --bg: #f3f6fc;
    --focus: rgba(29, 78, 216, .18);

    /* old variable names kept so nothing else breaks */
    --navy: var(--primary-deep);
    --navy-2: var(--primary-dark);
    --blue: #9db8ff;

    /* Bootstrap 5.3 theme overrides */
    --bs-primary: #1d4ed8;
    --bs-primary-rgb: 29, 78, 216;
    --bs-link-color: #1d4ed8;
    --bs-link-color-rgb: 29, 78, 216;
    --bs-link-hover-color: #1e3a8a;
    --bs-link-hover-color-rgb: 30, 58, 138;
    --bs-body-color: #0f1a33;
    --bs-secondary-color: #5b6785;
    --bs-border-color: #d6def0;
    --bs-border-radius: .75rem;
}

body {
    font-family: 'Manrope', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

/* ---------- App shell ---------- */
.app-shell { min-height: 100vh; display: flex; }

.sidebar {
    width: 260px;
    min-height: 100vh;
    position: fixed;
    left: 0; top: 0; bottom: 0;
    padding: 22px 14px;
    z-index: 1030;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    color: #fff;
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary-deep) 100%);
}

.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px 22px; }
.brand-mark {
    width: 44px; height: 44px; flex: none;
    border-radius: 13px;
    background: #fff;
    color: var(--primary);
    display: grid; place-items: center;
    font-weight: 800;
    letter-spacing: -.02em;
}
.brand-title { font-weight: 800; line-height: 1.2; letter-spacing: -.01em; }
.brand-subtitle { font-size: 12px; color: rgba(255, 255, 255, .65); }

.sidebar .nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: .65rem;
    color: rgba(255, 255, 255, .78);
    font-weight: 600;
    font-size: .95rem;
    padding: 11px 14px;
    border-radius: 12px;
    margin-bottom: 4px;
    transition: background .15s, color .15s;
}
.sidebar .nav-link:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.sidebar .nav-link.active,
.sidebar .nav-link[aria-current="page"] {
    background: rgba(255, 255, 255, .16);
    color: #fff;
}
.sidebar .nav-link.active::before,
.sidebar .nav-link[aria-current="page"]::before {
    content: "";
    position: absolute;
    left: -14px; top: 10px; bottom: 10px;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: #fff;
}
.sidebar .nav-link:focus-visible { outline: 3px solid rgba(255, 255, 255, .55); outline-offset: 2px; }

.sidebar-bottom {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, .14);
    color: rgba(255, 255, 255, .8);
}
.sidebar-bottom .btn-outline-light {
    border-radius: 12px;
    font-weight: 700;
    border-color: rgba(255, 255, 255, .4);
}
.sidebar-bottom .btn-outline-light:hover { background: #fff; color: var(--primary-dark); }

.main-content { margin-left: 260px; width: calc(100% - 260px); min-width: 0; }

.topbar {
    height: 64px;
    position: sticky; top: 0; z-index: 1020;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center;
    padding: 0 24px;
}

.page-title { font-weight: 800; letter-spacing: -.02em; color: var(--ink); }

/* ---------- Cards, stats ---------- */
.card {
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 14px 34px -26px rgba(29, 78, 216, .55);
}
.stat-card { min-height: 120px; }
.stat-value {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}
.stat-label { color: var(--muted); font-size: 14px; font-weight: 600; }

/* ---------- Tables ---------- */
.table { --bs-table-bg: transparent; --bs-table-hover-bg: #f8faff; --bs-table-border-color: #e8edf8; }
.table th {
    white-space: nowrap;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    background: #f8faff;
    border-bottom-color: var(--line);
}
.table td { vertical-align: middle; }

/* ---------- Forms ---------- */
.form-label { font-weight: 600; font-size: .9rem; }
.form-control, .form-select {
    min-height: 46px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    background-color: #f8faff;
    transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.form-control:hover, .form-select:hover { border-color: #b9c6e6; }
.form-control:focus, .form-select:focus {
    background-color: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--focus);
}
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.form-check-input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--focus); }

/* ---------- Buttons ---------- */
.btn { border-radius: 12px; font-weight: 700; }
.btn:focus-visible { box-shadow: 0 0 0 4px var(--focus); }

.btn-primary {
    --bs-btn-bg: #1d4ed8;
    --bs-btn-border-color: #1d4ed8;
    --bs-btn-hover-bg: #1a44bd;
    --bs-btn-hover-border-color: #1a44bd;
    --bs-btn-active-bg: #1e3a8a;
    --bs-btn-active-border-color: #1e3a8a;
    --bs-btn-disabled-bg: #1d4ed8;
    --bs-btn-disabled-border-color: #1d4ed8;
    --bs-btn-focus-shadow-rgb: 29, 78, 216;
    box-shadow: 0 10px 22px -12px rgba(29, 78, 216, .8);
}
.btn-outline-primary {
    --bs-btn-color: #1d4ed8;
    --bs-btn-border-color: #1d4ed8;
    --bs-btn-hover-bg: #e8efff;
    --bs-btn-hover-color: #1e3a8a;
    --bs-btn-hover-border-color: #1d4ed8;
    --bs-btn-active-bg: #1d4ed8;
    --bs-btn-active-color: #fff;
    --bs-btn-active-border-color: #1d4ed8;
    --bs-btn-focus-shadow-rgb: 29, 78, 216;
    background: #fff;
}

/* ---------- Alerts, badges, pagination, modals ---------- */
.alert { border-radius: 12px; border-width: 1px; font-size: .94rem; }
.badge { font-weight: 800; letter-spacing: .02em; }
.page-link { color: var(--primary); border-color: var(--line); }
.page-link:hover { background: var(--primary-soft); color: var(--primary-dark); }
.page-item.active .page-link { background: var(--primary); border-color: var(--primary); }
.modal-content { border: 0; border-radius: 18px; }
.dropdown-menu { border-color: var(--line); border-radius: 12px; }

/* ---------- Brand mark (also used on the login page) ---------- */
.sidebar-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(11, 31, 77, .5);
    z-index: 1025;
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .sidebar {
        width: 280px;
        max-width: 85vw;
        transform: translateX(-100%);
        transition: transform .2s ease;
        box-shadow: none;
    }
    .sidebar.show { transform: translateX(0); box-shadow: 0 0 40px rgba(11, 31, 77, .35); }
    .sidebar-backdrop.show { display: block; }
    .main-content { margin-left: 0; width: 100%; }
    .topbar { padding: 0 16px; }
}

@media (max-width: 575.98px) {
    .main-content .container-fluid,
    .main-content main { padding-left: 14px; padding-right: 14px; }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar { transition: none; }
    .form-control, .form-select, .nav-link { transition: none; }
}