/* ═══════════════════════════════════════════════════════════════════
   CargoXy Client Portal — Stylesheet
   Themes: theme-blue (default) | theme-green | theme-dark
   ═══════════════════════════════════════════════════════════════════ */

/* ── CSS Variables — Blue (default) ────────────────────────────── */
:root,
body.theme-blue {
    --primary:        #2563eb;
    --primary-dark:   #1d4ed8;
    --primary-light:  #dbeafe;
    --navy:           #1a2b4a;
    --accent:         #f59e0b;
    --accent-dark:    #d97706;
    --teal:           #0d9488;
    --green:          #16a34a;
    --amber:          #d97706;
    --red:            #dc2626;
    --sidebar-bg:     #1a2b4a;
    --sidebar-text:   #cbd5e1;
    --sidebar-active: #2563eb;
    --sidebar-hover:  rgba(255,255,255,.07);
    --navbar-bg:      #1a2b4a;
    --navbar-text:    #f1f5f9;
    --card-bg:        #ffffff;
    --card-border:    #e2e8f0;
    --card-shadow:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --card-shadow-hover: 0 4px 12px rgba(0,0,0,.12);
    --page-bg:        #f1f5f9;
    --text-primary:   #1e293b;
    --text-secondary: #64748b;
    --text-muted:     #94a3b8;
    --border:         #e2e8f0;
    --input-border:   #cbd5e1;
    --input-focus:    #2563eb;
    --radius:         8px;
    --radius-sm:      4px;
    --radius-lg:      12px;
    --font:           'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --sidebar-width:  240px;
    --navbar-height:  60px;
    --transition:     .2s ease;
}

/* ── Green Theme ─────────────────────────────────────────────────── */
body.theme-green {
    --primary:        #16a34a;
    --primary-dark:   #15803d;
    --primary-light:  #dcfce7;
    --navy:           #14532d;
    --accent:         #f59e0b;
    --sidebar-bg:     #14532d;
    --sidebar-active: #16a34a;
    --navbar-bg:      #14532d;
}

/* ── Dark Theme ──────────────────────────────────────────────────── */
body.theme-dark {
    --primary:        #3b82f6;
    --primary-dark:   #2563eb;
    --primary-light:  #1e3a5f;
    --navy:           #0f172a;
    --accent:         #f59e0b;
    --sidebar-bg:     #0f172a;
    --sidebar-text:   #94a3b8;
    --sidebar-active: #3b82f6;
    --sidebar-hover:  rgba(255,255,255,.05);
    --navbar-bg:      #0f172a;
    --navbar-text:    #e2e8f0;
    --card-bg:        #1e293b;
    --card-border:    #334155;
    --card-shadow:    0 1px 3px rgba(0,0,0,.3);
    --card-shadow-hover: 0 4px 16px rgba(0,0,0,.4);
    --page-bg:        #0f172a;
    --text-primary:   #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted:     #64748b;
    --border:         #334155;
    --input-border:   #475569;
    --input-focus:    #3b82f6;
}

/* ── Reset & Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--page-bg);
    line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Portal Layout ───────────────────────────────────────────────── */
.portal-layout {
    display: flex;
    min-height: calc(100vh - var(--navbar-height));
    padding-top: var(--navbar-height);
}

/* ── Navbar ──────────────────────────────────────────────────────── */
.portal-navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--navbar-height);
    background: var(--navbar-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

.navbar-left, .navbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-toggle {
    background: transparent;
    border: none;
    color: var(--navbar-text);
    font-size: 18px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}
.sidebar-toggle:hover { background: rgba(255,255,255,.1); }

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--navbar-text) !important;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 16px;
}
.navbar-logo-icon { color: var(--accent); font-size: 20px; }
.navbar-title { letter-spacing: -.3px; }

.theme-switcher { display: flex; gap: 4px; }
.theme-btn {
    background: transparent;
    border: 2px solid transparent;
    border-radius: 50%;
    width: 22px; height: 22px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    padding: 2px;
    transition: border-color var(--transition);
}
.theme-btn.active { border-color: rgba(255,255,255,.6); }
.theme-dot { width: 14px; height: 14px; border-radius: 50%; display: block; }

.navbar-customer {
    display: flex; align-items: center; gap: 8px;
    color: var(--navbar-text);
}
.customer-avatar {
    width: 30px; height: 30px;
    background: rgba(255,255,255,.15);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
}
.customer-name { font-size: 13px; font-weight: 500; }

.navbar-logout {
    display: flex; align-items: center; gap: 6px;
    color: rgba(255,255,255,.7) !important;
    font-size: 13px;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    transition: background var(--transition), color var(--transition);
    text-decoration: none !important;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: var(--font);
}
.navbar-logout:hover { background: rgba(255,255,255,.1); color: #fff !important; }

/* ── Sidebar ─────────────────────────────────────────────────────── */
.portal-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - var(--navbar-height));
    position: sticky;
    top: var(--navbar-height);
    height: calc(100vh - var(--navbar-height));
    overflow-y: auto;
    transition: transform var(--transition);
}

.sidebar-header {
    padding: 20px 16px 16px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-customer-info { display: flex; align-items: center; gap: 10px; }
.sidebar-avatar {
    width: 38px; height: 38px;
    background: rgba(255,255,255,.12);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,.8);
    font-size: 16px;
    flex-shrink: 0;
}
.sidebar-customer-name {
    font-size: 13px; font-weight: 600;
    color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-customer-label { font-size: 11px; color: var(--sidebar-text); margin-top: 1px; }

.sidebar-nav { padding: 12px 8px; flex: 1; }
.nav-section-label {
    font-size: 10px; font-weight: 600; letter-spacing: .8px;
    text-transform: uppercase;
    color: var(--sidebar-text);
    padding: 8px 8px 4px;
    opacity: .6;
}

.sidebar-link {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text) !important;
    text-decoration: none !important;
    font-size: 13px; font-weight: 500;
    transition: background var(--transition), color var(--transition);
    position: relative;
    margin-bottom: 2px;
}
.sidebar-link:hover { background: var(--sidebar-hover); color: #fff !important; }
.sidebar-link.active {
    background: var(--sidebar-active);
    color: #fff !important;
}
.sidebar-icon { width: 18px; text-align: center; flex-shrink: 0; opacity: .85; }
.sidebar-badge {
    margin-left: auto;
    background: var(--accent);
    color: #000;
    font-size: 10px; font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 18px; text-align: center;
    display: none;
}
.sidebar-badge:not(:empty) { display: inline-block; }

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-logout {
    display: flex; align-items: center; gap: 8px;
    color: rgba(255,255,255,.5) !important;
    font-size: 12px;
    padding: 6px 4px;
    text-decoration: none !important;
    transition: color var(--transition);
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: var(--font);
}
.sidebar-logout:hover { color: rgba(255,255,255,.85) !important; }
.sidebar-version { font-size: 10px; color: rgba(255,255,255,.2); margin-top: 8px; }

.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 999;
}

/* ── Main Content ─────────────────────────────────────────────────── */
.portal-content {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
}

.page-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 24px;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.page-title {
    font-size: 22px; font-weight: 700;
    color: var(--text-primary);
    display: flex; align-items: center; gap: 10px;
    margin: 0;
}
.page-title-icon { color: var(--primary); font-size: 20px; }
.page-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.page-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.section-label {
    font-size: 11px; font-weight: 600; letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 12px;
    margin-top: 28px;
}

/* ── Summary Tiles ────────────────────────────────────────────────── */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.summary-tile {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 20px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--card-border);
    transition: box-shadow var(--transition), transform var(--transition);
}
.summary-tile:hover { box-shadow: var(--card-shadow-hover); transform: translateY(-2px); }

.tile-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.tile-value { font-size: 26px; font-weight: 700; line-height: 1; color: var(--text-primary); }
.tile-label { font-size: 12px; color: var(--text-secondary); margin-top: 3px; }

.tile-blue   .tile-icon { background: #dbeafe; color: #2563eb; }
.tile-amber  .tile-icon { background: #fef3c7; color: #d97706; }
.tile-teal   .tile-icon { background: #ccfbf1; color: #0d9488; }
.tile-green  .tile-icon { background: #dcfce7; color: #16a34a; }
.tile-navy   .tile-icon { background: var(--primary-light); color: var(--navy); }

/* ── Quick Actions ────────────────────────────────────────────────── */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}

.action-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 20px 18px;
    text-decoration: none !important;
    transition: box-shadow var(--transition), transform var(--transition);
    display: block;
    border-top: 3px solid var(--primary);
}
.action-card:hover { box-shadow: var(--card-shadow-hover); transform: translateY(-2px); }
.action-blue  { border-top-color: #2563eb; }
.action-teal  { border-top-color: #0d9488; }
.action-green { border-top-color: #16a34a; }
.action-navy  { border-top-color: var(--navy); }

.action-icon {
    font-size: 24px;
    margin-bottom: 10px;
}
.action-blue  .action-icon { color: #2563eb; }
.action-teal  .action-icon { color: #0d9488; }
.action-green .action-icon { color: #16a34a; }
.action-navy  .action-icon { color: var(--navy); }

.action-title { font-weight: 600; font-size: 14px; color: var(--text-primary); margin-bottom: 4px; }
.action-desc  { font-size: 12px; color: var(--text-secondary); }

/* ── Card Panel ───────────────────────────────────────────────────── */
.card-panel {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    margin-bottom: 24px;
}

.card-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--page-bg);
}
.panel-header-left { display: flex; align-items: center; gap: 8px; }
.panel-icon { color: var(--primary); font-size: 14px; }
.panel-title { font-weight: 600; font-size: 14px; color: var(--text-primary); }
.panel-link { font-size: 12px; color: var(--primary); display: flex; align-items: center; gap: 4px; }
.panel-link:hover { text-decoration: none; opacity: .8; }

/* ── Data Table ───────────────────────────────────────────────────── */
.table-responsive { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.data-table thead th {
    background: var(--page-bg);
    padding: 10px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.data-table tbody td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: rgba(var(--primary), .03); }

.table-link { color: var(--primary); font-weight: 500; }
.table-link:hover { text-decoration: underline; }

/* ── List Toolbar ─────────────────────────────────────────────────── */
.list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--card-bg);
    flex-wrap: wrap;
}
.list-search { position: relative; flex: 1; min-width: 220px; }
.list-search-icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); font-size: 13px; pointer-events: none;
}
.list-search-input {
    width: 100%;
    padding: 8px 12px 8px 34px;
    border: 1px solid var(--input-border);
    border-radius: var(--radius);
    font-size: 13px; font-family: var(--font);
    background: var(--page-bg);
    color: var(--text-primary);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.list-search-input:focus {
    outline: none;
    border-color: var(--input-focus);
    box-shadow: 0 0 0 2px var(--primary-light);
    background: var(--card-bg);
}
.list-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.list-select {
    padding: 8px 10px;
    border: 1px solid var(--input-border);
    border-radius: var(--radius);
    font-size: 13px; font-family: var(--font);
    background: var(--card-bg);
    color: var(--text-primary);
    cursor: pointer;
}
.list-select:focus { outline: none; border-color: var(--input-focus); }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--input-border);
}
.btn-ghost:hover { background: var(--page-bg); color: var(--text-primary); text-decoration: none; }
.btn-ghost:disabled { opacity: .45; cursor: default; }

/* ── Sortable headers, rows, sub-text ─────────────────────────────── */
.th-sortable { cursor: pointer; user-select: none; }
.th-sortable:hover { color: var(--text-primary); }
.th-sort-icon { font-size: 10px; opacity: .5; margin-left: 2px; }
.th-active { color: var(--primary); }
.th-active .th-sort-icon { opacity: 1; }

.list-row { cursor: pointer; transition: background var(--transition); }
.list-row:hover td { background: var(--page-bg); }

.cell-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.status-sub {
    display: inline-block; margin-left: 6px;
    font-size: 11px; color: var(--text-muted);
}

/* ── Pagination ───────────────────────────────────────────────────── */
.list-pagination {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    background: var(--page-bg);
    flex-wrap: wrap; gap: 8px;
}
.pagination-info { font-size: 12px; color: var(--text-secondary); }
.pagination-controls { display: flex; gap: 8px; }

/* ── Badges ───────────────────────────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .3px;
}
.badge-blue  { background: #dbeafe; color: #1d4ed8; }
.badge-teal  { background: #ccfbf1; color: #0f766e; }
.badge-green { background: #dcfce7; color: #15803d; }
.badge-amber { background: #fef3c7; color: #b45309; }
.badge-red   { background: #fee2e2; color: #b91c1c; }

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 13px; font-weight: 500;
    cursor: pointer; border: none;
    transition: background var(--transition), box-shadow var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover  { background: var(--primary-dark); color: #fff; text-decoration: none; }
.btn-info     { background: #0ea5e9; color: #fff; }
.btn-info:hover     { background: #0284c7; }
.btn-success  { background: var(--green); color: #fff; }
.btn-success:hover  { background: #15803d; }
.btn-sm { padding: 5px 12px; font-size: 12px; }

/* ── Empty State ──────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}
.empty-icon  { font-size: 40px; margin-bottom: 12px; opacity: .4; }
.empty-title { font-size: 15px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.empty-text  { font-size: 13px; margin-bottom: 16px; }

/* ── Skeleton Loaders ─────────────────────────────────────────────── */
@keyframes shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position:  400px 0; }
}
.skeleton-table .skeleton-row,
.skeleton-inline {
    background: linear-gradient(90deg, var(--border) 25%, rgba(255,255,255,.4) 50%, var(--border) 75%);
    background-size: 800px 100%;
    animation: shimmer 1.4s infinite;
    border-radius: var(--radius-sm);
}
.skeleton-row { height: 44px; margin: 8px 16px; border-radius: var(--radius-sm); }
.skeleton-inline { display: inline-block; width: 40px; height: 24px; vertical-align: middle; }

/* ── Party custom dropdown ────────────────────────────────────────── */
.cp-dropdown {
    position: absolute;
    z-index: 1100;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    max-height: 240px;
    overflow-y: auto;
    width: 100%;
    display: none;
}
.cp-drop-item {
    padding: 9px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}
.cp-drop-item:last-child { border-bottom: none; }
.cp-drop-item:hover, .cp-drop-item.cp-active { background: var(--primary-light); }
.cp-drop-name { font-weight: 500; font-size: 13px; color: var(--text-primary); }
.cp-drop-sub  { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.cp-drop-empty { padding: 12px 14px; color: var(--text-muted); font-size: 12px; text-align: center; }

/* ═══════════════════════════════════════════════════════════════════
   Workbench — immersive SPA for booking & party creation
   (themed via portal variables, so Blue/Green/Dark all apply)
   ═══════════════════════════════════════════════════════════════════ */
.wb-shell {
    display: flex; flex-direction: column;
    height: calc(100vh - var(--navbar-height));
    margin-top: var(--navbar-height);
    background: var(--page-bg);
    overflow: hidden;
}
.wb-topbar {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 20px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.wb-back {
    color: var(--text-secondary); font-size: 15px;
    width: 32px; height: 32px; border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    transition: background var(--transition);
}
.wb-back:hover { background: var(--page-bg); text-decoration: none; }
.wb-topbar-title { font-size: 15px; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.wb-topbar-title i { color: var(--primary); }
.wb-topbar-customer { margin-left: auto; font-size: 13px; color: var(--text-secondary); }

.wb-body { display: flex; flex: 1; overflow: hidden; }

.wb-nav {
    width: 210px; flex-shrink: 0;
    background: var(--card-bg);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    padding: 12px 8px; gap: 2px;
    overflow-y: auto;
}
.wb-nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; cursor: pointer;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 500;
    transition: background var(--transition), color var(--transition);
}
.wb-nav-item:hover { background: var(--page-bg); color: var(--text-primary); }
.wb-nav-item.active { background: var(--primary-light); color: var(--primary); }
.wb-nav-icon { width: 18px; text-align: center; }
.wb-nav-divider { height: 1px; background: var(--border); margin: 8px 4px; }
.wb-nav-cta { color: var(--primary); }
.wb-nav-cta.active { color: var(--primary); }

.wb-main { flex: 1; overflow-y: auto; padding: 20px 24px; }

.wb-section-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.wb-section-title { font-size: 17px; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.wb-actions { margin-left: auto; display: flex; gap: 8px; }
.wb-link { color: var(--primary); font-size: 13px; cursor: pointer; margin-left: auto; }
.wb-link:hover { text-decoration: underline; }

.wb-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border: 1px solid var(--input-border);
    border-radius: var(--radius); background: var(--card-bg);
    color: var(--text-primary); cursor: pointer;
    font-size: 13px; font-weight: 500; font-family: var(--font);
    transition: background var(--transition), border-color var(--transition);
}
.wb-btn:hover { background: var(--page-bg); border-color: var(--primary); }
.wb-btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.wb-btn-primary:hover { background: var(--primary-dark); }
.wb-btn-success { background: var(--green); border-color: var(--green); color: #fff; }
.wb-btn-success:hover { background: #15803d; }
.wb-btn[disabled] { opacity: .5; pointer-events: none; }

.wb-stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.wb-stat-card {
    background: var(--card-bg); border: 1px solid var(--card-border);
    border-radius: var(--radius-lg); padding: 16px 18px;
    display: flex; align-items: center; gap: 14px;
    box-shadow: var(--card-shadow);
}
.wb-stat-icon {
    width: 42px; height: 42px; border-radius: var(--radius);
    background: var(--primary-light); color: var(--primary);
    display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0;
}
.wb-stat-value { font-size: 24px; font-weight: 700; color: var(--text-primary); line-height: 1; }
.wb-stat-label { font-size: 12px; color: var(--text-secondary); margin-top: 3px; }

.wb-card {
    background: var(--card-bg); border: 1px solid var(--card-border);
    border-radius: var(--radius-lg); padding: 16px; margin-bottom: 14px;
    box-shadow: var(--card-shadow);
}
.wb-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.wb-card-title { font-weight: 600; font-size: 14px; color: var(--text-primary); margin-bottom: 12px; }
.wb-card-header .wb-card-title { margin-bottom: 0; }

.wb-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.wb-table th {
    text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .4px;
    color: var(--text-secondary); padding: 10px 14px;
    border-bottom: 1px solid var(--border); background: var(--page-bg);
}
.wb-table td { padding: 11px 14px; border-bottom: 1px solid var(--border); color: var(--text-primary); }
.wb-table tbody tr:last-child td { border-bottom: none; }
.wb-row { cursor: pointer; transition: background var(--transition); }
.wb-row:hover td { background: var(--page-bg); }
.wb-table .mono { font-weight: 600; }
.wb-status-sub { display: inline-block; margin-left: 6px; font-size: 11px; color: var(--text-muted); }

.wb-badge {
    display: inline-block; padding: 2px 8px; border-radius: 20px;
    font-size: 11px; font-weight: 600; letter-spacing: .3px;
}
.wb-badge-active { background: #dbeafe; color: #1d4ed8; }
.wb-badge-ffm { background: #ccfbf1; color: #0f766e; }
.wb-badge-cont { background: #fef3c7; color: #b45309; }
.wb-badge-draft { background: #fef3c7; color: #b45309; }
.wb-badge-cancelled { background: #fee2e2; color: #b91c1c; }

.wb-search { max-width: 360px; }

/* forms */
.wb-form-group { margin-bottom: 14px; }
.wb-label { display: block; font-size: 12px; color: var(--text-secondary); margin-bottom: 5px; font-weight: 500; }
.wb-label .req { color: var(--red); margin-left: 2px; }
.wb-input {
    width: 100%; padding: 8px 11px;
    background: var(--card-bg); border: 1px solid var(--input-border);
    border-radius: var(--radius); color: var(--text-primary);
    font-size: 13px; font-family: var(--font); box-sizing: border-box;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.wb-input:focus { outline: none; border-color: var(--input-focus); box-shadow: 0 0 0 2px var(--primary-light); }
.wb-input[readonly] { background: var(--page-bg); color: var(--text-secondary); }
textarea.wb-input { resize: vertical; line-height: 1.5; }
.wb-form-row { display: grid; gap: 12px; }
.wb-form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.wb-form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.wb-party-pick { position: relative; }
.wb-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); margin-top: 8px; }

.wb-form-footer {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 8px 0 24px; position: sticky; bottom: 0;
}

/* alerts */
.wb-alert { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 10px; }
.wb-alert-info { background: var(--primary-light); color: var(--primary-dark); }

/* FSU timeline */
.wb-detail-section-title { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted); margin-bottom: 12px; font-weight: 600; }
.wb-timeline { position: relative; padding-left: 6px; }
.wb-tl-item { position: relative; padding: 0 0 16px 20px; border-left: 2px solid var(--border); }
.wb-tl-item:last-child { border-left-color: transparent; padding-bottom: 0; }
.wb-tl-dot { position: absolute; left: -7px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--text-muted); border: 2px solid var(--card-bg); }
.wb-tl-latest .wb-tl-dot { background: var(--green); box-shadow: 0 0 0 3px #dcfce7; }
.wb-tl-status { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.wb-tl-meta { font-size: 12px; color: var(--text-secondary); margin-top: 1px; }
.wb-tl-time { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

/* detail panel */
.wb-detail-panel {
    width: 300px; flex-shrink: 0;
    background: var(--card-bg); border-left: 1px solid var(--border);
    padding: 18px; overflow-y: auto; display: none;
}
.wb-detail-panel.open { display: block; }

/* states */
.wb-empty { text-align: center; padding: 40px; color: var(--text-muted); font-size: 14px; }
.wb-loader { display: flex; align-items: center; justify-content: center; padding: 40px; }
.wb-spinner { width: 26px; height: 26px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: wb-spin .6s linear infinite; }
@keyframes wb-spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
    .wb-nav { width: 56px; }
    .wb-nav-item span:not(.wb-nav-icon) { display: none; }
    .wb-detail-panel { display: none !important; }
    .wb-stats-row { grid-template-columns: repeat(2, 1fr); }
    .wb-form-row.cols-2, .wb-form-row.cols-3 { grid-template-columns: 1fr; }
}

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .portal-sidebar {
        position: fixed;
        top: var(--navbar-height); left: 0; bottom: 0;
        z-index: 1000;
        transform: translateX(-100%);
    }
    .portal-sidebar.open { transform: translateX(0); }
    .sidebar-overlay.visible { display: block; }

    .page-wrapper { padding: 20px 16px; }
    .summary-grid { grid-template-columns: repeat(2, 1fr); }
    .quick-actions { grid-template-columns: 1fr 1fr; }
    .navbar-title { display: none; }
    .logout-text  { display: none; }
    .customer-name { display: none; }
}

@media (max-width: 480px) {
    .summary-grid { grid-template-columns: 1fr 1fr; }
    .quick-actions { grid-template-columns: 1fr; }
}
