/* 
   TMA & Web Unified Design Code
   Based on Telegram System Variables and Bootstrap 5.3
*/

.material-symbols-rounded {
  font-family: 'Material Symbols Rounded' !important;
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 48;
}

:root {
    /* Theme Colors - Default (Light Theme - Gold Palette / Champagne) */
    --bg-color: #F9F4E8;
    --surface-color: #FFFFFF;
    --primary-color: #1B4D3E;
    --primary-gradient: linear-gradient(135deg, #D4AF37 0%, #E5C387 100%);
    --text-color: #1A1A1A;
    --hint-color: rgba(26, 26, 26, 0.6);
    --border-gold: rgba(229, 195, 135, 0.35);
    --viz-bg: #000000;
    
    /* Glassmorphism Variables - Light */
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(229, 195, 135, 0.2);
    --glass-hover: rgba(229, 195, 135, 0.08);

    /* oCBot Unified Brand Colors */
    --rb-green:        #1B4D3E;
    --rb-green-rgb:    27, 77, 62;
    --rb-gold:         #D4AF37;
    --rb-gold-light:   #E5C387;
    --rb-gold-rgb:     229, 195, 135;
    --rb-cream:        #F9F4E8;

    /* Semantic Status Colors (Light Theme Semantic) */
    --color-success: #1B4D3E;
    --color-warning: #D4AF37;
    --color-danger: #B22222;
    --color-accent: #1B4D3E;

    /* Project Specifics */
    --radius-standard: 12px;
    --input-height: 52px;
    --base-font-size: 17px;
    --transition-fast: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Surface Tints */
    --surface-tint-bg: rgba(27, 77, 62, 0.05);
}

/* Breadcrumbs Navigation */
#breadcrumb-nav, #nav-modal-breadcrumbs {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    padding: 10px 0;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
    min-height: 40px;
}
#breadcrumb-nav::-webkit-scrollbar, #nav-modal-breadcrumbs::-webkit-scrollbar { 
    display: none; 
}

.bc-container {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 4px;
}

.bc-home {
    display: flex;
    align-items: center;
    color: var(--hint-color);
    text-decoration: none;
    transition: var(--transition-fast);
}
.bc-home:hover { color: var(--primary-color); }
.bc-home .material-symbols-rounded { font-size: 20px; }

.bc-sep {
    color: var(--hint-color);
    opacity: 0.3;
    font-size: 18px;
    user-select: none;
    display: flex;
    align-items: center;
}

.bc-item {
    color: var(--hint-color);
    text-decoration: none;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
}
.bc-item:hover { color: var(--primary-color); }

.bc-current {
    color: var(--primary-color);
    pointer-events: none;
}

.light-theme .bc-item { color: rgba(26, 26, 26, 0.6); }
.light-theme .bc-current { color: var(--primary-color); }
.light-theme .bc-sep { color: #1A1A1A; }


/* Helper: Surface Tint */
.surface-tint {
    background-color: var(--surface-tint-bg);
    border-radius: 12px;
}

/* Typography Enhancements */
.text-success { color: var(--color-success) !important; }
.text-warning { color: var(--color-warning) !important; }
.text-danger { color: var(--color-danger) !important; }
.text-accent { color: var(--color-accent) !important; }
.text-primary { color: var(--primary-color) !important; }
.text-secondary, .text-muted { color: var(--hint-color) !important; }
.text-contrast { color: var(--bg-color) !important; }

/* Base Styles */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: var(--base-font-size);
    line-height: 1.6;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

h1, h2, h3, h4, h5, .h1, .h2, .h3, .h4, .h5 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}


body {
    line-height: 1.6;
}

/* Container logic: 1 col on mobile (up to 991px), full-width 2 col on desktop (992px+) */
.main-app-container {
    width: 100%;
    margin: 0 auto;
    min-height: 100vh;
    background-color: var(--bg-color);
    position: relative;
    padding-bottom: 80px; /* Space for Bottom Nav */
    transition: max-width 0.3s ease;
}

@media (max-width: 991px) {
    .main-app-container {
        max-width: 500px; /* Classic TMA "phone" look on medium screens */
    }
}

@media (min-width: 992px) {
    .main-app-container {
        max-width: 100% !important;
        margin: 0 !important;
        padding-left: 15px;
        padding-right: 15px;
        width: 100vw;
    }
}

/* Bootstrap Overrides */
.btn {
    border-radius: var(--radius-standard);
    padding: 12px 24px;
    height: var(--input-height);
    font-weight: 600;
    text-transform: none;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.btn-primary {
    background: var(--primary-color) !important;
    color: var(--bg-color) !important;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.15);
}

.btn-primary:hover {
    background: var(--primary-gradient) !important;
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(212, 175, 55, 0.25);
}

.btn-primary:active {
    transform: translateY(0);
    opacity: 0.9;
}

.btn-warning {
    background: var(--color-warning) !important;
    color: #0B241E !important; /* Always dark text on gold button for contrast */
    box-shadow: 0 4px 15px rgba(229, 195, 135, 0.2);
}

.btn-warning:hover {
    background: var(--primary-gradient) !important;
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(229, 195, 135, 0.3);
}

/* Input Fields & Selects */
.form-control, .form-select {
    height: 48px;
    border-radius: 12px !important;
    background-color: var(--surface-color);
    border: 1px solid var(--border-gold);
    color: var(--text-color) !important;
    font-size: 16px;
    padding: 0 16px;
    text-align: center; /* As per Design System */
    transition: var(--transition-fast);
}

.form-control:focus, .form-select:focus {
    background-color: var(--surface-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(229, 195, 135, 0.2);
    color: var(--text-color) !important;
    outline: none;
}

/* Remove default arrows from number inputs */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Custom Select Arrow to match Steppers */
.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236c757d' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 16px 12px;
}

.form-label {
    display: block;
    font-size: 1rem; /* Increased from 0.9rem */
    color: var(--text-color);
    opacity: 0.8;
    margin-bottom: 8px;
    font-weight: 600; /* Made slightly bolder */
}

/* Cards & Sections */
.card, .glass {
    background-color: var(--surface-color);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-standard);
    padding: 24px;
    margin-bottom: 24px;
    backdrop-filter: blur(10px); /* Premium Glassmorphism */
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}

/* List Group Overrides for Dark Theme */
.list-group-item {
    background-color: var(--surface-color);
    color: var(--text-color);
    border-color: var(--border-gold);
}

.list-group-item-action {
    color: var(--text-color) !important;
}

.list-group-item-action:hover, .list-group-item-action:focus {
    background-color: var(--surface-tint-bg);
    color: var(--primary-color) !important;
}

.list-group-item.active {
    background-color: rgba(229, 195, 135, 0.1);
    color: var(--primary-color) !important;
    border-color: var(--primary-color);
}

.text-muted {
    color: var(--hint-color) !important;
}

/* Bottom Navigation */

/* Button Group (Selectors) Styling */

.btn-check:checked + .btn-outline-secondary {
    background-color: var(--primary-color) !important;
    color: var(--bg-color) !important;
    border-color: var(--primary-color) !important;
}

.btn-outline-secondary {
    border-color: var(--border-gold);
    color: var(--text-color) !important;
    background-color: transparent;
}

.btn-outline-secondary:hover {
    background-color: var(--surface-tint-bg);
    color: var(--text-color);
    border-color: var(--primary-color);
}

/* Desktop Sidebar Hidden on Mobile/TMA */
@media (max-width: 991px) {
    .sidebar {
        display: none !important;
    }
}

/* Validation */
.is-invalid {
    border-color: #ff3b30 !important;
}

.invalid-feedback {
    color: #ff3b30;
    font-size: 0.8rem;
    margin-top: 4px;
}

/* Stepper Adjustments for TMA (Premium & Minimalist) */
.input-group:has(.stepper-btn) {
    background-color: var(--surface-color);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-standard);
    overflow: hidden;
    padding: 2px; /* Small inner padding for premium look */
    height: var(--input-height);
    transition: var(--transition-fast);
}

.input-group:has(.stepper-btn):focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(229, 195, 135, 0.15);
}

.input-group .stepper-btn {
    width: 40px;
    height: 100%;
    background-color: transparent;
    color: var(--primary-color);
    border: none;
    border-radius: 10px !important; /* Slightly smaller than parent for spacing */
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition-fast);
}

.input-group .stepper-btn:hover {
    background-color: rgba(229, 195, 135, 0.1);
}

.input-group .stepper-btn:active {
    background-color: rgba(229, 195, 135, 0.2);
    transform: scale(0.95);
}

.input-group .form-control {
    text-align: center;
    border-radius: 0 !important;
    border: none !important;
    background: transparent !important;
    color: var(--text-color);
    font-weight: 600;
    height: 100%;
    padding: 0 4px;
    min-width: 0;
    box-shadow: none !important;
}

/* Compact version for rows */
.row .input-group .stepper-btn {
    width: 36px;
    font-size: 18px;
}

/* Glass Tabs with Icons & Text */
.glass-tabs {
    background: rgba(var(--tg-theme-secondary-bg-color, 244, 244, 245), 0.5);
    border-radius: 16px;
    padding: 4px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.glass-tabs .nav-item {
    flex: 1;
}

.glass-tabs .nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 4px;
    border-radius: 12px;
    color: var(--hint-color);
    font-size: 12px;
    font-weight: 600;
    transition: var(--transition-fast);
    border: 2px solid transparent;
    width: 100%;
}

.glass-tabs .nav-link.active {
    background-color: transparent !important;
    border-color: var(--button-color) !important;
    color: var(--button-color) !important;
}
.glass-tabs .nav-link i {
    font-size: 22px;
    margin-bottom: 4px;
}

/* Theme Toggle Button Style */
.btn-theme-toggle {
    background: var(--surface-color);
    border: 1px solid var(--border-gold);
    color: var(--primary-color);
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    padding: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-theme-toggle:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
    box-shadow: 0 6px 16px rgba(229, 195, 135, 0.2);
}

.btn-theme-toggle:active {
    transform: translateY(0);
}

.btn-theme-toggle span {
    font-size: 24px;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Modal Close Button Polishing */
.btn-close {
    opacity: 0.8 !important;
    background-size: 12px;
    transition: var(--transition-fast);
    filter: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%231B4D3E'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") !important;
}

.btn-close:hover {
    opacity: 1 !important;
    transform: rotate(90deg);
}

/* Smooth transitions for all themed elements */
.card, .glass, .form-control, .form-select, .nav-item, .nav-link, .btn, header {
    transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease, transform 0.2s ease !important;
}

/* Status Badge "Balloons" (As requested: Unified design from ABV) */
.status-badge-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 50rem !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    transition: var(--transition-fast) !important;
    white-space: nowrap !important;
}

.status-badge-primary {
    background: rgba(229, 195, 135, 0.1); 
    color: var(--primary-color) !important; 
    border: 1px solid rgba(229, 195, 135, 0.2) !important;
}

.status-badge-secondary {
    background: rgba(143, 170, 158, 0.1); 
    color: #8faa9e !important; 
    border: 1px solid rgba(143, 170, 158, 0.2) !important;
}

/* Unit Labels as Bubbles - Shared Look */
.unit-temp, .unit-vol, .unit-mass, .unit-press, .unit-len, .unit-power, .unit-bubble, .unit-static {
    display: inline-flex;
    align-items: center;
    padding: 1px 10px;
    border-radius: 50rem;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    vertical-align: middle;
    margin-left: 2px;
    font-style: normal;
    text-decoration: none !important;
}

/* Interactive Only (those with settings options) - GOLD ACCENT */
.unit-temp, .unit-vol, .unit-mass, .unit-press, .unit-len, .unit-power, .unit-bubble {
    background: #050e0c !important;
    border: 1px solid rgba(229, 195, 135, 0.7) !important;
    color: #E5C387;
    cursor: pointer;
}

.unit-temp:hover, .unit-vol:hover, .unit-mass:hover, .unit-press:hover, .unit-len:hover, .unit-power:hover, .unit-bubble:hover {
    background: rgba(229, 195, 135, 0.2);
    border-color: #E5C387;
    box-shadow: 0 0 12px rgba(229, 195, 135, 0.3);
    transform: translateY(-1px);
}

.unit-temp:active, .unit-vol:active, .unit-mass:active, .unit-press:active, .unit-len:active, .unit-power:active, .unit-bubble:active {
    transform: scale(0.92);
}

/* Static Units - NEUTRAL STYLE */
.unit-static {
    background: rgba(245, 245, 245, 0.05);
    border: 1px solid rgba(245, 245, 245, 0.15);
    color: rgba(245, 245, 245, 0.85);
    cursor: default;
}

/* Light Theme Overrides */
[data-theme="light"] .unit-temp, .light-theme .unit-temp,
[data-theme="light"] .unit-vol, .light-theme .unit-vol,
[data-theme="light"] .unit-mass, .light-theme .unit-mass,
[data-theme="light"] .unit-press, .light-theme .unit-press,
[data-theme="light"] .unit-len, .light-theme .unit-len,
[data-theme="light"] .unit-power, .light-theme .unit-power,
[data-theme="light"] .unit-bubble, .light-theme .unit-bubble {
    background: #1B4D3E !important;
    border-color: #1B4D3E !important;
    color: #F9F4E8 !important;
}

[data-theme="light"] .unit-static, .light-theme .unit-static {
    background: rgba(26, 26, 26, 0.05);
    border-color: rgba(26, 26, 26, 0.1);
    color: #1A1A1A;
}

[data-theme="light"] .unit-temp:hover, .light-theme .unit-temp:hover {
    background: rgba(27, 77, 62, 0.15);
    border-color: #1B4D3E;
    box-shadow: 0 0 12px rgba(27, 77, 62, 0.2);
}

/* Light Theme overrides for status badges */
[data-theme="light"] .status-badge-primary, .light-theme .status-badge-primary {
    background: rgba(27, 77, 62, 0.1);
    color: #1B4D3E !important;
    border: 1px solid rgba(27, 77, 62, 0.2) !important;
}

[data-theme="light"] .status-badge-secondary, .light-theme .status-badge-secondary {
    background: rgba(27, 77, 62, 0.05);
    color: #1B4D3E !important;
    opacity: 0.8;
    border: 1px solid rgba(27, 77, 62, 0.1) !important;
}

/* Unified Status Bar Container */
.status-bar-container {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    justify-content: center;
    align-items: center;
    padding: 0 4px;
    flex-wrap: wrap;
}

.btn-settings-link {
    width: 36px;
    height: 36px;
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(229, 195, 135, 0.3) !important;
    color: var(--primary-color) !important;
    background: transparent !important;
    padding: 0 !important;
    transition: var(--transition-fast) !important;
}

.btn-settings-link:hover {
    background: rgba(229, 195, 135, 0.1) !important;
    border-color: var(--primary-color) !important;
    transform: rotate(45deg);
}

/* Navigation & Dashboard Redesign (Premium Panels) */

/* Hide Tabs utility */
.hide-tabs .glass-tabs {
    display: none !important;
}

.dashboard-container {
    padding-top: 10px;
    padding-bottom: 30px;
}

.dashboard-group {
    margin-bottom: 24px;
}

.dashboard-group-title {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: 0.2em;
    margin-bottom: 12px;
    padding-left: 8px;
    text-transform: uppercase;
    opacity: 0.6;
}

/* Unified Grid Layout */
.nav-grid-layout {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 480px) {
    .nav-grid-layout {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Premium Panel Button */
.nav-panel-btn {
    background: rgba(20, 54, 47, 0.6); /* Surface Malachite with Transparency */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(229, 195, 135, 0.15);
    border-radius: 16px;
    padding: 18px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: var(--text-color);
    width: 100%;
    position: relative;
    overflow: hidden;
    height: 100%;
    min-height: 90px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.nav-panel-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(229, 195, 135, 0.05) 0%, transparent 100%);
    pointer-events: none;
}

.nav-panel-btn i {
    font-size: 28px;
    color: var(--primary-color);
    transition: transform 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.nav-panel-btn span {
    font-size: 0.8rem;
    font-weight: 600;
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: rgba(245, 245, 245, 0.95);
    line-height: 1.2;
}

.nav-panel-btn:hover {
    background: rgba(20, 54, 47, 0.85);
    border-color: rgba(229, 195, 135, 0.5);
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(229, 195, 135, 0.1);
}

.nav-panel-btn:hover i {
    transform: scale(1.1) translateY(-2px);
}

.nav-panel-btn:active {
    transform: scale(0.96) translateY(-1px);
    background: rgba(229, 195, 135, 0.1);
}

.nav-panel-btn.active {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.nav-panel-btn.active i,
.nav-panel-btn.active span {
    color: #0B241E !important; /* Backdrop color for contrast on active state */
}

/* Specialized Card Styles */
.nav-panel-btn.full-width {
    grid-column: 1 / -1;
    flex-direction: row;
    padding: 24px;
    gap: 16px;
    min-height: unset;
}

/* Modal Nav Specific Adjustments */
.nav-modal-content {
    background: rgba(11, 36, 30, 0.94) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(229, 195, 135, 0.2) !important;
    border-radius: 28px !important;
    color: var(--text-color);
}

/* Modal Form Inputs */
.modal-input {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--text-color) !important;
    border: 1px solid var(--border-gold) !important;
    border-radius: 12px !important;
    padding: 10px 14px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.modal-input:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(229, 195, 135, 0.1) !important;
    outline: none;
}

/* Luxury Table (Admin / Global) */
.table.luxury-table {
    color: var(--text-color);
    border-collapse: separate;
    border-spacing: 0;
}
.table.luxury-table th {
    color: var(--primary-color);
    border-bottom: 1px solid var(--border-gold);
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-family: 'Plus Jakarta Sans', sans-serif;
    padding: 10px 12px;
    background: transparent;
}
.table.luxury-table td {
    border-bottom: 1px solid rgba(229, 195, 135, 0.05);
    vertical-align: middle;
    font-size: 0.8rem;
    padding: 10px 12px;
    font-family: 'Montserrat', sans-serif;
}

/* Light Theme Overrides for Nav Panels & Modal */
[data-theme="light"] .nav-modal-content, .light-theme .nav-modal-content {
    background: rgba(249, 244, 232, 0.95) !important;
    border-color: rgba(27, 77, 62, 0.2) !important;
    color: #1A1A1A;
}

[data-theme="light"] .nav-panel-btn, .light-theme .nav-panel-btn {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(27, 77, 62, 0.1);
    color: #1A1A1A;
}

[data-theme="light"] .nav-panel-btn i, .light-theme .nav-panel-btn i {
    color: #1B4D3E;
}

[data-theme="light"] .nav-panel-btn span, .light-theme .nav-panel-btn span {
    color: #1A1A1A;
}

[data-theme="light"] .nav-panel-btn:hover, .light-theme .nav-panel-btn:hover {
    background: #FFFFFF;
    border-color: #1B4D3E;
    box-shadow: 0 8px 25px rgba(27, 77, 62, 0.1);
}

[data-theme="light"] .nav-panel-btn.active, .light-theme .nav-panel-btn.active {
    background: #1B4D3E !important;
    border-color: #1B4D3E !important;
}

[data-theme="light"] .nav-panel-btn.active i, .light-theme .nav-panel-btn.active i,
[data-theme="light"] .nav-panel-btn.active span, .light-theme .nav-panel-btn.active span {
    color: #F9F4E8 !important;
}

.btn-pill {
    border-radius: 50rem !important;
    padding: 12px 24px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 0.85rem;
}

/* ================================================================
   УНІФІКОВАНИЙ ХІДЕР ДОДАТКУ (.app-header)
   ================================================================ */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-gold);
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 12px;
    min-height: 56px;
}

/* Ліва частина: профіль користувача або іконка + назва */
.app-header-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.user-profile-bar {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-gold);
    cursor: pointer;
    transition: var(--transition-fast);
    max-width: 240px;
}

.user-profile-bar:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--primary-color);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--primary-gradient);
    padding: 1.5px;
    margin-right: 10px;
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 7px;
    object-fit: cover;
    border: 1px solid rgba(0,0,0,0.1);
}

.user-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.user-name {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-tg {
    font-size: 0.65rem;
    color: var(--primary-color);
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-header-icon {
    font-size: 24px;
    color: var(--primary-color);
    flex-shrink: 0;
}

.app-header-name {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.02em;
}

/* Права частина: кнопки */
.app-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Кнопка хідера */
.hdr-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-gold);
    color: var(--primary-color);
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
    padding: 0;
    font-size: 0;
}

.hdr-btn:hover {
    background: rgba(229, 195, 135, 0.1);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.hdr-btn:active {
    transform: scale(0.95);
}

.hdr-btn .material-symbols-rounded {
    font-size: 20px;
}

/* ================================================================
   ХЛІБНІ КРИХТИ (#breadcrumb-nav)
   ================================================================ */
#breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 16px;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-gold);
    min-height: 36px;
    overflow-x: auto;
    scrollbar-width: none;
}

#breadcrumb-nav::-webkit-scrollbar { display: none; }

/* Іконка Дому */
.bc-home {
    display: flex;
    align-items: center;
    color: var(--primary-color);
    opacity: 0.7;
    transition: opacity 0.2s;
    flex-shrink: 0;
    text-decoration: none;
}

.bc-home:hover { opacity: 1; }

.bc-home .material-symbols-rounded { font-size: 18px; }

/* Роздільник > */
.bc-sep {
    font-size: 14px;
    color: var(--hint-color);
    opacity: 0.4;
    flex-shrink: 0;
}

/* Елемент крихти */
.bc-item {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    text-decoration: none;
    color: var(--hint-color);
    transition: color 0.2s;
}

.bc-item:not(.bc-current):hover { color: var(--primary-color); }

/* Активний (поточний) елемент */
.bc-current {
    color: var(--primary-color);
    opacity: 1;
}

/* ================================================================
   CABINET SPECIFIC STYLES (UI/UX)
   ================================================================ */

/* Tabs System (Bottom Navigation) */
.luxury-tabs {
    position: fixed;
    bottom: var(--safe-area-bottom, 0);
    left: 0;
    right: 0;
    background: var(--surface-color);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-gold);
    display: flex;
    justify-content: space-around;
    padding: 0.75rem 0.5rem calc(0.75rem + var(--safe-area-bottom, 0));
    z-index: 2000;
}

.luxury-tab-btn {
    background: none;
    border: none;
    color: var(--hint-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 10px;
    font-weight: 600;
    transition: var(--transition-fast);
    position: relative;
    padding: 0 5px;
    text-decoration: none;
}

.luxury-tab-btn .material-symbols-rounded {
    font-size: 24px;
    margin-bottom: 4px;
    transition: transform 0.3s;
}

.luxury-tab-btn.active {
    color: var(--primary-color);
}

.luxury-tab-btn.active .material-symbols-rounded {
    font-variation-settings: 'FILL' 1;
    transform: translateY(-4px);
}

.tab-content {
    padding: 1.5rem 1rem;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.tab-pane.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Specific Cards & Stats */
.stat-card {
    background: var(--surface-color);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-standard);
    padding: 1.25rem;
    height: 100%;
}

.luxury-card {
    background: var(--surface-color);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-standard);
    transition: transform 0.2s;
    overflow: hidden;
}

/* Settings UI */
.settings-group {
    margin-bottom: 2rem;
}

.settings-item {
    background: var(--surface-color);
    border-radius: var(--radius-standard);
    padding: 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-gold);
}

.luxury-toggle-group {
    display: flex;
    background: rgba(0,0,0,0.2);
    padding: 4px;
    border-radius: var(--radius-standard);
}

.luxury-toggle-item {
    flex: 1;
    padding: 8px 12px;
    text-align: center;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--hint-color);
}

.luxury-toggle-item.active {
    background: var(--primary-gradient);
    color: var(--bg-color) !important;
    box-shadow: 0 2px 8px rgba(229, 195, 135, 0.3);
}

/* Constructor & Assembly */
.assembly-preview {
    background: rgba(0,0,0,0.2);
    border-radius: var(--radius-standard);
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-gold);
}

/* Tables & Catalog Enhancements */
.catalog-table {
    width: 100%;
    color: var(--text-color);
}

.catalog-table th {
    background: rgba(0,0,0,0.2) !important;
    color: var(--primary-color) !important;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 10px;
    border-bottom: 1px solid var(--border-gold) !important;
}

.catalog-table td {
    border-bottom: 1px solid var(--border-gold) !important;
    font-size: 13px;
    padding: 10px;
    white-space: nowrap;
}

.data-plaque {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
}

.filter-chip {
    padding: 4px 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-gold);
    font-size: 12px;
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
}

.filter-chip.active {
    background: var(--primary-color);
    color: var(--bg-color);
    border-color: var(--primary-color);
}

/* Premium UI Buttons and Elements from Styleguide */
.btn-premium-gold {
  background: var(--primary-gradient);
  color: var(--bg-color) !important;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.15);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-standard);
  transition: var(--transition-fast);
}
.btn-premium-gold:hover {
  box-shadow: 0 10px 20px rgba(212, 175, 55, 0.2);
  transform: translateY(-1px);
}
.btn-premium-outline {
  border: 1px solid var(--border-gold);
  background: transparent;
  color: var(--text-color);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  border-radius: var(--radius-standard);
  transition: var(--transition-fast);
}
.btn-premium-outline:hover {
  border-color: var(--primary-color);
  background: var(--glass-hover);
}
.btn-premium-danger {
  background: var(--color-danger);
  color: #fff !important;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-standard);
  transition: var(--transition-fast);
}
.btn-premium-danger:hover {
  opacity: 0.9;
}

.icon-btn {
  background: transparent;
  border: none;
  padding: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--primary-color);
  transition: var(--transition-fast);
}
.icon-btn:hover {
  color: var(--text-color);
  transform: scale(1.1);
}

.modal-premium .modal-content {
  background: var(--surface-color);
  border: 1px solid var(--border-gold);
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
.modal-premium .modal-header {
  border-bottom: 1px solid rgba(229, 195, 135, 0.1);
}
.modal-premium .modal-footer {
  border-top: 1px solid rgba(229, 195, 135, 0.1);
}
.modal-premium .modal-title {
  color: var(--primary-color);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
}

