/* ==========================================================================
   Pups' Valley Labor Lens Design System
   ========================================================================== */

/* Design Tokens & CSS Variables */
:root {
    /* Font Families */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Sleek Color Palette (Dark Theme / Pet Accents) */
    --bg-app: #080d1a;
    --bg-sidebar: #0b1324;
    --bg-glass: rgba(18, 30, 54, 0.55);
    --bg-glass-hover: rgba(26, 44, 78, 0.7);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-focus: rgba(20, 184, 166, 0.4);
    
    /* Semantic Colors (HSL tailored) */
    --color-teal: hsl(172, 75%, 45%);
    --color-teal-glow: rgba(20, 184, 166, 0.15);
    --color-amber: hsl(38, 95%, 55%);
    --color-amber-glow: rgba(245, 158, 11, 0.15);
    --color-coral: hsl(354, 85%, 56%);
    --color-coral-glow: rgba(239, 68, 68, 0.15);
    --color-blue: hsl(210, 90%, 55%);
    --color-blue-glow: rgba(59, 130, 246, 0.15);
    --color-green: hsl(142, 70%, 45%);
    
    /* Text Colors */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-dark: #0f172a;
    
    /* Standard Layout & Spacing */
    --sidebar-width: 280px;
    --border-radius-lg: 16px;
    --border-radius-md: 10px;
    --border-radius-sm: 6px;
    --shadow-premium: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(255, 255, 255, 0.05) inset;
    
    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base resets */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-app);
    background-image: 
        radial-gradient(at 10% 20%, rgba(20, 184, 166, 0.06) 0px, transparent 50%),
        radial-gradient(at 90% 80%, rgba(239, 68, 68, 0.05) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(59, 130, 246, 0.03) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* App Container Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100vw;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ==========================================================================
   Sidebar Styling
   ========================================================================== */
.app-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-branding {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
    padding-left: 8px;
}

.brand-logo-img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--border-glass);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    background-color: #ffffff; /* Contrast buffer for white logo circle background */
}

.logo-container {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--color-teal), var(--color-blue));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.3);
}

.logo-icon {
    width: 22px;
    height: 22px;
    color: var(--text-primary);
}

.brand-name {
    display: block;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: -0.2px;
}

.app-title {
    display: block;
    font-size: 11px;
    color: var(--color-teal);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
    margin-top: -2px;
}

.week-selector-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius-md);
    padding: 12px;
    margin-bottom: 24px;
}

.selector-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.selector-label i {
    width: 13px;
    height: 13px;
}

.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.week-select-dropdown {
    width: 100%;
    background: var(--bg-app);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    padding: 8px 12px;
    outline: none;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.week-select-dropdown:focus {
    border-color: var(--color-teal);
}

/* Sidebar Navigation Items */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 12px 14px;
    border-radius: var(--border-radius-md);
    text-align: left;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    width: 100%;
    outline: none;
}

.nav-item i {
    width: 18px;
    height: 18px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    transform: translateX(4px);
}

.nav-item.active {
    background: var(--color-teal-glow);
    color: var(--color-teal);
    border-left: 3px solid var(--color-teal);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid var(--border-glass);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--color-teal-glow), var(--bg-app));
    border: 1px solid var(--color-teal);
    color: var(--color-teal);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-family: var(--font-heading);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
}

/* ==========================================================================
   Main Content Structure
   ========================================================================== */
.app-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 32px 40px;
    overflow-y: auto;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.header-title-area h1 {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 26px;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.header-subtitle {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 4px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.date-badge {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    padding: 8px 14px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.date-badge i {
    width: 14px;
    height: 14px;
    color: var(--color-teal);
}

/* Glassmorphism Card Core Component */
.glass-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-premium);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.glass-card:hover {
    background: var(--bg-glass-hover);
}

/* Tabs Display Toggle */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.tab-content.active-tab {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Tab 1: Dashboard Elements
   ========================================================================== */

/* KPI Scorecard Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-premium);
    padding: 20px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: transparent;
    transition: var(--transition-fast);
}

.kpi-card:hover {
    transform: translateY(-4px);
    background: var(--bg-glass-hover);
}

/* Active status indicator stripes on cards */
.kpi-card:hover::before {
    background: currentColor;
}

.kpi-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.kpi-label {
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.kpi-icon-wrapper {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-icon-wrapper i {
    width: 16px;
    height: 16px;
}

.color-teal { background: var(--color-teal-glow); color: var(--color-teal); }
.color-amber { background: var(--color-amber-glow); color: var(--color-amber); }
.color-coral { background: var(--color-coral-glow); color: var(--color-coral); }
.color-blue { background: var(--color-blue-glow); color: var(--color-blue); }

.kpi-value-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 12px;
}

.kpi-value {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 28px;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

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

.kpi-status-badge {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success { background: rgba(34, 197, 94, 0.15); color: var(--color-green); }
.badge-warning { background: var(--color-amber-glow); color: var(--color-amber); }
.badge-danger { background: var(--color-coral-glow); color: var(--color-coral); }

.kpi-progress-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.progress-bar-bg {
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    width: 100%;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fill-teal { background: var(--color-teal); }
.fill-amber { background: var(--color-amber); }
.fill-coral { background: var(--color-coral); }
.fill-blue { background: var(--color-blue); }

.kpi-target-label {
    font-size: 10px;
    color: var(--text-muted);
}

/* Dashboard Layout Subpanels */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.dashboard-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Chart Panel Layout */
.chart-card {
    padding: 24px;
}

.card-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.card-title-row h3, .chart-card h3 {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: -0.1px;
}

.chart-legend-indicator {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.bg-teal { background: var(--color-teal); }
.bg-coral { background: var(--color-coral); }

.chart-container {
    position: relative;
    height: 260px;
    width: 100%;
}

.charts-subgrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.charts-subgrid .chart-container {
    height: 200px;
}

/* Advisory Insights Feed styling */
.alerts-card {
    padding: 24px;
}

.card-header-badge {
    background: rgba(20, 184, 166, 0.1);
    color: var(--color-teal);
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
    border: 1px solid rgba(20, 184, 166, 0.2);
}

.panel-desc {
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: 4px;
    margin-bottom: 16px;
}

.alerts-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 380px;
    overflow-y: auto;
    padding-right: 4px;
}

.alert-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    color: var(--text-secondary);
    justify-content: center;
    font-size: 12px;
}

.loading-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.1);
    border-top: 2px solid var(--color-teal);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.advisory-item {
    border-radius: var(--border-radius-md);
    padding: 14px;
    border-left: 3px solid transparent;
    animation: alertSlide 0.3s ease-out;
}

@keyframes alertSlide {
    from { opacity: 0; transform: translateX(8px); }
    to { opacity: 1; transform: translateX(0); }
}

.advisory-item.advice-danger {
    background: rgba(239, 68, 68, 0.04);
    border-color: var(--color-coral);
}
.advisory-item.advice-warning {
    background: rgba(245, 158, 11, 0.04);
    border-color: var(--color-amber);
}
.advisory-item.advice-success {
    background: rgba(34, 197, 94, 0.04);
    border-color: var(--color-green);
}
.advisory-item.advice-info {
    background: rgba(59, 130, 246, 0.04);
    border-color: var(--color-blue);
}

.advisory-header-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 12px;
    margin-bottom: 6px;
}

.advice-danger .advisory-header-row { color: var(--color-coral); }
.advice-warning .advisory-header-row { color: var(--color-amber); }
.advice-success .advisory-header-row { color: var(--color-green); }
.advice-info .advisory-header-row { color: var(--color-blue); }

.advisory-header-row i {
    width: 14px;
    height: 14px;
}

.advisory-body {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Weekly P&L Widget */
.stats-widget-card {
    padding: 20px;
}

.stat-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
}

.stat-val {
    font-weight: 600;
    color: var(--text-primary);
}

.stat-row.highlight {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    padding: 10px;
    border-radius: var(--border-radius-sm);
    margin: 4px 0;
}

.stat-row.highlight .stat-lbl {
    font-weight: 600;
    color: var(--text-primary);
}

.stat-row.highlight .stat-val {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 15px;
}

.text-success { color: var(--color-green) !important; }
.text-danger { color: var(--color-coral) !important; }

/* ==========================================================================
   Tab 2: Spreadsheet Tracker Grid
   ========================================================================== */
.tracker-controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.control-info-text {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.control-info-text i {
    width: 12px;
    height: 12px;
}

.spreadsheet-container {
    overflow: hidden;
    padding: 0;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.spreadsheet-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.spreadsheet-table th {
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-glass);
    padding: 14px 12px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.spreadsheet-table td {
    padding: 10px 12px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
    vertical-align: middle;
}

.spreadsheet-table tbody tr {
    transition: background-color var(--transition-fast);
}

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

/* Spreadsheet Columns Spec */
.col-day {
    font-weight: 600;
    color: var(--text-primary);
    width: 90px;
}
.col-input {
    width: 110px;
}
.col-calc {
    font-family: var(--font-body);
    font-weight: 500;
    width: 110px;
}
.col-status {
    width: 160px;
}

.text-right { text-align: right; }
.text-center { text-align: center; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.color-teal-text { color: var(--color-teal); }
.color-coral-text { color: var(--color-coral); }

/* Premium Inline Editor cells */
.editable-cell-input {
    width: 100%;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: var(--border-radius-sm);
    text-align: right;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    outline: none;
    transition: var(--transition-fast);
}

.editable-cell-input:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.15);
}

.editable-cell-input:focus {
    background: var(--bg-app);
    border-color: var(--color-teal);
    box-shadow: 0 0 0 3px var(--color-teal-glow);
}

/* Hide spin arrows in inputs */
.editable-cell-input::-webkit-outer-spin-button,
.editable-cell-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.editable-cell-input[type=number] {
    -moz-appearance: textfield;
}

/* Spreadsheet Footers */
.spreadsheet-footer-totals td {
    background: rgba(255, 255, 255, 0.03);
    border-top: 1.5px solid var(--border-glass);
    border-bottom: 1px solid var(--border-glass);
    padding: 14px 12px;
}

.spreadsheet-footer-averages td {
    background: rgba(255, 255, 255, 0.01);
    border-bottom: none;
    padding: 10px 12px;
}

/* Daily Status Badges */
.status-badge-outline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    border: 1px solid transparent;
}

.status-badge-outline.status-optimal {
    background: rgba(34, 197, 94, 0.06);
    color: var(--color-green);
    border-color: rgba(34, 197, 94, 0.2);
}

.status-badge-outline.status-warning {
    background: rgba(245, 158, 11, 0.06);
    color: var(--color-amber);
    border-color: rgba(245, 158, 11, 0.2);
}

.status-badge-outline.status-danger {
    background: rgba(239, 68, 68, 0.06);
    color: var(--color-coral);
    border-color: rgba(239, 68, 68, 0.2);
}

.status-badge-outline.status-blue {
    background: rgba(59, 130, 246, 0.06);
    color: var(--color-blue);
    border-color: rgba(59, 130, 246, 0.2);
}

.status-badge-outline i {
    width: 11px;
    height: 11px;
}

/* ==========================================================================
   Tab 3: Staffing Forecaster Elements
   ========================================================================== */
.forecaster-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 24px;
    align-items: start;
}

.forecaster-panel {
    padding: 24px;
}

.forecaster-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

/* Form Styles */
.form-group-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.form-control {
    background: var(--bg-app);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    padding: 8px 12px;
    outline: none;
    font-family: var(--font-body);
    font-size: 13px;
    width: 100%;
    transition: var(--transition-fast);
}

.form-control:focus {
    border-color: var(--color-teal);
    box-shadow: 0 0 0 3px var(--color-teal-glow);
}

.input-addon-wrapper {
    position: relative;
    display: flex;
    width: 100%;
}

.input-addon-wrapper .form-control {
    flex: 1;
}

.input-addon-wrapper .form-control:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.input-addon-wrapper .form-control:last-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-addon {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.input-addon-wrapper .input-addon:first-child {
    border-right: none;
    border-top-left-radius: var(--border-radius-sm);
    border-bottom-left-radius: var(--border-radius-sm);
}

.input-addon-wrapper .input-addon:last-child {
    border-left: none;
    border-top-right-radius: var(--border-radius-sm);
    border-bottom-right-radius: var(--border-radius-sm);
}

.help-tooltip {
    background: var(--text-muted);
    color: var(--bg-app);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    cursor: help;
}

.divider {
    border: none;
    border-top: 1px solid var(--border-glass);
    margin: 8px 0;
}

/* Expected Daily Pet Counts section */
.forecast-occupancy-inputs {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.occupancy-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.occupancy-header-row h4 {
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-secondary);
}

.occupancy-input-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.day-input-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

.day-input-box label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

.day-input-box .form-control {
    padding: 6px;
    text-align: center;
    font-size: 12px;
}

/* Forecaster Results Panel Styling */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.forecast-summary-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.forecast-mini-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    padding: 12px;
    border-radius: var(--border-radius-md);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mini-label {
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-muted);
}

.mini-value {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 16px;
}

.mini-value.text-teal { color: var(--color-teal); }
.mini-value.text-coral { color: var(--color-coral); }

.forecast-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.forecast-table th {
    background: rgba(255,255,255,0.02);
    padding: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-glass);
}

.forecast-table td {
    padding: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

/* Alert Box */
.alert-box {
    display: flex;
    gap: 12px;
    padding: 14px;
    border-radius: var(--border-radius-md);
    border: 1px solid transparent;
}

.alert-success-box {
    background: rgba(34, 197, 94, 0.05);
    border-color: rgba(34, 197, 94, 0.2);
}

.alert-icon-wrapper i {
    width: 20px;
    height: 20px;
    color: var(--color-green);
}

.alert-content strong {
    display: block;
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.alert-content p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ==========================================================================
   Tab 4: Settings layout & Actions
   ========================================================================== */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.settings-card {
    padding: 24px;
}

.card-title-icon-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.settings-header-icon {
    width: 32px;
    height: 32px;
    margin-top: 2px;
}

.card-desc {
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: 4px;
}

.form-help-text {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.settings-actions-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settings-action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.action-info h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.action-info p {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
    line-height: 1.4;
}

/* ==========================================================================
   Button System
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    padding: 10px 18px;
    border-radius: var(--border-radius-sm);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    outline: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--color-teal);
    color: var(--bg-app);
    box-shadow: 0 4px 14px rgba(20, 184, 166, 0.2);
}

.btn-primary:hover {
    background: hsl(172, 75%, 52%);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(20, 184, 166, 0.35);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-glass);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-danger {
    background: var(--color-coral);
    color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: hsl(354, 85%, 62%);
    transform: translateY(-1px);
}

.btn-danger-outline {
    background: transparent;
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--color-coral);
}

.btn-danger-outline:hover {
    background: rgba(239, 68, 68, 0.06);
    border-color: var(--color-coral);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 11px;
}

.full-width {
    width: 100%;
}

.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }

/* ==========================================================================
   Modals & Overlays
   ========================================================================== */
.modal-dialog {
    background: transparent;
    border: none;
    margin: auto;
    outline: none;
}

.modal-dialog::backdrop {
    background: rgba(4, 7, 15, 0.8);
    backdrop-filter: blur(8px);
}

.modal-content {
    width: 420px;
    max-width: 90vw;
    padding: 24px !important;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.modal-header h2 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 18px;
    color: var(--text-primary);
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    transition: var(--transition-fast);
}

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

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.checkbox-group input {
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: var(--color-teal);
}

.checkbox-group label {
    cursor: pointer;
    font-size: 12px;
    color: var(--text-secondary);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .forecaster-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .app-sidebar {
        width: 70px;
        padding: 24px 8px;
        align-items: center;
    }
    
    .brand-name, .app-title, .branding-text,
    .week-selector-card, .nav-item span,
    .user-info, .sidebar-footer {
        display: none !important;
    }
    
    .logo-container {
        margin-bottom: 20px;
    }
    
    .nav-item {
        padding: 12px;
        justify-content: center;
    }
    
    .nav-item:hover {
        transform: none;
    }
    
    .app-content {
        margin-left: 70px;
        padding: 24px;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .charts-subgrid {
        grid-template-columns: 1fr;
    }
    
    .kpi-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .occupancy-input-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 576px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }
    
    .occupancy-input-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .form-group-row {
        grid-template-columns: 1fr;
    }
    
    .forecast-summary-metrics {
        grid-template-columns: 1fr 1fr;
    }
}

/* ========================================================================== 
   Casual PIN Privacy Lock
   ========================================================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body.security-locked {
    overflow: hidden;
}

body.security-locked .app-container {
    filter: blur(14px) saturate(0.75) brightness(0.62);
    transform: scale(1.01);
    pointer-events: none;
    user-select: none;
}

.security-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 20% 18%, rgba(20, 184, 166, 0.18), transparent 34%),
        radial-gradient(circle at 78% 82%, rgba(59, 130, 246, 0.18), transparent 36%),
        rgba(8, 13, 26, 0.74);
    backdrop-filter: blur(10px);
}

body:not(.security-locked) .security-overlay {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity var(--transition-smooth), visibility var(--transition-smooth);
}

.security-card {
    width: min(440px, 100%);
    padding: 34px;
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(18, 30, 54, 0.92), rgba(11, 19, 36, 0.92));
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    text-align: center;
}

.security-icon {
    width: 58px;
    height: 58px;
    margin: 0 auto 18px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    color: var(--color-teal);
    background: var(--color-teal-glow);
    border: 1px solid rgba(20, 184, 166, 0.24);
}

.security-icon i {
    width: 28px;
    height: 28px;
}

.security-eyebrow {
    margin-bottom: 8px;
    color: var(--color-teal);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.6px;
    text-transform: uppercase;
}

.security-card h1 {
    font-family: var(--font-heading);
    font-size: clamp(28px, 5vw, 38px);
    line-height: 1.05;
    letter-spacing: -0.04em;
    margin-bottom: 10px;
}

.security-copy,
.security-note {
    color: var(--text-secondary);
}

.security-copy {
    margin-bottom: 24px;
}

.security-form {
    display: grid;
    gap: 12px;
}

.security-pin-input {
    width: 100%;
    min-height: 54px;
    padding: 0 18px;
    border-radius: 14px;
    border: 1px solid var(--border-glass);
    background: rgba(8, 13, 26, 0.8);
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.35em;
    outline: none;
    transition: var(--transition-fast);
}

.security-pin-input:focus {
    border-color: var(--color-teal);
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.12);
}

.security-unlock-btn {
    min-height: 48px;
    justify-content: center;
}

.security-error {
    min-height: 20px;
    color: var(--color-coral);
    font-size: 13px;
    font-weight: 600;
}

.security-note {
    margin-top: 18px;
    font-size: 12px;
}

@media print {
    .security-overlay {
        display: none !important;
    }

    body.security-locked .app-container {
        filter: none !important;
        transform: none !important;
    }
}

/* ==========================================================================
   Print Optimization Styles
   ========================================================================== */
@media print {
    body {
        background: white !important;
        color: black !important;
    }
    
    .app-sidebar, .content-header, .tracker-controls-row,
    .forecaster-panel.input-panel, #printForecastBtn,
    .btn, .sidebar-nav, .week-selector-card {
        display: none !important;
    }
    
    .app-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    
    .forecaster-panel.results-panel {
        border: none !important;
        background: white !important;
        box-shadow: none !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .forecast-table th {
        background: #f1f5f9 !important;
        color: black !important;
        border-bottom: 2px solid black !important;
    }
    
    .forecast-table td {
        border-bottom: 1px solid #e2e8f0 !important;
        color: black !important;
    }
    
    .forecast-mini-card {
        border: 1px solid #e2e8f0 !important;
        background: #f8fafc !important;
    }
    
    .mini-value {
        color: black !important;
    }
}
