/* IV Tuning Portal v1.8.169 Clean-Slate Studio Compact Layout Fix
   Purpose: replace the previous premium layers with a full admin/customer redesign while leaving routes, forms, links and workflows intact. */

:root,
[data-theme="dark"] {
    color-scheme: dark;
    --studio-bg: #070a10;
    --studio-bg-soft: #0a101a;
    --studio-bg-panel: #0d1420;
    --studio-bg-panel-2: #111b2b;
    --studio-card: rgba(17, 25, 39, .94);
    --studio-card-solid: #111927;
    --studio-card-elevated: #151f31;
    --studio-line: rgba(148, 163, 184, .18);
    --studio-line-strong: rgba(148, 163, 184, .28);
    --studio-text: #f8fafc;
    --studio-text-soft: #cbd5e1;
    --studio-muted: #94a3b8;
    --studio-muted-2: #64748b;
    --studio-primary: var(--ivt-accent, #22d3c5);
    --studio-primary-2: var(--ivt-accent-2, #60a5fa);
    --studio-success: var(--ivt-success, #34d399);
    --studio-warning: var(--ivt-warning, #fbbf24);
    --studio-danger: var(--ivt-danger, #fb7185);
    --studio-purple: #a78bfa;
    --studio-sidebar: 286px;
    --studio-topbar: 74px;
    --studio-radius-xs: 8px;
    --studio-radius-sm: 12px;
    --studio-radius-md: 16px;
    --studio-radius-lg: 22px;
    --studio-radius-xl: 28px;
    --studio-shadow: 0 24px 80px rgba(0, 0, 0, .34);
    --studio-shadow-soft: 0 14px 40px rgba(0, 0, 0, .24);
    --studio-focus: 0 0 0 .22rem rgba(34, 211, 197, .22);
    --studio-gradient: linear-gradient(135deg, rgba(34,211,197,.18), rgba(96,165,250,.12) 48%, rgba(167,139,250,.10));
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--studio-bg); }
body.studio-169-body {
    min-height: 100vh;
    margin: 0;
    color: var(--studio-text);
    background:
        radial-gradient(circle at 10% -10%, rgba(34,211,197,.16), transparent 28rem),
        radial-gradient(circle at 92% 8%, rgba(96,165,250,.14), transparent 32rem),
        linear-gradient(180deg, #070a10 0%, #0a111c 52%, #070a10 100%) !important;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
    font-size: 14px;
    letter-spacing: -0.01em;
    overflow-x: hidden;
}
body.studio-169-body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -2;
    background-image:
        linear-gradient(rgba(148,163,184,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148,163,184,.025) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.78), transparent 90%);
}
body.studio-169-body::after {
    content: "";
    position: fixed;
    inset: auto -12% -38% -12%;
    height: 52vh;
    pointer-events: none;
    z-index: -1;
    background: radial-gradient(ellipse at center, rgba(34,211,197,.08), transparent 62%);
    filter: blur(22px);
}

img, svg { max-width: 100%; }
a { color: var(--studio-primary); text-decoration: none; transition: color .16s ease, border-color .16s ease, background .16s ease, transform .16s ease; }
a:hover { color: #7dd3fc; }
hr { border-color: var(--studio-line); opacity: 1; }
.small, small { color: var(--studio-muted); }
.text-muted, .text-muted-soft { color: var(--studio-muted) !important; }
.text-link { color: var(--studio-primary) !important; font-weight: 800; }
.text-link:hover { color: #99f6e4 !important; }

/* Layout reset */
.portal-layout.studio-169-shell {
    min-height: 100vh;
    display: grid !important;
    grid-template-columns: var(--studio-sidebar) minmax(0, 1fr);
    gap: 0;
    background: transparent !important;
}
.portal-sidebar.studio-sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    width: var(--studio-sidebar) !important;
    min-width: var(--studio-sidebar);
    height: 100vh;
    overflow-y: auto;
    padding: 18px 14px;
    background:
        linear-gradient(180deg, rgba(12,18,29,.98), rgba(8,13,21,.96)),
        radial-gradient(circle at 50% 0, rgba(34,211,197,.12), transparent 20rem) !important;
    border-right: 1px solid var(--studio-line);
    box-shadow: inset -1px 0 0 rgba(255,255,255,.02);
    scrollbar-width: thin;
    scrollbar-color: rgba(148,163,184,.26) transparent;
}
.portal-main.studio-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.content-wrap.studio-content {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 24px clamp(18px, 2.4vw, 36px) 48px !important;
}

/* Sidebar redesigned from scratch */
.sidebar-head.studio-sidebar-head {
    min-height: auto !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 6px 20px !important;
    margin: 0 0 10px !important;
    border-bottom: 1px solid var(--studio-line);
}
.sidebar-logo.studio-brand-lockup {
    width: 100%;
    min-height: 54px;
    display: flex !important;
    align-items: center;
    gap: 12px;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--studio-text) !important;
    overflow: hidden;
}
.sidebar-logo.studio-brand-lockup img {
    width: 46px !important;
    height: 46px !important;
    min-width: 46px;
    object-fit: contain;
    padding: 7px;
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(34,211,197,.18), rgba(96,165,250,.12));
    border: 1px solid rgba(34,211,197,.26);
    box-shadow: 0 16px 38px rgba(34,211,197,.12);
}
.studio-brand-copy { display: grid; gap: 2px; line-height: 1.05; min-width: 0; }
.studio-brand-copy strong {
    display: block;
    font-size: 14px;
    font-weight: 950;
    letter-spacing: -.03em;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.studio-brand-copy small {
    display: block;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--studio-primary);
}
.sidebar-nav.enterprise-nav,
.sidebar-nav {
    display: grid;
    gap: 6px;
    padding: 4px 0 18px !important;
}
.nav-section {
    display: flex !important;
    align-items: center;
    gap: 8px;
    margin: 16px 8px 7px !important;
    font-size: 10px !important;
    line-height: 1;
    font-weight: 950;
    color: var(--studio-muted-2) !important;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.nav-section::after { content: ""; height: 1px; flex: 1; background: var(--studio-line); }
.nav-entry {
    min-height: 42px !important;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 11px !important;
    color: var(--studio-text-soft) !important;
    border: 1px solid transparent !important;
    border-radius: 14px !important;
    background: transparent !important;
    text-decoration: none !important;
    box-shadow: none !important;
}
.nav-entry:hover {
    color: #fff !important;
    background: rgba(148,163,184,.08) !important;
    border-color: rgba(148,163,184,.14) !important;
    transform: translateX(2px);
}
.nav-entry.active {
    color: #fff !important;
    background: linear-gradient(135deg, rgba(34,211,197,.19), rgba(96,165,250,.13)) !important;
    border-color: rgba(34,211,197,.32) !important;
    box-shadow: 0 14px 34px rgba(34,211,197,.09), inset 0 1px 0 rgba(255,255,255,.06) !important;
}
.nav-entry-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.nav-icon {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px;
    display: grid !important;
    place-items: center;
    color: currentColor;
    border-radius: 10px;
    background: rgba(148,163,184,.08);
}
.nav-entry.active .nav-icon { background: rgba(34,211,197,.16); color: var(--studio-primary); }
.nav-icon svg { width: 18px; height: 18px; display: block; }
.nav-label-line { display: flex; align-items: center; gap: 7px; min-width: 0; }
.nav-label {
    display: block;
    font-size: 13px !important;
    font-weight: 850 !important;
    line-height: 1.18;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nav-entry small { display: block; margin-top: 2px; font-size: 11px; color: var(--studio-muted-2); font-weight: 700; }
.nav-arrow { color: rgba(203,213,225,.38); font-size: 20px; line-height: 1; }
.nav-alert-count {
    min-width: 20px;
    height: 20px;
    display: none;
    place-items: center;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 950;
    color: #061018;
    background: var(--studio-warning);
}
.nav-alert-count.show { display: inline-grid; }

/* Topbar redesigned */
.topbar.studio-topbar,
.topbar-shell.studio-topbar {
    position: sticky;
    top: 0;
    z-index: 80;
    min-height: var(--studio-topbar) !important;
    height: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px;
    padding: 14px clamp(18px, 2.4vw, 36px) !important;
    background: rgba(7, 10, 16, .82) !important;
    border-bottom: 1px solid var(--studio-line) !important;
    box-shadow: 0 16px 46px rgba(0,0,0,.20);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}
.topbar-left { min-width: 0; flex: 1 1 auto; }
.admin-topbar-title-row,
.customer-topbar-title-row {
    min-width: 0;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
}
.admin-page-heading,
.customer-page-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    margin-right: 4px;
}
.admin-page-heading strong,
.customer-page-heading strong {
    color: #fff;
    font-size: 16px;
    font-weight: 950;
    letter-spacing: -.035em;
    white-space: nowrap;
}
.admin-topbar-dot,
.customer-topbar-dot { color: rgba(148,163,184,.55); }
.admin-topbar-label,
.customer-topbar-label,
.admin-service-copy,
.customer-service-copy {
    color: var(--studio-muted);
    font-size: 12px;
    font-weight: 800;
}
.admin-service-status,
.customer-service-status,
.admin-service-chip,
.customer-service-chip,
.admin-clock-chip,
.customer-clock-chip {
    min-height: 32px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px;
    padding: 0 12px !important;
    border-radius: 999px !important;
    border: 1px solid var(--studio-line-strong) !important;
    color: var(--studio-text-soft) !important;
    background: rgba(17,25,39,.74) !important;
    box-shadow: none !important;
    font-size: 12px !important;
    font-weight: 850 !important;
    white-space: nowrap;
}
.admin-service-status.online,
.customer-service-status.online { color: #03110e !important; border-color: rgba(34,211,197,.55) !important; background: var(--studio-primary) !important; }
.admin-service-status.offline,
.customer-service-status.offline { color: #fff !important; border-color: rgba(251,113,133,.45) !important; background: rgba(251,113,133,.16) !important; }
.admin-clock-chip svg,
.customer-clock-chip svg { width: 15px; height: 15px; color: var(--studio-muted); }
.topbar-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end;
    gap: 10px !important;
    flex: 0 0 auto;
    min-width: 0;
}
.portal-display-switcher {
    min-height: 42px;
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px;
    padding: 5px !important;
    border-radius: 16px !important;
    border: 1px solid rgba(96,165,250,.20) !important;
    background: rgba(15,23,42,.82) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.portal-display-select,
.form-select.portal-display-select {
    width: auto !important;
    min-width: 84px;
    height: 32px !important;
    padding: 0 26px 0 12px !important;
    border: 1px solid rgba(148,163,184,.18) !important;
    border-radius: 11px !important;
    color: var(--studio-text-soft) !important;
    background-color: rgba(30,41,59,.72) !important;
    font-size: 12px !important;
    font-weight: 850 !important;
    line-height: 32px;
}
.user-chip,
.customer-profile-link,
.customer-credit-display {
    min-height: 42px;
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px;
    padding: 5px 10px !important;
    border: 1px solid var(--studio-line) !important;
    border-radius: 999px !important;
    background: rgba(17,25,39,.72) !important;
    color: var(--studio-text-soft) !important;
    text-decoration: none !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.user-chip-btn,
.user-chip-link { display: inline-flex; align-items: center; gap: 10px; color: inherit !important; text-decoration: none !important; }
.user-chip span,
.customer-avatar-badge {
    width: 30px !important;
    height: 30px !important;
    display: grid !important;
    place-items: center;
    border-radius: 999px;
    color: #061018 !important;
    background: linear-gradient(135deg, var(--studio-primary), var(--studio-primary-2));
    font-size: 12px;
    font-weight: 950;
}
.user-chip strong,
.customer-credit-display strong,
.customer-greeting { color: #fff; font-size: 12px; font-weight: 900; white-space: nowrap; }
.customer-credit-display span { color: var(--studio-muted); font-size: 11px; font-weight: 850; }
.customer-logout-form { margin: 0 !important; }
.customer-logout-btn {
    width: 42px !important;
    height: 42px !important;
    display: grid !important;
    place-items: center;
    padding: 0 !important;
    border-radius: 14px !important;
    border: 1px solid var(--studio-line) !important;
    color: var(--studio-text-soft) !important;
    background: rgba(17,25,39,.72) !important;
}
.customer-logout-btn:hover { color: #fff !important; border-color: rgba(251,113,133,.35) !important; background: rgba(251,113,133,.11) !important; }
.customer-logout-btn svg { width: 18px; height: 18px; }
.mobile-menu-btn {
    width: 42px !important;
    height: 42px !important;
    padding: 0 !important;
    display: inline-grid !important;
    place-items: center;
    border-radius: 14px !important;
    border: 1px solid var(--studio-line) !important;
    background: rgba(17,25,39,.82) !important;
}
.mobile-menu-btn span { display: block; width: 18px; height: 2px; margin: 2px 0; background: var(--studio-text); border-radius: 2px; }

/* Alerts and service banners */
.portal-alert,
.alert {
    border: 1px solid var(--studio-line) !important;
    border-radius: var(--studio-radius-md) !important;
    padding: 13px 15px !important;
    color: var(--studio-text-soft) !important;
    background: rgba(17,25,39,.82) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.alert-success { border-color: rgba(52,211,153,.30) !important; background: rgba(16,185,129,.11) !important; color: #d1fae5 !important; }
.alert-warning { border-color: rgba(251,191,36,.32) !important; background: rgba(251,191,36,.11) !important; color: #fef3c7 !important; }
.alert-danger { border-color: rgba(251,113,133,.34) !important; background: rgba(251,113,133,.12) !important; color: #ffe4e6 !important; }
.service-schedule-banner,
.guest-status-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px !important;
    margin-bottom: 18px !important;
    border: 1px solid rgba(34,211,197,.26) !important;
    border-radius: var(--studio-radius-lg) !important;
    background: linear-gradient(135deg, rgba(34,211,197,.10), rgba(96,165,250,.07)) !important;
    color: var(--studio-text-soft) !important;
}
.service-schedule-banner.offline,
.guest-status-note.offline { border-color: rgba(251,113,133,.30) !important; background: rgba(251,113,133,.10) !important; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-top: 4px; background: var(--studio-muted); box-shadow: 0 0 0 5px rgba(148,163,184,.08); }
.status-dot.online { background: var(--studio-success); box-shadow: 0 0 0 5px rgba(52,211,153,.12); }
.status-dot.offline { background: var(--studio-danger); box-shadow: 0 0 0 5px rgba(251,113,133,.12); }

/* Typography */
h1, h2, h3, h4, h5, h6 { color: #fff; letter-spacing: -.035em; font-weight: 950; }
.eyebrow {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--studio-primary) !important;
    font-size: 10px !important;
    font-weight: 950 !important;
    letter-spacing: .16em !important;
    text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 16px; height: 2px; border-radius: 999px; background: var(--studio-primary); }
.section-title {
    margin: 24px 0 12px !important;
    font-size: 16px !important;
    color: #fff !important;
}
.card-heading-row {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 16px !important;
    margin-bottom: 16px !important;
}
.card-heading-row h2 { margin: 0 0 5px !important; font-size: 20px !important; }
.card-heading-row p { margin: 0 !important; color: var(--studio-muted) !important; }

/* Cards and panels */
.portal-card,
.queue-panel,
.side-panel,
.kpi-card,
.admin-action-tile,
.accept-panel,
.void-action-panel,
.void-lock-panel,
.admin-job-delete-panel,
.delivery-panel,
.upload-panel,
.customer-file-panel,
.support-panel,
.shop-card,
.settings-card,
.invoice-card,
.profile-card,
.system-health-card,
.pricing-card,
.winols-card,
.modal-content,
.guest-card,
.pro-login-card,
.table-panel,
.widget-card,
.customer-message-panel,
.admin-message-panel,
.file-summary-card,
.product-card,
.order-card,
.wallet-card,
.timeline-card,
.activity-card,
.detail-card,
.form-card,
.stat-card {
    border: 1px solid var(--studio-line) !important;
    border-radius: var(--studio-radius-lg) !important;
    background:
        linear-gradient(180deg, rgba(255,255,255,.035), transparent 34%),
        var(--studio-card) !important;
    box-shadow: var(--studio-shadow-soft) !important;
    color: var(--studio-text-soft) !important;
}
.portal-card,
.queue-panel,
.side-panel,
.upload-panel,
.customer-file-panel,
.support-panel,
.settings-card,
.invoice-card,
.profile-card,
.system-health-card,
.pricing-card,
.winols-card,
.table-panel,
.form-card { padding: 20px !important; }
.admin-home-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
    gap: 18px !important;
    align-items: start;
}
.admin-home-grid > .command-hero,
.admin-home-grid > .kpi-grid,
.admin-home-grid > .accounting-kpi-grid,
.admin-home-grid > .queue-panel { grid-column: 1 / -1; }
.command-hero {
    position: relative;
    overflow: hidden;
    min-height: 260px;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(290px, 430px);
    gap: 20px;
    padding: 24px !important;
    background:
        radial-gradient(circle at 20% 0, rgba(34,211,197,.18), transparent 28rem),
        radial-gradient(circle at 95% 30%, rgba(96,165,250,.14), transparent 28rem),
        linear-gradient(135deg, rgba(17,25,39,.96), rgba(10,16,26,.96)) !important;
}
.command-hero::after {
    content: "";
    position: absolute;
    inset: 16px;
    border: 1px solid rgba(255,255,255,.04);
    border-radius: 18px;
    pointer-events: none;
}
.command-copy { position: relative; z-index: 1; align-self: center; max-width: 760px; }
.command-copy h2 { margin: 0 0 10px !important; font-size: clamp(28px, 4vw, 52px) !important; line-height: .95; }
.command-copy p { max-width: 680px; margin: 0; color: var(--studio-muted); font-size: 15px; line-height: 1.65; }
.command-actions {
    position: relative;
    z-index: 1;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-self: stretch;
}
.admin-action-tile {
    display: flex !important;
    flex-direction: column;
    justify-content: space-between;
    min-height: 126px;
    padding: 16px !important;
    color: var(--studio-text-soft) !important;
    background: rgba(7, 10, 16, .35) !important;
    text-decoration: none !important;
}
.admin-action-tile:hover { transform: translateY(-2px); border-color: rgba(34,211,197,.32) !important; }
.admin-action-tile strong { display: block; color: #fff; font-size: 28px; line-height: 1; letter-spacing: -.04em; }
.admin-action-tile span { display: block; margin-top: 6px; color: var(--studio-muted); font-size: 12px; }
.kpi-grid {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px !important;
}
.kpi-card {
    min-height: 118px;
    display: flex !important;
    flex-direction: column;
    justify-content: space-between;
    padding: 16px !important;
    color: var(--studio-text-soft) !important;
    text-decoration: none !important;
    background: rgba(17,25,39,.82) !important;
}
.kpi-card:hover { border-color: rgba(34,211,197,.25) !important; transform: translateY(-1px); }
.kpi-card span { color: var(--studio-muted); font-size: 12px; font-weight: 850; }
.kpi-card strong { color: #fff; font-size: 26px; line-height: 1; letter-spacing: -.035em; }
.kpi-card small { color: var(--studio-muted-2); font-weight: 700; }
.side-panel { align-self: stretch; }
.workflow-mini,
.enterprise-workflow { display: grid !important; gap: 8px !important; }
.workflow-mini a,
.workflow-mini span,
.enterprise-workflow a,
.enterprise-workflow span {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 42px;
    padding: 10px 12px !important;
    border: 1px solid var(--studio-line) !important;
    border-radius: 13px !important;
    background: rgba(15,23,42,.55) !important;
    color: var(--studio-text-soft) !important;
    text-decoration: none !important;
}
.workflow-mini a:hover,
.enterprise-workflow a:hover { color: #fff !important; border-color: rgba(34,211,197,.28) !important; background: rgba(34,211,197,.08) !important; }

/* Buttons */
.btn,
button.btn,
a.btn,
input[type="submit"].btn {
    min-height: 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px;
    padding: 9px 15px !important;
    border-radius: 13px !important;
    font-size: 13px !important;
    font-weight: 900 !important;
    letter-spacing: -.01em;
    line-height: 1.1 !important;
    border-width: 1px !important;
    box-shadow: none !important;
    text-decoration: none !important;
    white-space: nowrap;
    transition: transform .16s ease, background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:focus,
.btn:focus-visible,
.form-control:focus,
.form-select:focus,
.form-check-input:focus { box-shadow: var(--studio-focus) !important; outline: none !important; }
.btn-accent,
.btn-primary {
    color: #061018 !important;
    border-color: transparent !important;
    background: linear-gradient(135deg, var(--studio-primary), #7dd3fc) !important;
    box-shadow: 0 12px 28px rgba(34,211,197,.18) !important;
}
.btn-accent:hover,
.btn-primary:hover { color: #03110e !important; filter: brightness(1.04); }
.btn-outline-light,
.btn-secondary,
.btn-outline-secondary {
    color: var(--studio-text-soft) !important;
    border-color: var(--studio-line-strong) !important;
    background: rgba(15,23,42,.62) !important;
}
.btn-outline-light:hover,
.btn-secondary:hover,
.btn-outline-secondary:hover { color: #fff !important; border-color: rgba(34,211,197,.32) !important; background: rgba(34,211,197,.09) !important; }
.btn-danger,
.btn-outline-danger {
    color: #ffe4e6 !important;
    border-color: rgba(251,113,133,.40) !important;
    background: rgba(251,113,133,.13) !important;
}
.btn-danger:hover,
.btn-outline-danger:hover { color: #fff !important; background: rgba(251,113,133,.22) !important; }
.btn-sm { min-height: 34px !important; padding: 7px 12px !important; font-size: 12px !important; border-radius: 11px !important; }
.btn-lg { min-height: 46px !important; padding: 12px 18px !important; font-size: 14px !important; border-radius: 15px !important; }

/* Forms */
label { color: var(--studio-text-soft); font-size: 12px; font-weight: 850; margin-bottom: 6px; }
.form-label { color: var(--studio-text-soft); font-weight: 850; }
.form-control,
.form-select,
textarea.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="datetime-local"],
input[type="date"],
input[type="file"],
select,
textarea {
    min-height: 42px;
    border: 1px solid rgba(148,163,184,.20) !important;
    border-radius: 13px !important;
    color: var(--studio-text) !important;
    background-color: rgba(8,13,21,.88) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.035) !important;
    font-size: 13px !important;
    font-weight: 650;
}
.form-control::placeholder,
textarea::placeholder { color: rgba(148,163,184,.64) !important; }
.form-select,
select {
    appearance: none !important;
    -webkit-appearance: none !important;
    background-image:
        linear-gradient(45deg, transparent 50%, rgba(203,213,225,.9) 50%),
        linear-gradient(135deg, rgba(203,213,225,.9) 50%, transparent 50%) !important;
    background-position: calc(100% - 18px) 18px, calc(100% - 13px) 18px !important;
    background-size: 5px 5px, 5px 5px !important;
    background-repeat: no-repeat !important;
    padding-right: 34px !important;
}
.input-group-text {
    border-color: rgba(148,163,184,.20) !important;
    border-radius: 13px !important;
    color: var(--studio-muted) !important;
    background: rgba(15,23,42,.78) !important;
}
.form-check-input { border-color: var(--studio-line-strong) !important; background-color: rgba(8,13,21,.9) !important; }
.form-check-input:checked { border-color: var(--studio-primary) !important; background-color: var(--studio-primary) !important; }
fieldset { border-color: var(--studio-line) !important; }

/* Tables */
.table-responsive,
.enterprise-table-wrap {
    border-radius: var(--studio-radius-md) !important;
    border: 1px solid var(--studio-line) !important;
    overflow: auto !important;
    background: rgba(8,13,21,.45) !important;
}
.table,
.portal-table {
    margin: 0 !important;
    color: var(--studio-text-soft) !important;
    border-color: var(--studio-line) !important;
    vertical-align: middle;
}
.table thead th,
.portal-table thead th {
    padding: 12px 14px !important;
    color: var(--studio-muted) !important;
    background: rgba(15,23,42,.92) !important;
    border-bottom: 1px solid var(--studio-line) !important;
    font-size: 11px !important;
    font-weight: 950 !important;
    letter-spacing: .08em;
    text-transform: uppercase;
    white-space: nowrap;
}
.table tbody td,
.portal-table tbody td {
    padding: 13px 14px !important;
    border-color: rgba(148,163,184,.11) !important;
    background: transparent !important;
}
.table tbody tr,
.portal-table tbody tr { transition: background .16s ease; }
.table tbody tr:hover,
.portal-table tbody tr:hover { background: rgba(34,211,197,.045) !important; }
.record-title strong { color: #fff; font-weight: 950; }
.amount-chip,
.job-badge,
.badge,
.status-badge,
.priority-badge,
.schedule-time-pill {
    min-height: 25px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 5px 9px !important;
    border: 1px solid rgba(34,211,197,.25) !important;
    border-radius: 999px !important;
    color: var(--studio-primary) !important;
    background: rgba(34,211,197,.09) !important;
    font-size: 11px !important;
    font-weight: 950 !important;
    line-height: 1 !important;
    white-space: nowrap;
}
.badge.bg-danger,
.badge.danger,
.status-badge.cancelled,
.status-badge.void,
.status-badge.rejected { color: #ffe4e6 !important; border-color: rgba(251,113,133,.34) !important; background: rgba(251,113,133,.14) !important; }
.badge.bg-warning,
.status-badge.pending,
.status-badge.uploaded { color: #fef3c7 !important; border-color: rgba(251,191,36,.34) !important; background: rgba(251,191,36,.13) !important; }
.badge.bg-success,
.status-badge.completed,
.status-badge.paid { color: #d1fae5 !important; border-color: rgba(52,211,153,.34) !important; background: rgba(52,211,153,.12) !important; }

/* Detail and timeline */
.detail-list,
dl.detail-list {
    display: grid !important;
    grid-template-columns: minmax(150px, 230px) minmax(0, 1fr);
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--studio-line);
    border-radius: var(--studio-radius-md);
    background: rgba(8,13,21,.42);
}
.detail-list dt,
.detail-list dd {
    min-height: 42px;
    margin: 0 !important;
    padding: 11px 13px !important;
    border-bottom: 1px solid rgba(148,163,184,.11);
}
.detail-list dt { color: var(--studio-muted); background: rgba(15,23,42,.42); font-size: 11px; font-weight: 950; letter-spacing: .05em; text-transform: uppercase; }
.detail-list dd { color: var(--studio-text-soft); }
.flow-steps {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px !important;
    margin: 18px 0 !important;
}
.flow-step {
    position: relative;
    min-height: 88px;
    padding: 14px !important;
    border: 1px solid var(--studio-line) !important;
    border-radius: 16px !important;
    background: rgba(8,13,21,.42) !important;
}
.flow-step > span:first-child {
    width: 12px;
    height: 12px;
    display: inline-block;
    margin-bottom: 10px;
    border-radius: 999px;
    background: var(--studio-muted-2);
    box-shadow: 0 0 0 5px rgba(148,163,184,.10);
}
.flow-step.done > span:first-child { background: var(--studio-success); box-shadow: 0 0 0 5px rgba(52,211,153,.12); }
.flow-step strong { display: block; color: #fff; font-size: 13px; }
.flow-step small { color: var(--studio-muted); }
.next-action-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 14px 0;
    padding: 13px 15px;
    border-radius: 15px;
    border: 1px solid rgba(34,211,197,.24);
    background: rgba(34,211,197,.08);
}
.next-action-strip span { color: var(--studio-muted); font-size: 12px; font-weight: 850; }
.next-action-strip strong { color: #fff; font-size: 14px; }
.accept-panel,
.void-action-panel,
.void-lock-panel,
.admin-job-delete-panel {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px !important;
    margin: 14px 0 !important;
}
.accept-panel p,
.void-action-panel p,
.void-lock-panel p,
.admin-job-delete-panel p { margin: 4px 0 0 !important; color: var(--studio-muted); }

/* Upload / file workflow areas */
.upload-shell,
.upload-grid,
.file-view-grid,
.job-show-grid,
.customer-job-grid,
.support-ticket-grid,
.settings-grid,
.shop-grid,
.invoice-grid,
.wallet-grid {
    display: grid;
    gap: 18px;
}
.upload-dropzone,
.file-dropzone,
.dropzone,
.upload-box,
.file-upload-box {
    border: 1px dashed rgba(34,211,197,.42) !important;
    border-radius: 20px !important;
    background: linear-gradient(135deg, rgba(34,211,197,.09), rgba(96,165,250,.055)) !important;
    padding: 22px !important;
}
.upload-dropzone:hover,
.file-dropzone:hover,
.dropzone:hover,
.upload-box:hover,
.file-upload-box:hover { border-color: rgba(34,211,197,.70) !important; background: rgba(34,211,197,.12) !important; }
.solution-card,
.solution-row,
.addon-card,
.stage-tab,
.pricing-option-card,
.option-card {
    border: 1px solid var(--studio-line) !important;
    border-radius: 16px !important;
    background: rgba(8,13,21,.45) !important;
    padding: 13px !important;
}
.solution-card:hover,
.addon-card:hover,
.stage-tab:hover,
.pricing-option-card:hover { border-color: rgba(34,211,197,.28) !important; }
.stage-tabs,
.solution-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.stage-tab.active,
.solution-card.active,
.solution-row.active { border-color: rgba(34,211,197,.45) !important; background: rgba(34,211,197,.11) !important; }

/* Shop, support, bot and settings generic structure */
.nav-tabs {
    gap: 8px;
    border-bottom: 1px solid var(--studio-line) !important;
}
.nav-tabs .nav-link {
    border: 1px solid transparent !important;
    border-radius: 12px 12px 0 0 !important;
    color: var(--studio-muted) !important;
    font-weight: 850;
}
.nav-tabs .nav-link:hover { color: #fff !important; border-color: var(--studio-line) !important; }
.nav-tabs .nav-link.active { color: #fff !important; background: rgba(34,211,197,.10) !important; border-color: var(--studio-line) var(--studio-line) transparent !important; }
.nav-pills { gap: 8px; }
.nav-pills .nav-link {
    border: 1px solid var(--studio-line) !important;
    border-radius: 999px !important;
    color: var(--studio-text-soft) !important;
    font-weight: 850;
    background: rgba(15,23,42,.55) !important;
}
.nav-pills .nav-link.active { color: #061018 !important; border-color: transparent !important; background: var(--studio-primary) !important; }
.modal-content { background: #0f1724 !important; }
.modal-header,
.modal-footer { border-color: var(--studio-line) !important; }
.dropdown-menu {
    border: 1px solid var(--studio-line) !important;
    border-radius: 14px !important;
    background: #0f1724 !important;
    box-shadow: var(--studio-shadow-soft) !important;
}
.dropdown-item { color: var(--studio-text-soft) !important; font-weight: 750; }
.dropdown-item:hover { color: #fff !important; background: rgba(34,211,197,.09) !important; }
.pagination { gap: 6px; }
.page-link {
    border: 1px solid var(--studio-line) !important;
    border-radius: 10px !important;
    color: var(--studio-text-soft) !important;
    background: rgba(15,23,42,.72) !important;
}
.page-item.active .page-link { color: #061018 !important; background: var(--studio-primary) !important; border-color: transparent !important; }

/* Guest / auth from scratch */
.studio-169-guest {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    background:
        radial-gradient(circle at 22% 14%, rgba(34,211,197,.18), transparent 34rem),
        radial-gradient(circle at 88% 82%, rgba(96,165,250,.14), transparent 36rem),
        #070a10 !important;
}
.guest-shell.studio-guest-shell,
.pro-login-shell.studio-guest-shell {
    width: min(100%, 1080px) !important;
    min-height: auto !important;
    display: grid !important;
    place-items: center;
    padding: 0 !important;
}
.guest-card.studio-guest-card,
.pro-login-card.studio-guest-card {
    position: relative;
    width: min(100%, 480px) !important;
    padding: 30px !important;
    border-radius: 28px !important;
    background:
        linear-gradient(180deg, rgba(255,255,255,.055), transparent 38%),
        rgba(17,25,39,.92) !important;
    border: 1px solid rgba(148,163,184,.20) !important;
    box-shadow: 0 30px 100px rgba(0,0,0,.45) !important;
    backdrop-filter: blur(18px);
}
.guest-card.studio-guest-card::before {
    content: "";
    position: absolute;
    inset: -1px;
    z-index: -1;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(34,211,197,.45), rgba(96,165,250,.18), transparent 55%);
    opacity: .55;
}
.guest-card h1,
.guest-card h2,
.pro-login-card h1,
.pro-login-card h2 { font-size: 30px !important; margin-bottom: 8px !important; }
.guest-card p,
.pro-login-card p { color: var(--studio-muted); }

/* Specific known classes from previous builds: normalize without relying on old premium CSS */
.files-controls,
.files-toolbar,
.search-toolbar,
.table-toolbar,
.action-toolbar {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.customer-messages-panel,
.admin-customer-messages-panel,
.message-timeline,
.support-thread,
.activity-panel,
.helper-log-panel {
    max-height: 520px;
    overflow: auto;
    border: 1px solid var(--studio-line) !important;
    border-radius: 17px !important;
    background: rgba(8,13,21,.42) !important;
    padding: 12px !important;
}
.message-bubble,
.thread-message,
.activity-row,
.log-row {
    border: 1px solid rgba(148,163,184,.12) !important;
    border-radius: 14px !important;
    background: rgba(15,23,42,.55) !important;
    padding: 12px !important;
    margin-bottom: 9px !important;
}
.confidence-bar,
.progress { height: 10px !important; border-radius: 999px !important; background: rgba(15,23,42,.90) !important; overflow: hidden; }
.confidence-bar > span,
.progress-bar { border-radius: inherit !important; background: linear-gradient(90deg, var(--studio-primary), var(--studio-primary-2)) !important; }
.shop-product-grid,
.products-grid,
.product-grid { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px !important; }
.product-tile,
.shop-product-card,
.product-card { overflow: hidden; }
.product-tile img,
.shop-product-card img,
.product-card img { width: 100%; aspect-ratio: 16/11; object-fit: cover; border-radius: 14px; background: rgba(15,23,42,.55); }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: rgba(148,163,184,.32) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(148,163,184,.24); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,.38); border: 3px solid transparent; background-clip: padding-box; }

/* Responsive */
@media (max-width: 1280px) {
    :root { --studio-sidebar: 262px; }
    .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .command-hero { grid-template-columns: minmax(0, 1fr); }
    .command-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 991.98px) {
    .portal-layout.studio-169-shell { display: block !important; }
    .portal-sidebar.studio-sidebar {
        position: fixed !important;
        width: min(88vw, 320px) !important;
        min-width: 0;
        height: 100vh;
        padding: 18px 14px !important;
    }
    .topbar.studio-topbar { align-items: flex-start !important; flex-direction: column; gap: 12px !important; }
    .topbar-left, .topbar-actions { width: 100%; }
    .topbar-actions { justify-content: flex-start; flex-wrap: wrap; }
    .content-wrap.studio-content { padding: 18px 14px 38px !important; }
    .admin-home-grid { grid-template-columns: 1fr; }
    .command-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    body.studio-169-body { font-size: 13px; }
    .topbar.studio-topbar { padding: 12px 14px !important; }
    .admin-page-heading,
    .customer-page-heading { width: 100%; }
    .admin-page-heading strong,
    .customer-page-heading strong { font-size: 15px; }
    .portal-display-switcher { width: 100%; }
    .portal-display-select { flex: 1 1 0; min-width: 0 !important; }
    .user-chip, .customer-profile-link, .customer-credit-display { max-width: 100%; }
    .customer-greeting, .user-chip strong { overflow: hidden; text-overflow: ellipsis; }
    .command-hero { min-height: auto; padding: 18px !important; }
    .command-copy h2 { font-size: 32px !important; }
    .command-actions { grid-template-columns: 1fr; }
    .kpi-grid { grid-template-columns: 1fr; }
    .card-heading-row { flex-direction: column; align-items: stretch !important; }
    .btn { width: auto; white-space: normal; }
    .detail-list { grid-template-columns: 1fr !important; }
    .detail-list dt { border-bottom: 0; padding-bottom: 4px !important; }
    .detail-list dd { padding-top: 4px !important; }
    .accept-panel,
    .void-action-panel,
    .admin-job-delete-panel { flex-direction: column; align-items: stretch !important; }
    .guest-card.studio-guest-card { padding: 22px !important; }
}

/* Print/export sanity */
@media print {
    .portal-sidebar,
    .topbar,
    .btn,
    .portal-display-switcher { display: none !important; }
    .portal-layout.studio-169-shell { display: block !important; }
    body.studio-169-body { background: #fff !important; color: #000 !important; }
    .portal-card,
    .queue-panel,
    .side-panel { box-shadow: none !important; border-color: #ddd !important; background: #fff !important; color: #000 !important; }
}

/* New v1.8.169 shell-only elements */
.studio-sidebar-footer {
    margin: 16px 4px 2px;
    padding: 13px 14px;
    border: 1px solid rgba(34,211,197,.20);
    border-radius: 17px;
    background: linear-gradient(135deg, rgba(34,211,197,.10), rgba(96,165,250,.055));
}
.studio-sidebar-footer span,
.studio-sidebar-footer small {
    display: block;
    color: var(--studio-muted);
    font-size: 11px;
    font-weight: 850;
}
.studio-sidebar-footer strong {
    display: block;
    margin: 4px 0;
    color: #fff;
    font-size: 18px;
    line-height: 1;
    letter-spacing: -.04em;
}
.studio-page-frame { width: 100%; min-width: 0; }
.studio-page-frame > :first-child { margin-top: 0 !important; }
.studio-page-frame > :last-child { margin-bottom: 0 !important; }

/* v1.8.169: hard layout/padding correction
   This section intentionally outranks legacy portal.css rules that were still forcing
   old margin-left widths, 160px menu experiments and oversized queue/card spacing. */
@media (min-width: 992px) {
    .portal-layout.studio-169-shell,
    .portal-layout.studio-169-shell.portal-layout-admin,
    .portal-layout.studio-169-shell.portal-layout-customer {
        display: grid !important;
        grid-template-columns: var(--studio-sidebar) minmax(0, 1fr) !important;
        gap: 0 !important;
        width: 100% !important;
        min-height: 100vh !important;
    }

    .portal-layout.studio-169-shell.portal-layout-admin .portal-main.studio-main,
    .portal-layout.studio-169-shell.portal-layout-customer .portal-main.studio-main,
    .portal-layout.studio-169-shell .portal-main.studio-main {
        width: auto !important;
        max-width: none !important;
        min-width: 0 !important;
        margin-left: 0 !important;
        padding-left: 0 !important;
    }

    .portal-layout.studio-169-shell.portal-layout-admin .portal-sidebar.studio-sidebar,
    .portal-layout.studio-169-shell.portal-layout-customer .portal-sidebar.studio-sidebar,
    .portal-layout.studio-169-shell .portal-sidebar.studio-sidebar {
        width: var(--studio-sidebar) !important;
        min-width: var(--studio-sidebar) !important;
        max-width: var(--studio-sidebar) !important;
        padding: 14px 12px !important;
        overflow-x: hidden !important;
    }
}

:root,
[data-theme="dark"] {
    --studio-sidebar: 252px;
    --studio-topbar: 62px;
    --studio-radius-lg: 16px;
    --studio-radius-xl: 20px;
}

body.studio-169-body { font-size: 13px; }

/* Sidebar: remove legacy narrow/tall tile menu and restore a normal compact nav. */
.portal-layout.studio-169-shell .sidebar-head.studio-sidebar-head,
.portal-layout.studio-169-shell.portal-layout-admin .sidebar-head.studio-sidebar-head,
.portal-layout.studio-169-shell.portal-layout-customer .sidebar-head.studio-sidebar-head {
    min-height: 56px !important;
    height: auto !important;
    padding: 6px 4px 14px !important;
    margin: 0 0 8px !important;
    justify-content: flex-start !important;
    background: transparent !important;
}

.portal-layout.studio-169-shell .sidebar-logo.studio-brand-lockup,
.portal-layout.studio-169-shell.portal-layout-admin .sidebar-logo.studio-brand-lockup,
.portal-layout.studio-169-shell.portal-layout-customer .sidebar-logo.studio-brand-lockup {
    min-height: 46px !important;
    height: auto !important;
    width: 100% !important;
    justify-content: flex-start !important;
    padding: 0 !important;
    overflow: visible !important;
}

.portal-layout.studio-169-shell .sidebar-logo.studio-brand-lockup img,
.portal-layout.studio-169-shell.portal-layout-admin .sidebar-logo.studio-brand-lockup img,
.portal-layout.studio-169-shell.portal-layout-customer .sidebar-logo.studio-brand-lockup img {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    max-height: 42px !important;
    padding: 6px !important;
}

.portal-layout.studio-169-shell .studio-brand-copy,
.portal-layout.studio-169-shell.portal-layout-admin .studio-brand-copy,
.portal-layout.studio-169-shell.portal-layout-customer .studio-brand-copy {
    display: grid !important;
    max-width: none !important;
    min-width: 0 !important;
}

.portal-layout.studio-169-shell .sidebar-nav,
.portal-layout.studio-169-shell .sidebar-nav.enterprise-nav,
.portal-layout.studio-169-shell.portal-layout-admin .sidebar-nav,
.portal-layout.studio-169-shell.portal-layout-customer .sidebar-nav {
    display: grid !important;
    align-items: stretch !important;
    gap: 4px !important;
    padding: 2px 0 14px !important;
}

.portal-layout.studio-169-shell .nav-section,
.portal-layout.studio-169-shell.portal-layout-admin .nav-section,
.portal-layout.studio-169-shell.portal-layout-customer .nav-section,
.portal-layout.studio-169-shell .enterprise-nav .nav-section {
    display: flex !important;
    width: auto !important;
    height: auto !important;
    margin: 12px 6px 6px !important;
    padding: 0 !important;
    font-size: 10px !important;
    line-height: 1 !important;
    letter-spacing: .14em !important;
    color: var(--studio-muted-2) !important;
}

.portal-layout.studio-169-shell .sidebar-nav a.nav-entry,
.portal-layout.studio-169-shell .enterprise-nav a.nav-entry,
.portal-layout.studio-169-shell.portal-layout-admin .nav-entry,
.portal-layout.studio-169-shell.portal-layout-customer .nav-entry,
.portal-layout.studio-169-shell a.nav-entry {
    width: 100% !important;
    max-width: none !important;
    min-height: 40px !important;
    height: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    padding: 8px 10px !important;
    border-radius: 12px !important;
    text-align: left !important;
    transform: none !important;
}

.portal-layout.studio-169-shell .nav-entry-main,
.portal-layout.studio-169-shell.portal-layout-customer .nav-entry-main,
.portal-layout.studio-169-shell.portal-layout-admin .nav-entry-main {
    display: flex !important;
    align-items: center !important;
    justify-items: initial !important;
    gap: 9px !important;
    min-width: 0 !important;
}

.portal-layout.studio-169-shell .nav-icon,
.portal-layout.studio-169-shell.portal-layout-admin .nav-icon,
.portal-layout.studio-169-shell.portal-layout-customer .nav-icon {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    flex: 0 0 28px !important;
    flex-basis: 28px !important;
    border-radius: 9px !important;
    background: rgba(148,163,184,.08) !important;
}

.portal-layout.studio-169-shell .nav-icon svg,
.portal-layout.studio-169-shell.portal-layout-customer .nav-icon svg,
.portal-layout.studio-169-shell.portal-layout-admin .nav-icon svg {
    width: 16px !important;
    height: 16px !important;
}

.portal-layout.studio-169-shell .nav-label,
.portal-layout.studio-169-shell.portal-layout-admin .nav-label,
.portal-layout.studio-169-shell.portal-layout-customer .nav-label {
    max-width: none !important;
    font-size: 12.5px !important;
    font-weight: 820 !important;
    line-height: 1.12 !important;
    text-align: left !important;
    white-space: normal !important;
}

.portal-layout.studio-169-shell .nav-entry small,
.portal-layout.studio-169-shell.portal-layout-admin .nav-entry small,
.portal-layout.studio-169-shell.portal-layout-customer .nav-entry small {
    display: none !important;
}

.portal-layout.studio-169-shell .nav-arrow,
.portal-layout.studio-169-shell.portal-layout-admin .nav-arrow,
.portal-layout.studio-169-shell.portal-layout-customer .nav-arrow {
    display: inline-flex !important;
    color: rgba(203,213,225,.36) !important;
}

.portal-layout.studio-169-shell .studio-sidebar-footer {
    margin: 10px 2px 0 !important;
    padding: 10px 12px !important;
    border-radius: 14px !important;
}

/* Topbar/content: stop the old margin and giant gutters. */
.portal-layout.studio-169-shell .topbar.studio-topbar,
.portal-layout.studio-169-shell .topbar-shell.studio-topbar,
.portal-layout.studio-169-shell.portal-layout-admin .topbar-shell.studio-topbar,
.portal-layout.studio-169-shell.portal-layout-customer .topbar-shell.studio-topbar {
    width: 100% !important;
    min-height: var(--studio-topbar) !important;
    padding: 10px 18px !important;
    gap: 12px !important;
    border-radius: 0 !important;
}

.portal-layout.studio-169-shell .topbar-left {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    min-width: 0 !important;
}

.portal-layout.studio-169-shell .admin-topbar-title-row,
.portal-layout.studio-169-shell .customer-topbar-title-row {
    gap: 8px !important;
}

.portal-layout.studio-169-shell .topbar-actions {
    gap: 8px !important;
    min-width: 0 !important;
    flex-wrap: wrap !important;
}

.portal-layout.studio-169-shell .portal-display-switcher,
.portal-layout.studio-169-shell .user-chip,
.portal-layout.studio-169-shell .customer-profile-link,
.portal-layout.studio-169-shell .customer-credit-display {
    min-height: 36px !important;
    padding: 4px 6px !important;
    border-radius: 13px !important;
}

.portal-layout.studio-169-shell .admin-service-status,
.portal-layout.studio-169-shell .customer-service-status,
.portal-layout.studio-169-shell .admin-service-chip,
.portal-layout.studio-169-shell .customer-service-chip,
.portal-layout.studio-169-shell .admin-clock-chip,
.portal-layout.studio-169-shell .customer-clock-chip {
    min-height: 30px !important;
    padding: 0 10px !important;
    font-size: 11.5px !important;
}

.portal-layout.studio-169-shell .content-wrap.studio-content,
.portal-layout.studio-169-shell.portal-layout-admin .content-wrap.studio-content,
.portal-layout.studio-169-shell.portal-layout-customer .content-wrap.studio-content {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 16px 18px 34px !important;
}

.portal-layout.studio-169-shell .studio-page-frame {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
}

/* Cards and page sections: compact consistent padding. */
.portal-layout.studio-169-shell .portal-card,
.portal-layout.studio-169-shell .queue-panel,
.portal-layout.studio-169-shell .side-panel,
.portal-layout.studio-169-shell .upload-panel,
.portal-layout.studio-169-shell .customer-file-panel,
.portal-layout.studio-169-shell .support-panel,
.portal-layout.studio-169-shell .settings-card,
.portal-layout.studio-169-shell .invoice-card,
.portal-layout.studio-169-shell .profile-card,
.portal-layout.studio-169-shell .system-health-card,
.portal-layout.studio-169-shell .pricing-card,
.portal-layout.studio-169-shell .winols-card,
.portal-layout.studio-169-shell .table-panel,
.portal-layout.studio-169-shell .form-card,
.portal-layout.studio-169-shell .admin-pro-card,
.portal-layout.studio-169-shell .enterprise-card {
    padding: 16px !important;
    border-radius: 16px !important;
}

.portal-layout.studio-169-shell .portal-alert,
.portal-layout.studio-169-shell .alert,
.portal-layout.studio-169-shell .service-schedule-banner {
    padding: 11px 13px !important;
    margin-bottom: 14px !important;
    border-radius: 14px !important;
}

/* File queue screenshot fix: hero and filters should use the available width without giant empty space. */
.portal-layout.studio-169-shell .queue-command-card,
.portal-layout.studio-169-shell.portal-layout-admin .queue-command-card {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 14px !important;
    min-height: 0 !important;
    margin: 0 0 14px !important;
    padding: 16px !important;
    border-radius: 16px !important;
}

.portal-layout.studio-169-shell .queue-command-copy h2 {
    margin: 0 0 6px !important;
    font-size: 22px !important;
    line-height: 1.1 !important;
}

.portal-layout.studio-169-shell .queue-command-copy p {
    margin: 0 !important;
    max-width: 780px !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
}

.portal-layout.studio-169-shell .eyebrow {
    margin-bottom: 7px !important;
    font-size: 9.5px !important;
}

.portal-layout.studio-169-shell .queue-stat-strip {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(68px, 1fr)) !important;
    gap: 8px !important;
    width: min(100%, 440px) !important;
}

.portal-layout.studio-169-shell .queue-stat-strip a {
    min-height: 58px !important;
    padding: 9px 10px !important;
    border-radius: 13px !important;
}

.portal-layout.studio-169-shell .queue-stat-strip span { font-size: 9.5px !important; }
.portal-layout.studio-169-shell .queue-stat-strip strong { font-size: 20px !important; }

.portal-layout.studio-169-shell .toolbar-card.compact-toolbar,
.portal-layout.studio-169-shell .compact-toolbar {
    display: grid !important;
    gap: 10px !important;
    margin-bottom: 14px !important;
    padding: 12px !important;
    border-radius: 15px !important;
}

.portal-layout.studio-169-shell .admin-filter-row,
.portal-layout.studio-169-shell .admin-filter-row.filter-row,
.portal-layout.studio-169-shell .admin-filter-row.filter-row.five,
.portal-layout.studio-169-shell .admin-filter-row.filter-row.six {
    display: grid !important;
    grid-template-columns: minmax(220px, 1.2fr) repeat(4, minmax(140px, .8fr)) auto !important;
    gap: 9px !important;
    margin: 0 !important;
    padding: 0 !important;
    align-items: center !important;
}

.portal-layout.studio-169-shell .queue-filter-pills {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 7px !important;
    overflow: visible !important;
}

.portal-layout.studio-169-shell .queue-filter-pills a {
    min-height: 30px !important;
    padding: 6px 10px !important;
    border-radius: 999px !important;
    font-size: 11.5px !important;
}

.portal-layout.studio-169-shell .table-responsive,
.portal-layout.studio-169-shell .enterprise-table-wrap,
.portal-layout.studio-169-shell .pro-table-wrap {
    border-radius: 14px !important;
}

.portal-layout.studio-169-shell .table thead th,
.portal-layout.studio-169-shell .portal-table thead th {
    padding: 10px 12px !important;
    font-size: 10.5px !important;
}

.portal-layout.studio-169-shell .table tbody td,
.portal-layout.studio-169-shell .portal-table tbody td,
.portal-layout.studio-169-shell .admin-queue-table tbody td {
    padding: 10px 12px !important;
}

.portal-layout.studio-169-shell .form-control,
.portal-layout.studio-169-shell .form-select,
.portal-layout.studio-169-shell textarea.form-control,
.portal-layout.studio-169-shell input[type="text"],
.portal-layout.studio-169-shell input[type="email"],
.portal-layout.studio-169-shell input[type="password"],
.portal-layout.studio-169-shell input[type="number"],
.portal-layout.studio-169-shell input[type="datetime-local"],
.portal-layout.studio-169-shell input[type="date"],
.portal-layout.studio-169-shell input[type="file"],
.portal-layout.studio-169-shell select,
.portal-layout.studio-169-shell textarea {
    min-height: 38px !important;
    border-radius: 11px !important;
    font-size: 12.5px !important;
}

.portal-layout.studio-169-shell .btn,
.portal-layout.studio-169-shell button.btn,
.portal-layout.studio-169-shell a.btn,
.portal-layout.studio-169-shell input[type="submit"].btn {
    min-height: 36px !important;
    padding: 8px 12px !important;
    border-radius: 11px !important;
    font-size: 12.5px !important;
}

.portal-layout.studio-169-shell .btn-sm {
    min-height: 30px !important;
    padding: 6px 10px !important;
    border-radius: 10px !important;
    font-size: 11.5px !important;
}

/* Stop legacy customer screenshot theme from hiding topbar or forcing a tiny 136px sidebar. */
.portal-layout.studio-169-shell.portal-layout-customer .topbar.studio-topbar,
.portal-layout.studio-169-shell.portal-layout-customer .topbar-shell.studio-topbar {
    display: flex !important;
}

@media (max-width: 1280px) {
    :root { --studio-sidebar: 238px; }
    .portal-layout.studio-169-shell .queue-command-card { grid-template-columns: 1fr !important; }
    .portal-layout.studio-169-shell .queue-stat-strip { width: 100% !important; }
    .portal-layout.studio-169-shell .admin-filter-row,
    .portal-layout.studio-169-shell .admin-filter-row.filter-row,
    .portal-layout.studio-169-shell .admin-filter-row.filter-row.five,
    .portal-layout.studio-169-shell .admin-filter-row.filter-row.six {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 991.98px) {
    .portal-layout.studio-169-shell,
    .portal-layout.studio-169-shell.portal-layout-admin,
    .portal-layout.studio-169-shell.portal-layout-customer {
        display: block !important;
    }
    .portal-layout.studio-169-shell .portal-main.studio-main,
    .portal-layout.studio-169-shell.portal-layout-admin .portal-main.studio-main,
    .portal-layout.studio-169-shell.portal-layout-customer .portal-main.studio-main {
        width: 100% !important;
        margin-left: 0 !important;
    }
    .portal-layout.studio-169-shell .portal-sidebar.studio-sidebar,
    .portal-layout.studio-169-shell.portal-layout-admin .portal-sidebar.studio-sidebar,
    .portal-layout.studio-169-shell.portal-layout-customer .portal-sidebar.studio-sidebar {
        width: min(86vw, 300px) !important;
        min-width: 0 !important;
        max-width: none !important;
        padding: 14px 12px !important;
    }
    .portal-layout.studio-169-shell .topbar.studio-topbar,
    .portal-layout.studio-169-shell .topbar-shell.studio-topbar {
        padding: 10px 12px !important;
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .portal-layout.studio-169-shell .content-wrap.studio-content,
    .portal-layout.studio-169-shell.portal-layout-admin .content-wrap.studio-content,
    .portal-layout.studio-169-shell.portal-layout-customer .content-wrap.studio-content {
        padding: 12px 12px 28px !important;
    }
    .portal-layout.studio-169-shell .admin-filter-row,
    .portal-layout.studio-169-shell .admin-filter-row.filter-row,
    .portal-layout.studio-169-shell .admin-filter-row.filter-row.five,
    .portal-layout.studio-169-shell .admin-filter-row.filter-row.six {
        grid-template-columns: 1fr !important;
    }
    .portal-layout.studio-169-shell .queue-stat-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 640px) {
    .portal-layout.studio-169-shell .portal-card,
    .portal-layout.studio-169-shell .queue-panel,
    .portal-layout.studio-169-shell .side-panel,
    .portal-layout.studio-169-shell .enterprise-card {
        padding: 12px !important;
        border-radius: 14px !important;
    }
    .portal-layout.studio-169-shell .queue-stat-strip {
        grid-template-columns: 1fr !important;
    }
}
