/* ═══════════════════════════════════════════════════════════
   RESTAUNET — Base Styles (Navbar, Messages, Footer)
   ═══════════════════════════════════════════════════════════ */

:root {
    --primary:       #FF6B35;
    --primary-dark:  #E85A22;
    --primary-light: #FF8C5A;
    --secondary:     #1A1D2E;
    --secondary-alt: #242741;
    --accent:        #FFB347;
    --blue:          #3B82F6;
    --green:         #10B981;
    --red:           #EF4444;
    --yellow:        #F59E0B;

    --text-primary:   #0F172A;
    --text-secondary: #475569;
    --text-muted:     #94A3B8;
    --border:         #E2E8F0;
    --bg:             #FFFFFF;
    --bg-soft:        #F8FAFC;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.10);

    --radius-sm:   8px;
    --radius-md:   12px;
    --radius-lg:   16px;
    --radius-full: 9999px;

    --navbar-h: 64px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition: 0.2s ease;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: var(--font);
    color: var(--text-primary);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}
a    { text-decoration: none; color: inherit; }
ul   { list-style: none; }
img  { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }

/* ── Utility ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* ═══════════════════════════════════════════════════════════
   APP NAVBAR
   ═══════════════════════════════════════════════════════════ */
.app-navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--navbar-h);
    background: var(--secondary);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    z-index: 1000;
    display: flex;
    align-items: center;
}

.app-navbar .nav-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 24px;
    height: 100%;
}

/* Logo */
.app-navbar .nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.app-navbar .nav-logo .logo-icon { width: 32px; height: 32px; flex-shrink: 0; }
.app-navbar .nav-logo .logo-icon svg { width: 100%; height: 100%; }
.app-navbar .nav-logo .logo-text {
    font-size: 1.1rem;
    font-weight: 800;
    color: white;
    letter-spacing: -0.5px;
}

/* Center nav links */
.app-navbar .nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
}
.app-navbar .nav-link {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255,255,255,0.6);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.app-navbar .nav-link svg { width: 16px; height: 16px; flex-shrink: 0; }
.app-navbar .nav-link:hover  { color: white; background: rgba(255,255,255,0.07); }
.app-navbar .nav-link.active { color: white; background: rgba(255,255,255,0.10); }

/* Right section */
.app-navbar .nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-shrink: 0;
}

/* Unauthenticated buttons */
.app-navbar .btn-nav-ghost {
    padding: 7px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255,255,255,0.7);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.app-navbar .btn-nav-ghost:hover { color: white; background: rgba(255,255,255,0.07); }

.app-navbar .btn-nav-primary {
    padding: 8px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    background: var(--primary);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    box-shadow: 0 2px 8px rgba(255,107,53,0.25);
}
.app-navbar .btn-nav-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255,107,53,0.35);
}

/* User menu (authenticated) */
.user-menu {
    position: relative;
}
.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 10px 5px 5px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition);
    border: 1px solid transparent;
}
.user-menu-trigger:hover { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.08); }
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    color: white;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}
.user-menu-info { text-align: left; }
.user-name {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: white;
    line-height: 1.2;
}
.user-role {
    display: block;
    font-size: 0.68rem;
    color: rgba(255,255,255,0.45);
    line-height: 1.2;
}
.user-chevron {
    width: 14px;
    height: 14px;
    color: rgba(255,255,255,0.4);
    transition: transform var(--transition);
    flex-shrink: 0;
}
.user-menu:hover .user-chevron { transform: rotate(180deg); }

/* Dropdown */
.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
    z-index: 100;
}
.user-menu:hover .user-dropdown,
.user-menu:focus-within .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.dropdown-header {
    padding: 10px 12px 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
}
.dropdown-header strong { display: block; font-size: 0.85rem; color: var(--text-primary); }
.dropdown-header span  { font-size: 0.75rem; color: var(--text-muted); }
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    font-size: 0.84rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    font-weight: 500;
}
.dropdown-item svg { width: 15px; height: 15px; flex-shrink: 0; }
.dropdown-item:hover { background: var(--bg-soft); color: var(--text-primary); }
.dropdown-item.danger { color: var(--red); }
.dropdown-item.danger:hover { background: #FEF2F2; }
.dropdown-divider { height: 1px; background: var(--border); margin: 6px 0; }

/* Mobile toggle */
.nav-toggle-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 6px;
    margin-left: auto;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}
.nav-toggle-btn:hover { background: rgba(255,255,255,0.07); }
.nav-toggle-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: rgba(255,255,255,0.8);
    border-radius: 2px;
    transition: all 0.3s ease;
}
.nav-toggle-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle-btn.open span:nth-child(2) { opacity: 0; }
.nav-toggle-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu */
.mobile-menu {
    display: none;
    position: fixed;
    top: var(--navbar-h);
    left: 0; right: 0;
    background: var(--secondary);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 16px;
    z-index: 999;
    flex-direction: column;
    gap: 4px;
}
.mobile-menu.open { display: flex; }
.mobile-menu .nav-link {
    padding: 11px 14px;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.7);
}
.mobile-menu .nav-link:hover { background: rgba(255,255,255,0.07); color: white; }
.mobile-menu-divider { height: 1px; background: rgba(255,255,255,0.08); margin: 8px 0; }
.mobile-menu .btn-nav-primary {
    display: block;
    text-align: center;
    padding: 12px;
    margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════
   FLASH MESSAGES (global)
   ═══════════════════════════════════════════════════════════ */
.flash-container {
    position: fixed;
    top: calc(var(--navbar-h) + 12px);
    right: 16px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 380px;
    width: calc(100% - 32px);
}

.flash {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    animation: flashIn 0.35s cubic-bezier(0.34,1.56,0.64,1) forwards;
    border: 1px solid transparent;
}
@keyframes flashIn {
    from { opacity: 0; transform: translateX(20px) scale(0.95); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes flashOut {
    from { opacity: 1; transform: translateX(0); max-height: 100px; margin-bottom: 0; }
    to   { opacity: 0; transform: translateX(20px); max-height: 0; margin-bottom: -8px; }
}
.flash.dismissing { animation: flashOut 0.3s ease forwards; }

.flash-content { display: flex; align-items: flex-start; gap: 10px; flex: 1; }
.flash-icon { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }

.flash-success { background: #ECFDF5; color: #065F46; border-color: #A7F3D0; }
.flash-error   { background: #FEF2F2; color: #991B1B; border-color: #FECACA; }
.flash-warning { background: #FFFBEB; color: #92400E; border-color: #FDE68A; }
.flash-info    { background: #EFF6FF; color: #1E40AF; border-color: #BFDBFE; }

.flash-close {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
    color: currentColor;
    opacity: 0.5;
    flex-shrink: 0;
    transition: opacity var(--transition);
}
.flash-close:hover { opacity: 1; }

/* ═══════════════════════════════════════════════════════════
   MAIN CONTENT PADDING
   ═══════════════════════════════════════════════════════════ */
.page-body { padding-top: var(--navbar-h); }

/* ═══════════════════════════════════════════════════════════
   DEFAULT APP FOOTER
   ═══════════════════════════════════════════════════════════ */
.app-footer {
    background: var(--secondary);
    border-top: 1px solid rgba(255,255,255,0.06);
    padding: 32px 0;
}
.app-footer .footer-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}
.app-footer .footer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}
.app-footer .footer-logo .logo-icon { width: 28px; height: 28px; }
.app-footer .footer-logo .logo-text { font-size: 1rem; font-weight: 800; color: white; letter-spacing: -0.5px; }
.app-footer .footer-copy { font-size: 0.8rem; color: rgba(255,255,255,0.35); }
.app-footer .footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.app-footer .footer-links a { font-size: 0.78rem; color: rgba(255,255,255,0.35); transition: color var(--transition); }
.app-footer .footer-links a:hover { color: rgba(255,255,255,0.7); }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .app-navbar .nav-links,
    .app-navbar .nav-right { display: none; }
    .nav-toggle-btn { display: flex; }
    .flash-container { right: 12px; left: 12px; max-width: 100%; }
    .app-footer .footer-inner { flex-direction: column; text-align: center; }
}

/* ═══════════════════════════════════════════════════════════
   MOBILE BOTTOM NAVIGATION BAR
   ═══════════════════════════════════════════════════════════ */

/* Hidden on desktop, shown only on mobile */
.mbn,
.mbn-fab-menu,
.mbn-drawer,
.mbn-overlay { display: none; }

@media (max-width: 768px) {

/* ── Main bar ── */
.mbn {
    display: flex;
    align-items: center;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: calc(64px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: white;
    border-top: 1px solid rgba(0,0,0,0.07);
    box-shadow: 0 -4px 24px rgba(0,0,0,0.08);
    z-index: 900;
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}
.mbn--hidden { transform: translateY(100%); }

.mbn-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 4px;
    border: none;
    background: none;
    cursor: pointer;
    font-family: var(--font);
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}
.mbn-item:active { transform: scale(0.92); }
.mbn-item.mbn-active { color: var(--primary); }

.mbn-icon {
    position: relative;
    width: 26px; height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mbn-item.mbn-active .mbn-icon::before {
    content: '';
    position: absolute;
    inset: -6px;
    background: rgba(255,107,53,0.1);
    border-radius: 12px;
}

/* Notification badge */
.mbn-badge {
    position: absolute;
    top: -5px; right: -8px;
    background: var(--primary);
    color: white;
    font-size: 0.58rem;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    line-height: 1;
}

/* ── FAB (center floating action button) ── */
.mbn-fab {
    width: 54px; height: 54px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(255,107,53,0.45);
    flex-shrink: 0;
    margin: 0 4px;
    margin-bottom: 10px;
    transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    z-index: 901;
}
.mbn-fab:active { transform: scale(0.9); }
.mbn-fab--open {
    transform: rotate(45deg);
    box-shadow: 0 6px 28px rgba(255,107,53,0.55);
}

/* ── FAB mini-menu ── */
.mbn-fab-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: fixed;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    z-index: 898;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.mbn-fab-menu--open {
    display: flex;
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}
.mbn-fab-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px 10px 10px;
    background: white;
    border-radius: 40px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: var(--font);
    white-space: nowrap;
    animation: fabItemIn 0.25s calc(var(--i) * 0.06s) both cubic-bezier(0.34,1.56,0.64,1);
    -webkit-tap-highlight-color: transparent;
}
.mbn-fab-item:active { transform: scale(0.95); }
@keyframes fabItemIn {
    from { opacity: 0; transform: translateY(12px) scale(0.9); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.mbn-fab-item-icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ── More drawer (bottom sheet) ── */
.mbn-drawer {
    display: block;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.15);
    z-index: 950;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    max-height: 85vh;
    overflow-y: auto;
}
.mbn-drawer--open { transform: translateY(0); }

.mbn-drawer-handle {
    width: 36px; height: 4px;
    background: #D1D5DB;
    border-radius: 4px;
    margin: 12px auto 8px;
    cursor: grab;
}

.mbn-drawer-header {
    padding: 8px 20px 16px;
    border-bottom: 1px solid var(--border);
}
.mbn-drawer-user { display: flex; align-items: center; gap: 12px; }
.mbn-drawer-avatar {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 800;
    color: white;
    flex-shrink: 0;
}
.mbn-drawer-header strong { display: block; font-size: 0.95rem; font-weight: 700; color: var(--text-primary); }
.mbn-drawer-header span  { font-size: 0.78rem; color: var(--text-muted); }

.mbn-drawer-nav { padding: 8px 12px 20px; }
.mbn-drawer-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 12px;
    border-radius: 12px;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
    font-family: var(--font);
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.mbn-drawer-item:active { background: var(--bg-soft); transform: scale(0.98); }
.mbn-di-icon {
    width: 38px; height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.mbn-di-arrow { margin-left: auto; color: var(--text-muted); flex-shrink: 0; }
.mbn-drawer-divider { height: 1px; background: var(--border); margin: 6px 0; }
.mbn-drawer-item--danger { color: var(--red); }
.mbn-drawer-item--danger:active { background: #FEF2F2; }

/* ── Overlay ── */
.mbn-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 940;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.mbn-overlay--show { opacity: 1; pointer-events: auto; }

/* Body padding so content isn't hidden behind bottom nav */
.page-body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }

} /* end @media (max-width: 768px) */
