/* ==========================================================================
   RENT A CAR CRM & RISK MANAGEMENT SYSTEM - DESIGN SYSTEM & STYLES
   ========================================================================== */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@400;700&family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    /* Color Palette - Premium Sleek Dark Theme & HSL Tokens */
    --bg-main: #0b0f19;
    --bg-card: rgba(22, 30, 49, 0.7);
    --bg-card-hover: rgba(30, 41, 67, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(56, 189, 248, 0.3);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --primary: #38bdf8;          /* Light Sky Blue */
    --primary-glow: rgba(56, 189, 248, 0.15);
    --secondary: #a78bfa;        /* Purple */
    
    /* Dynamic Vehicle Status Color Codes */
    --status-bosta: #10b981;      /* Green */
    --status-kirada: #0284c7;     /* Blue */
    --status-rezerve: #f59e0b;    /* Yellow/Amber */
    --status-bakimda: #ef4444;    /* Red */
    --status-satildi: #64748b;    /* Gray */
    
    --warning: #ef4444;
    --success: #10b981;
    --info: #0ea5e9;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 18px;
    --border-radius-full: 9999px;
}

/* Global Reset & Base Styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.5;
    overflow-x: hidden;
    background-image: 
        radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(167, 139, 250, 0.05) 0px, transparent 50%);
    background-attachment: fixed;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* Layout Framework */
.app-container {
    display: none; /* hidden until JS sets .app-visible */
    width: 100%;
    min-height: 100vh;
    background-color: var(--bg-main);
}

/* When user is logged in, JS adds .app-visible — CSS decides flex vs block per breakpoint */
.app-container.app-visible {
    display: flex; /* desktop default — overridden to block by mobile media query */
}

.app-container[style*="display: none"],
.app-container[style*="display:none"] {
    display: none !important;
}

.app-container[style*="display: none"] *,
.app-container[style*="display:none"] * {
    display: none !important;
}

/* 🏢 Left Sidebar Navigation Styling */
.sidebar {
    background: rgba(11, 15, 25, 0.95);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(20px);
}

.sidebar .brand-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 1.5rem;
}

.brand-logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--bg-main);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

.brand-name {
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(to right, var(--text-primary), #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--border-radius-md);
    margin-bottom: 1.5rem;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.nav-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-group-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding-left: 0.75rem;
    margin-bottom: 0.5rem;
}

.nav-item {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    text-align: left;
    padding: 0.7rem 0.75rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: var(--transition-fast);
    width: 100%;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--primary-glow);
    border-color: rgba(56, 189, 248, 0.25);
    color: var(--primary);
    font-weight: 600;
}

.sidebar-footer {
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 1rem;
}

.btn-logout {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
    color: #ef4444;
    padding: 0.7rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition-fast);
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
}

/* Mobile-only: hidden by default, shown only via media query */
.mobile-header {
    display: none !important;
}

/* mobile-tabs-bar PERMANENTLY removed — navigation via sidebar drawer only */
.mobile-tabs-bar,
.mobile-tab-btn {
    display: none !important;
}


.mobile-role-bar {
    display: none;
}

/* 🖥️ Workspace Area */
.workspace {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
}

.workspace-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    background: rgba(11, 15, 25, 0.6);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 99;
}

.workspace-title-area h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.workspace-actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

/* RBAC Switcher styling */
.role-switcher-container {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    padding: 0.25rem;
    border-radius: var(--border-radius-full);
}

.role-btn {
    background: transparent;
    border: none;
    padding: 0.5rem 1.25rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-radius: var(--border-radius-full);
    cursor: pointer;
    transition: var(--transition-fast);
}

.role-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--bg-main);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.2);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-left: 1.5rem;
    border-left: 1px solid var(--border-color);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius-full);
    background: #334155;
    border: 2px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.profile-info {
    font-size: 0.85rem;
}

.profile-name {
    font-weight: 600;
    color: var(--text-primary);
}

.profile-role {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* Main Workspace */
.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

/* Quick KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--status-color, var(--primary));
}

.kpi-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-highlight);
    background: var(--bg-card-hover);
    box-shadow: 0 12px 20px -8px rgba(0, 0, 0, 0.5);
}

.kpi-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.kpi-value {
    font-size: 2.2rem;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.kpi-subtext {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Status-specific coloring helper classes */
.kpi-bosta { --status-color: var(--status-bosta); }
.kpi-kirada { --status-color: var(--status-kirada); }
.kpi-rezerve { --status-color: var(--status-rezerve); }
.kpi-bakimda { --status-color: var(--status-bakimda); }
.kpi-warn { --status-color: var(--warning); }

/* Dashboard Widgets Split Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.widget-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.widget-title {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Tab Navigation buttons */
.tabs-navigation {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    overflow-x: auto;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.6rem 1.2rem;
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: var(--border-radius-md);
    transition: var(--transition-fast);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
    color: var(--primary);
    background: var(--primary-glow);
    border: 1px solid rgba(56, 189, 248, 0.2);
}

/* Tab contents and switching */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

/* Custom Table Design */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.88rem;
}

.data-table th {
    background: rgba(15, 23, 42, 0.6);
    color: var(--text-secondary);
    padding: 0.85rem 1rem;
    font-weight: 600;
    font-family: var(--font-heading);
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Sticky Column Styling for Timeline Calendar */
.sticky-col {
    position: sticky;
    left: 0;
    z-index: 5;
    box-shadow: 2px 0 5px rgba(0,0,0,0.25);
}

/* Badge styling */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: var(--border-radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-bosta { background: rgba(16, 185, 129, 0.15); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-kirada { background: rgba(2, 132, 199, 0.15); color: #38bdf8; border: 1px solid rgba(2, 132, 199, 0.2); }
.badge-rezerve { background: rgba(245, 158, 11, 0.15); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.2); }
.badge-bakimda { background: rgba(239, 68, 68, 0.15); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.2); }
.badge-satildi { background: rgba(100, 116, 139, 0.15); color: #94a3b8; border: 1px solid rgba(100, 116, 139, 0.2); }

.badge-gelir { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.badge-gider { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.badge-danger { background: rgba(239, 68, 68, 0.25); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.35); }

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); box-shadow: 0 0 10px rgba(239, 68, 68, 0.4); }
    100% { transform: scale(1); }
}

/* Interactive Vehicle Damage Matrix styling */
.damage-matrix-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .damage-matrix-layout {
        grid-template-columns: 1fr;
    }
}

.car-diagram-container {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.car-svg-wrapper {
    width: 100%;
    max-width: 420px;
    height: auto;
    position: relative;
}

/* SVG interactive paths and dots */
.damage-part {
    fill: rgba(255, 255, 255, 0.05);
    stroke: rgba(255, 255, 255, 0.3);
    stroke-width: 1.5;
    cursor: pointer;
    transition: var(--transition-fast);
}

.damage-part:hover {
    fill: rgba(56, 189, 248, 0.2);
    stroke: var(--primary);
}

.damage-part.selected {
    fill: rgba(239, 68, 68, 0.3);
    stroke: #ef4444;
}

.damage-indicator-dot {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #ef4444;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 0 10px #ef4444;
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: pulse 1.5s infinite;
}

/* Form Styles */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    box-sizing: border-box;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 0.6rem 0.8rem;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.88rem;
    outline: none;
    transition: var(--transition-fast);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--bg-main);
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: var(--border-radius-sm);
    font-family: var(--font-heading);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    opacity: 0.95;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    background: #475569;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Blacklist Alert Panel (Red Box) */
.blacklist-alert-box {
    background: rgba(220, 38, 38, 0.12);
    border: 1px solid rgba(220, 38, 38, 0.3);
    border-radius: var(--border-radius-md);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    display: none;
    animation: shake 0.4s ease;
}

.blacklist-alert-title {
    color: #f87171;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.blacklist-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.blacklist-detail-item span {
    color: var(--text-secondary);
}

.blacklist-detail-item strong {
    color: #f87171;
}

/* File upload mock display */
.file-upload-mock {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    text-align: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.file-upload-mock:hover {
    border-color: var(--primary);
    color: var(--text-primary);
}

/* Visual Schema Explorer Styling */
.schema-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
    height: 600px;
}

.schema-sidebar {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 1rem;
    overflow-y: auto;
}

.schema-table-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 0.25rem;
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 0.88rem;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.schema-table-item:hover, .schema-table-item.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.schema-table-item.active {
    border-left: 3px solid var(--primary);
}

.schema-viewer-body {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 1.5rem;
    overflow-y: auto;
    position: relative;
}

.sql-code-block {
    background: #090d16;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    white-space: pre-wrap;
    border: 1px solid var(--border-color);
}

/* SVG Chart styling */
.chart-container {
    height: 200px;
    width: 100%;
    position: relative;
    margin-top: 1rem;
}

.line-chart-svg {
    width: 100%;
    height: 100%;
}

.chart-grid-line {
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 1;
}

.chart-line {
    fill: none;
    stroke: var(--primary);
    stroke-width: 3;
    stroke-linecap: round;
    animation: drawPath 2s ease-out;
}

.chart-area {
    fill: url(#chart-gradient);
    opacity: 0.15;
}

.chart-dot {
    fill: var(--primary);
    stroke: var(--bg-main);
    stroke-width: 2;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.chart-dot:hover {
    transform: scale(1.5);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

@keyframes drawPath {
    from { stroke-dasharray: 1000; stroke-dashoffset: 1000; }
    to { stroke-dashoffset: 0; }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Responsive Custom Utilities */
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-info { color: var(--info); }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.text-right { text-align: right; }

.branch-selector {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 0.35rem 0.75rem;
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: var(--font-heading);
    outline: none;
}

/* Toast Notifications Container */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

/* Glassmorphic Toast Design */
.toast {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    font-family: var(--font-body);
    min-width: 320px;
    max-width: 450px;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.toast-success {
    border-left: 4px solid var(--success);
}

.toast-danger {
    border-left: 4px solid var(--warning);
}

.toast-warning {
    border-left: 4px solid var(--status-rezerve);
}

.toast-info {
    border-left: 4px solid var(--primary);
}

.toast-icon {
    font-size: 1.2rem;
}

.toast-content {
    flex: 1;
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    padding: 0.25rem;
}

.toast-close:hover {
    color: var(--text-primary);
}

/* ============================================================
   NOTIFICATION BELL & PANEL SYSTEM
   ============================================================ */

.notif-bell-wrapper {
    position: relative;
}

.notif-bell-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.notif-bell-btn:hover {
    background: var(--primary-glow);
    border-color: var(--border-highlight);
    color: var(--primary);
}

.notif-bell-btn.has-alerts {
    color: var(--primary);
    border-color: rgba(56, 189, 248, 0.4);
    animation: bellShake 1.5s ease-in-out infinite;
}

@keyframes bellShake {
    0%, 100% { transform: rotate(0deg); }
    10%, 30%, 50% { transform: rotate(-8deg); }
    20%, 40% { transform: rotate(8deg); }
    60% { transform: rotate(0deg); }
}

.notif-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-main);
    line-height: 1;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
    50% { box-shadow: 0 0 0 6px rgba(239,68,68,0); }
}

.notif-panel {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 380px;
    max-height: 480px;
    background: rgba(12, 18, 35, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: var(--border-radius-md);
    box-shadow: 0 20px 60px rgba(0,0,0,0.7), 0 0 30px rgba(56,189,248,0.05);
    z-index: 9000;
    overflow: hidden;
    animation: panelSlideIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes panelSlideIn {
    from { opacity: 0; transform: translateY(-10px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.notif-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: rgba(56, 189, 248, 0.04);
}

.notif-panel-title {
    font-weight: 700;
    font-size: 0.9rem;
    font-family: var(--font-heading);
    color: var(--text-primary);
}

.notif-clear-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.7rem;
    padding: 0.25rem 0.6rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    font-family: var(--font-body);
}

.notif-clear-btn:hover {
    border-color: var(--warning);
    color: var(--warning);
}

.notif-panel-body {
    overflow-y: auto;
    max-height: 400px;
}

.notif-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--text-muted);
    gap: 0.5rem;
    font-size: 0.85rem;
}

/* Individual notification item card inside the panel */
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background var(--transition-fast);
    cursor: default;
}

.notif-item:hover {
    background: rgba(255,255,255,0.03);
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-item-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.notif-item-content {
    flex: 1;
}

.notif-item-title {
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.notif-item-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.notif-item-time {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.notif-item-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 0.1rem;
}

.notif-badge-danger { background: rgba(239,68,68,0.15); color: #ef4444; border: 1px solid rgba(239,68,68,0.3); }
.notif-badge-warning { background: rgba(245,158,11,0.15); color: #f59e0b; border: 1px solid rgba(245,158,11,0.3); }
.notif-badge-info { background: rgba(56,189,248,0.12); color: #38bdf8; border: 1px solid rgba(56,189,248,0.25); }
.notif-badge-success { background: rgba(16,185,129,0.12); color: #10b981; border: 1px solid rgba(16,185,129,0.25); }

/* Pulse ring on bell when alerts present */
.notif-bell-btn.has-alerts::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 10px;
    border: 1.5px solid rgba(56,189,248,0.3);
    animation: ringExpand 2s ease-out infinite;
}

@keyframes ringExpand {
    0% { opacity: 0.8; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.5); }
}

/* ============================================================
   MODAL DIALOG OVERLAYS
   ============================================================ */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none; /* Hidden by default! JS sets display flex inline to show it. */
    justify-content: center;
    align-items: center;
    z-index: 20000; /* Must overlay on top of sidebar and notification bell */
    padding: 1.5rem;
}

.modal-card {
    background: rgba(22, 30, 49, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-highlight);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 40px rgba(56, 189, 248, 0.1);
    animation: modalScaleIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes modalScaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-heading);
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.modal-close-btn:hover {
    color: #ef4444;
}

/* ============================================================
   MASTER RESPONSIVE SYSTEM — SINGLE SOURCE OF TRUTH
   Desktop: sidebar fixed left + workspace right
   Mobile:  sidebar drawer + sticky top bar + sticky tabs bar
   ============================================================ */

/* ─── MOBILE-ONLY ELEMENTS: hidden by default ─── */
.mobile-header {
    display: none;
}
/* mobile-tabs-bar permanently hidden */
.mobile-tabs-bar,
.mobile-tab-btn {
    display: none !important;
}


/* ─── DESKTOP (≥ 1025px) ─── */
@media (min-width: 1025px) {
    /* App shell — only when logged in */
    .app-container.app-visible {
        display: flex !important;
        width: 100% !important;
        min-height: 100vh !important;
    }

    /* Sidebar pinned to left */
    .sidebar {
        position: fixed !important;
        inset: 0 auto 0 0 !important;
        width: 260px !important;
        height: 100vh !important;
        overflow-y: auto !important;
        z-index: 200 !important;
        flex-shrink: 0 !important;
    }

    /* Workspace fills remaining space */
    .workspace {
        margin-left: 260px !important;
        width: calc(100% - 260px) !important;
        min-height: 100vh !important;
        display: flex !important;
        flex-direction: column !important;
        overflow-x: hidden !important;
    }

    /* Desktop header visible */
    .workspace-header {
        display: flex !important;
    }

    /* Hide all mobile-only elements */
    .mobile-header,
    .mobile-tabs-bar,
    .mobile-tab-btn,
    .sidebar-overlay {
        display: none !important;
    }
}

/* ─── MOBILE & TABLET (≤ 1024px) ─── */
@media (max-width: 1024px) {

    /* ── Shell reset — only when logged in ── */
    .app-container.app-visible {
        display: block !important;
        width: 100vw !important;
        overflow-x: hidden !important;
    }

    .workspace {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        margin-left: 0 !important;
        min-height: 100vh !important;
        overflow-x: hidden !important;
        padding: 0 !important;
    }

    /* ── Desktop header hidden on mobile ── */
    .workspace-header {
        display: none !important;
    }

    /* ── Sidebar: off-screen drawer ── */
    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: -290px !important;
        width: 280px !important;
        height: 100% !important;
        overflow-y: auto !important;
        z-index: 1001 !important;
        background: rgba(11, 15, 25, 0.98) !important;
        border-right: 1px solid var(--border-color) !important;
        transition: left 0.28s ease !important;
        box-shadow: none !important;
    }

    .sidebar.active {
        left: 0 !important;
        box-shadow: 8px 0 32px rgba(0,0,0,0.7) !important;
    }

    /* ── Overlay backdrop ── */
    .sidebar-overlay {
        display: none;
        position: fixed !important;
        inset: 0 !important;
        background: rgba(0,0,0,0.6) !important;
        backdrop-filter: blur(3px) !important;
        z-index: 1000 !important;
    }

    .sidebar-overlay.active {
        display: block !important;
    }

    /* ── Mobile top header (50px, always sticky) ── */
    .mobile-header {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 0 1rem !important;
        height: 50px !important;
        background: rgba(11, 15, 25, 0.97) !important;
        border-bottom: 1px solid var(--border-color) !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 999 !important;
        backdrop-filter: blur(16px) !important;
        -webkit-backdrop-filter: blur(16px) !important;
        flex-shrink: 0 !important;
        box-sizing: border-box !important;
    }

    .mobile-menu-btn {
        background: transparent !important;
        border: none !important;
        color: var(--text-primary) !important;
        font-size: 1.4rem !important;
        cursor: pointer !important;
        padding: 0.2rem 0.4rem !important;
        line-height: 1 !important;
    }


    /* ── Mobile tabs bar REMOVED — sidebar drawer only ── */
    .mobile-tabs-bar,
    .mobile-tab-btn {
        display: none !important;
    }


    /* ── Main content padding ── */
    .main-content {
        padding: 0.75rem !important;
        box-sizing: border-box !important;
        width: 100% !important;
    }

    .tab-content {
        padding: 0.75rem !important;
        box-sizing: border-box !important;
        width: 100% !important;
        overflow-x: hidden !important;
    }

    /* ── KPI grid: 2 columns ── */
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
        margin-bottom: 0.85rem !important;
    }

    .kpi-card {
        padding: 0.75rem !important;
    }

    .kpi-value {
        font-size: 1.4rem !important;
    }

    .kpi-label {
        font-size: 0.72rem !important;
    }

    .kpi-subtext {
        font-size: 0.65rem !important;
    }

    /* ── Dashboard & form grids: single column ── */
    .dashboard-grid,
    .form-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    /* ── Widget cards ── */
    .widget-card {
        padding: 0.85rem !important;
    }

    .widget-header {
        flex-wrap: wrap !important;
        gap: 0.4rem !important;
        padding-bottom: 0.6rem !important;
        margin-bottom: 0.75rem !important;
    }

    .widget-title {
        font-size: 0.95rem !important;
    }

    /* ── Tables: horizontal scroll ── */
    .table-wrapper {
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        border-radius: 10px !important;
    }

    .data-table {
        min-width: 640px !important;
        font-size: 0.77rem !important;
        width: 100% !important;
    }

    .data-table th,
    .data-table td {
        padding: 0.5rem 0.65rem !important;
        white-space: nowrap !important;
    }

    /* ── Modals ── */
    .modal-backdrop {
        padding: 0.4rem !important;
    }

    .modal-card {
        width: 96vw !important;
        max-width: 96vw !important;
        max-height: 90vh !important;
        margin: 1rem auto !important;
        overflow-y: auto !important;
        padding: 1rem !important;
        box-sizing: border-box !important;
    }

    /* ── Notifications panel ── */
    .notif-panel {
        position: fixed !important;
        top: 95px !important;
        left: 3% !important;
        right: 3% !important;
        width: 94% !important;
        max-width: 500px !important;
        z-index: 1010 !important;
    }

    /* ── Inline flex/grid wrappers from style attributes ── */
    .flex-between {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }

    /* ── Responsive Grid Splits (Form vs List / Form vs Console) ── */
    .responsive-grid-split {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    /* ── Reservations & Rentals Tab Responsiveness (≤ 1024px) ── */
    #reservations-tab .timeline-container {
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        border-radius: var(--border-radius-sm);
    }

    #reservations-tab .tabs-navigation {
        flex-direction: row !important;
        gap: 0.35rem !important;
    }

    #reservations-tab .tabs-navigation .tab-btn {
        font-size: 0.75rem !important;
        padding: 0.35rem 0.5rem !important;
        white-space: nowrap !important;
    }

    #reservations-tab form .form-grid {
        grid-template-columns: 1fr !important;
        gap: 0.65rem !important;
    }

    #reservations-tab input[type="datetime-local"] {
        font-size: 0.8rem !important;
    }

    /* ── Customers Tab Responsiveness (≤ 1024px) ── */
    #customers-tab .form-grid {
        grid-template-columns: 1fr !important;
        gap: 0.65rem !important;
    }

    #customers-tab .data-table {
        min-width: 600px !important;
    }
}

/* ─── SMALL PHONES (≤ 480px) ─── */
@media (max-width: 480px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.4rem !important;
    }

    .kpi-card {
        padding: 0.6rem !important;
    }

    .kpi-value {
        font-size: 1.2rem !important;
    }

    .main-content,
    .tab-content {
        padding: 0.4rem !important;
    }

    .widget-card {
        padding: 0.65rem !important;
    }

    .modal-card {
        padding: 0.75rem !important;
    }

    /* Finance summary: 3 equal columns */
    #admin-analytics-widget .flex-between {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.35rem !important;
        text-align: center !important;
    }

    #admin-analytics-widget .kpi-value {
        font-size: 0.95rem !important;
    }

    /* Small phone specifics for Reservations & Customers */
    #reservations-tab .tabs-navigation .tab-btn {
        font-size: 0.68rem !important;
        padding: 0.3rem 0.4rem !important;
    }

    #customers-tab button {
        font-size: 0.75rem !important;
    }
}
/* end of stylesheet */

