/**
 * Victor Analytics - Design System + Componente
 *
 * CSS custom properties, reset, login screen, numpad.
 * Mobile-first, navy blue profesional.
 */

/* ========================================
   Design System - Custom Properties
   ======================================== */

:root {
    /* Culori primare */
    --color-primary: #1a237e;
    --color-primary-light: #3949ab;
    --color-primary-dark: #0d1442;
    --color-primary-surface: #e8eaf6;

    /* Neutral */
    --color-bg: #eaeaea;
    --color-surface: #ffffff;
    --color-text: #111111;
    --color-text-secondary: #444444;
    --color-border: #cccccc;

    /* Semantic */
    --color-success: #2e7d32;
    --color-error: #c62828;
    --color-warning: #e65100;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;

    /* Tipografie */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-sm: 0.9375rem;
    --font-size-base: 1.0625rem;
    --font-size-lg: 1.3125rem;
    --font-size-xl: 1.625rem;
    --font-size-2xl: 2.125rem;

    /* Layout */
    --header-height: 56px;
    --nav-height: 60px;
    --max-width: 600px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.15);

    /* Borders */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 50%;
}

/* ========================================
   Reset / Base
   ======================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.5;
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

button {
    font-family: inherit;
    border: none;
    outline: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* ========================================
   Login Screen
   ======================================== */

.login-screen {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
    user-select: none;
    -webkit-user-select: none;
}

.login-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.login-logo {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    color: var(--color-primary);
    font-size: 3rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-md);
    box-shadow: var(--shadow-lg);
}

.login-title {
    color: white;
    font-size: var(--font-size-xl);
    font-weight: 700;
}

.login-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--font-size-base);
    margin-top: var(--space-xs);
    min-height: 1.5em;
    transition: color 0.2s ease;
}

.login-subtitle--error {
    color: #ef9a9a;
}

/* ========================================
   PIN Display (cerculete)
   ======================================== */

.pin-display {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    margin-bottom: var(--space-xl);
}

.pin-dot {
    width: 16px;
    height: 16px;
    border-radius: var(--radius-full);
    border: 2px solid rgba(255, 255, 255, 0.6);
    background: transparent;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.pin-dot--filled {
    background: white;
    border-color: white;
}

.pin-display--shake {
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-10px); }
    40%, 80% { transform: translateX(10px); }
}

/* ========================================
   Numpad
   ======================================== */

.numpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    max-width: 280px;
    margin: 0 auto;
}

.numpad__key {
    aspect-ratio: 1;
    border: none;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: var(--font-size-2xl);
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 72px;
    min-width: 72px;
}

.numpad__key:active {
    background: rgba(255, 255, 255, 0.35);
}

.numpad__key--empty {
    visibility: hidden;
    pointer-events: none;
}

.numpad__key--delete {
    background: transparent;
    font-size: var(--font-size-xl);
}

.numpad__key--delete:active {
    background: rgba(255, 255, 255, 0.1);
}

.numpad__key:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ========================================
   Header
   ======================================== */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--color-primary);
    color: white;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 var(--space-md);
    gap: var(--space-sm);
}

.header__logo {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: 800;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.header__title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========================================
   Bottom Navigation
   ======================================== */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    min-height: var(--nav-height);
    padding-bottom: env(safe-area-inset-bottom, 0);
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.08);
}

.bottom-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: var(--space-sm) var(--space-md);
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: var(--font-size-sm);
    -webkit-tap-highlight-color: transparent;
    transition: color 0.2s ease;
}

.bottom-nav__item--active {
    color: var(--color-primary);
}

.bottom-nav__item svg {
    width: 24px;
    height: 24px;
}

/* ========================================
   Main Content Area
   ======================================== */

.main-content {
    padding-top: calc(var(--header-height) + var(--space-md));
    padding-bottom: calc(var(--nav-height) + var(--space-md) + env(safe-area-inset-bottom, 0));
    padding-left: var(--space-md);
    padding-right: var(--space-md);
    max-width: var(--max-width);
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
}

/* ========================================
   Cards
   ======================================== */

.card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-md);
}

.card__title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: var(--space-md);
    color: var(--color-primary-dark);
}

.card__description {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-md);
}

.placeholder-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: var(--space-xl);
    text-align: center;
    box-shadow: var(--shadow-sm);
    margin-top: var(--space-lg);
}

.text-secondary {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    margin-top: var(--space-sm);
}

/* ========================================
   Desktop Responsive
   ======================================== */

/* ========================================
   Form Elements (setari)
   ======================================== */

.form-group {
    margin-bottom: var(--space-md);
}

.form-label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 600;
    margin-bottom: var(--space-xs);
    color: var(--color-text);
}

.form-input {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-lg);
    letter-spacing: 0.3em;
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
    font-family: var(--font-family);
    background: var(--color-bg);
}

.form-input:focus {
    border-color: var(--color-primary);
    background: var(--color-surface);
}

.btn {
    display: inline-block;
    padding: var(--space-sm) var(--space-lg);
    border: none;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-base);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    width: 100%;
    text-align: center;
    font-family: var(--font-family);
}

.btn--primary {
    background: var(--color-primary);
    color: white;
}

.btn--primary:hover {
    background: var(--color-primary-light);
}

.btn--primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-message {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    margin-top: var(--space-md);
    text-align: center;
}

.form-message--success {
    background: #e8f5e9;
    color: var(--color-success);
}

.form-message--error {
    background: #ffebee;
    color: var(--color-error);
}

/* ========================================
   Property Info (setari)
   ======================================== */

.property-info {
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--color-border);
}

.property-info:last-child {
    border-bottom: none;
}

.property-info__name {
    font-weight: 600;
    font-size: var(--font-size-base);
}

.property-info__detail {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    margin-top: var(--space-xs);
}

/* ========================================
   Sync Status (setari)
   ======================================== */

.sync-status {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.sync-status__indicator {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.sync-status__indicator--success {
    background: var(--color-success);
}

.sync-status__indicator--error {
    background: var(--color-error);
}

.sync-status__indicator--unknown {
    background: var(--color-text-secondary);
}

.sync-status__label {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.sync-status__value {
    font-weight: 600;
}

/* ========================================
   Desktop Responsive
   ======================================== */

@media (min-width: 768px) {
    .main-content {
        max-width: 600px;
    }

    .bottom-nav {
        max-width: 600px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: var(--radius-md) var(--radius-md) 0 0;
    }
}

/* ========================================
   Pull-to-refresh indicator
   ======================================== */

html {
    overscroll-behavior: contain;
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
}

#pull-indicator {
    height: 0;
    overflow: hidden;
    text-align: center;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    transition: height 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========================================
   Error Banner
   ======================================== */

.error-banner {
    background: #ffebee;
    color: var(--color-error);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--font-size-sm);
}

.error-banner__retry {
    background: none;
    border: 1px solid var(--color-error);
    color: var(--color-error);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    cursor: pointer;
    font-family: var(--font-family);
}

/* ========================================
   Property Tabs
   ======================================== */

.property-tabs {
    display: flex;
    gap: 0;
    background: var(--color-primary-surface);
    border-radius: var(--radius-sm);
    padding: 2px;
    margin-bottom: var(--space-md);
}

.property-tabs__tab {
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    text-align: center;
    font-weight: 500;
    font-family: var(--font-family);
}

.property-tabs__tab--active {
    color: var(--color-primary);
    background: var(--color-surface);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

/* ========================================
   Revenue Grid 2x2
   ======================================== */

.revenue-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.revenue-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    box-shadow: var(--shadow-sm);
}

.revenue-card--today {
    border-left: 3px solid var(--color-primary);
}

.revenue-card__label {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xs);
}

.revenue-card__amount {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-text);
}

.revenue-card__trend {
    font-size: var(--font-size-sm);
    margin-top: var(--space-xs);
    display: flex;
    align-items: center;
    gap: 4px;
}

.trend--up {
    color: var(--color-success);
}

.trend--down {
    color: var(--color-error);
}

.trend--flat {
    color: var(--color-text-secondary);
}

/* ========================================
   Room Status Bar
   ======================================== */

.room-section {
    margin-bottom: var(--space-md);
}

.room-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: var(--space-sm);
}

.room-header__name {
    font-weight: 600;
    font-size: var(--font-size-base);
}

.room-header__rate {
    font-size: var(--font-size-sm);
    color: var(--color-primary);
    font-weight: 600;
}

.room-bar {
    display: flex;
    height: 24px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--color-border);
    margin-bottom: var(--space-xs);
}

.room-bar__segment {
    transition: width 0.3s ease;
    min-width: 2px;
}

.room-bar__segment--occupied {
    background: var(--color-success);
}

.room-bar__segment--reserved {
    background: var(--color-warning);
}

.room-bar__segment--free {
    background: #bdbdbd;
}

.room-legend {
    display: flex;
    gap: var(--space-md);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xs);
}

.room-legend__item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.room-legend__dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
}

.room-blocked {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

/* ========================================
   Activity Mini-Cards
   ======================================== */

.activity-cards {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

.activity-card {
    flex: 1;
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    padding: var(--space-sm);
    text-align: center;
}

.activity-card__value {
    font-weight: 700;
    font-size: var(--font-size-lg);
    color: var(--color-text);
}

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

/* ========================================
   Skeleton Loading
   ======================================== */

.skeleton {
    background: linear-gradient(90deg, var(--color-border) 25%, #f0f0f0 50%, var(--color-border) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
    display: inline-block;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton--amount {
    height: 1.5rem;
    width: 80%;
}

.skeleton--text {
    height: 0.875rem;
    width: 60%;
}

.skeleton--bar {
    height: 24px;
    width: 100%;
}

/* ========================================
   Freshness Timestamp
   ======================================== */

.freshness {
    text-align: center;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    padding: var(--space-sm) 0;
}

/* ========================================
   Financial Intelligence Section
   ======================================== */

.financial-section {
    margin-bottom: var(--space-md);
}

.section-title {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--color-primary-dark);
    margin-bottom: var(--space-sm);
}

.revpar-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.revpar-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    box-shadow: var(--shadow-sm);
}

.revpar-card__label {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xs);
}

.revpar-card__value {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-text);
}

.revpar-card__trend {
    font-size: var(--font-size-sm);
    margin-top: var(--space-xs);
}

.revpar-card__detail {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    margin-top: var(--space-xs);
}

.forecast-cards {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.forecast-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    box-shadow: var(--shadow-sm);
}

.forecast-card__label {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xs);
    text-transform: capitalize;
}

.forecast-card__amount {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--color-text);
}

.forecast-card__detail {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-top: var(--space-xs);
}

/* ========================================
   Dashboard Content Transition
   ======================================== */

.dashboard-content {
    transition: opacity 0.15s ease;
}

.dashboard-content--loading {
    opacity: 0.5;
}

/* ========================================
   Charts Page
   ======================================== */

.charts-page {
    padding-bottom: 80px;
}

.chart-section {
    margin-bottom: var(--space-lg);
}

.chart-section__title {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--color-primary-dark);
    margin-bottom: var(--space-sm);
}

.period-tabs {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.period-tabs__tab {
    padding: 6px 12px;
    border-radius: 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    font-size: 0.8rem;
    cursor: pointer;
    color: var(--color-text-secondary);
    font-weight: 500;
    font-family: var(--font-family);
    transition: all 0.2s;
}

.period-tabs__tab--active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.chart-container {
    min-height: 300px;
    position: relative;
}

.chart-container--heatmap {
    min-height: 250px;
}

.chart-container--rooms {
    min-height: 150px;
}

.chart-section + .chart-section {
    margin-top: var(--space-lg);
}

.heatmap-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-md);
    margin-bottom: var(--space-sm);
}

.heatmap-nav__btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-primary);
    padding: var(--space-sm);
    line-height: 1;
    border-radius: var(--radius-sm);
    transition: background-color 0.2s;
}

.heatmap-nav__btn:active {
    background: var(--color-primary-surface);
}

.heatmap-nav__label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-primary);
}

.chart-tooltip {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-sm);
    box-shadow: var(--shadow-sm);
}

.chart-error {
    text-align: center;
    color: var(--color-text-secondary);
    padding: 40px 20px;
    font-size: var(--font-size-sm);
}

/* ========================================
   Sparklines Section (Home)
   ======================================== */

.sparklines-section {
    padding: 0;
    margin-bottom: var(--space-md);
}

.sparkline-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-sm);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    -webkit-tap-highlight-color: transparent;
}

.sparkline-card__label {
    font-size: 0.7rem;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.sparkline-card__rooms-summary {
    font-size: 0.7rem;
    color: var(--color-text-secondary);
}

.sparkline-card__chart {
    margin-top: var(--space-xs);
}

/* ========================================
   View Tabs (Grafice | Comparatii)
   ======================================== */

.view-tabs {
    display: flex;
    gap: 0;
    background: var(--color-primary-dark);
    border-radius: var(--radius-sm);
    padding: 2px;
    margin-bottom: var(--space-md);
}

.view-tabs__tab {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-sm);
    color: rgba(255, 255, 255, 0.6);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    text-align: center;
    font-weight: 500;
    font-family: var(--font-family);
}

.view-tabs__tab--active {
    color: white;
    background: var(--color-primary);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

/* ========================================
   Comparison Blocks
   ======================================== */

.comparison-block {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-md);
}

.comparison-block__title {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--color-primary-dark);
    margin-bottom: var(--space-xs);
}

.comparison-block__subtitle {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-sm);
}

.comparison-block__badge {
    display: inline-block;
    padding: 2px var(--space-sm);
    border-radius: 12px;
    background: var(--color-primary-surface);
    color: var(--color-primary);
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.comparison-block__no-data {
    text-align: center;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    padding: var(--space-lg) var(--space-md);
}

/* ========================================
   Delta Grid & Cards
   ======================================== */

.delta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
}

.delta-card {
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    padding: var(--space-md);
    min-height: 80px;
}

.delta-card__label {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: var(--space-xs);
}

.delta-card__value {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--space-xs);
}

.delta-card__change {
    font-size: var(--font-size-sm);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.delta-card__change--up {
    color: var(--color-success);
}

.delta-card__change--down {
    color: var(--color-error);
}

.delta-card__change--flat {
    color: var(--color-text-secondary);
}

.delta-card__percent {
    font-weight: 600;
}

.delta-card__diff {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* ========================================
   Range Presets
   ======================================== */

.range-presets {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-bottom: var(--space-sm);
}

.range-presets__btn {
    padding: 4px var(--space-sm);
    border-radius: 16px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    font-size: 0.8rem;
    cursor: pointer;
    color: var(--color-text-secondary);
    font-weight: 500;
    font-family: var(--font-family);
    transition: all 0.2s;
}

.range-presets__btn:active,
.range-presets__btn--active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* ========================================
   Range Trigger (date display button)
   ======================================== */

.range-trigger {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    margin-bottom: var(--space-md);
    transition: border-color 0.2s;
}

.range-trigger:active {
    border-color: var(--color-primary);
}

.range-trigger__icon {
    font-size: var(--font-size-lg);
    line-height: 1;
}

.range-trigger__text {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

/* ========================================
   Range Sheet (bottom sheet mobile)
   ======================================== */

.range-sheet {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    background: var(--color-surface);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    padding: var(--space-md);
    padding-bottom: calc(var(--space-md) + env(safe-area-inset-bottom, 0));
    max-height: 80vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.range-sheet--open {
    display: block;
    transform: translateY(0);
}

.range-sheet__backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1099;
}

.range-sheet__backdrop--open {
    display: block;
}

.range-sheet__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    font-weight: 600;
    font-size: var(--font-size-base);
    color: var(--color-text);
}

.range-sheet__close {
    background: none;
    border: none;
    font-size: var(--font-size-xl);
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: var(--space-xs);
    line-height: 1;
}

/* ========================================
   Range Sheet - Desktop Override
   ======================================== */

@media (min-width: 768px) {
    .range-sheet {
        position: static;
        display: block !important;
        transform: none;
        box-shadow: none;
        border-radius: var(--radius-md);
        max-height: none;
        padding: 0;
        margin-bottom: var(--space-md);
    }

    .range-sheet__backdrop {
        display: none !important;
    }

    .range-sheet__header {
        display: none;
    }

    .range-trigger {
        display: none;
    }
}

/* ========================================
   flatpickr Overrides
   ======================================== */

.range-sheet .flatpickr-calendar {
    width: 100% !important;
    box-shadow: none !important;
    border: none !important;
}

.flatpickr-calendar {
    font-family: var(--font-family) !important;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: var(--color-primary) !important;
    border-color: var(--color-primary) !important;
}

.flatpickr-day.inRange {
    background: var(--color-primary-surface) !important;
    border-color: var(--color-primary-surface) !important;
    box-shadow: -5px 0 0 var(--color-primary-surface), 5px 0 0 var(--color-primary-surface) !important;
}

.flatpickr-day:hover {
    background: var(--color-primary-surface) !important;
    border-color: var(--color-primary-surface) !important;
}

.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg {
    fill: var(--color-primary) !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year {
    font-weight: 600 !important;
}

/* ========================================
   Offline Banner
   ======================================== */

.offline-banner {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--color-warning, #f57f17);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    position: sticky;
    top: 56px;
    z-index: 90;
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-sm);
}

.offline-banner__icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ========================================
   Freshness Stale Warning
   ======================================== */

.freshness--stale {
    color: var(--color-error, #c62828);
    font-weight: 600;
}

.freshness--stale::before {
    content: '\26A0 ';
}

/* ========================================
   Push Permission Re-ask Banner
   ======================================== */

.push-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--color-primary, #1a237e);
  color: #fff;
  font-size: 0.85rem;
  border-radius: 8px;
  margin: 8px 16px;
}
.push-banner span {
  flex: 1;
}
.push-banner__btn {
  background: #fff;
  color: var(--color-primary, #1a237e);
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}
.push-banner__close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0.7;
}
.push-banner__close:hover {
  opacity: 1;
}

/* ========================================
   Toggle Switch (iOS style)
   ======================================== */

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-switch__slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #ccc;
  transition: 0.3s;
  border-radius: 26px;
}
.toggle-switch__slider::before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  transition: 0.3s;
  border-radius: 50%;
}
.toggle-switch input:checked + .toggle-switch__slider {
  background: var(--color-primary, #1a237e);
}
.toggle-switch input:checked + .toggle-switch__slider::before {
  transform: translateX(22px);
}

/* ========================================
   Setting Rows
   ======================================== */

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #eee;
}
.setting-row:last-child {
  border-bottom: none;
}
.setting-row label:first-child {
  flex: 1;
  font-size: 0.95rem;
}

/* Select dropdown in settings */
.form-input--select {
  width: auto;
  min-width: 80px;
  padding: 6px 12px;
}

/* ========================================
   Room Section Clickable (Home)
   ======================================== */

.room-section--clickable {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.15s ease;
    padding: var(--space-sm);
    border-radius: var(--radius-md);
}

.room-section--clickable:active {
    background: var(--color-primary-surface);
}

/* ========================================
   Property Page
   ======================================== */

.property-page {
    padding-bottom: var(--space-lg);
}

.property-back {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    color: var(--color-primary);
    text-decoration: none;
    font-size: var(--font-size-sm);
    font-weight: 600;
    margin-bottom: var(--space-md);
    padding: var(--space-xs) 0;
    -webkit-tap-highlight-color: transparent;
}

.property-header {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-md);
}

.property-header__name {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-primary-dark);
    margin-bottom: var(--space-sm);
}

.property-header__stats {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: var(--space-sm);
}

.property-header__occupancy {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--color-text);
}

.property-header__count {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.property-header__bar {
    margin-top: var(--space-xs);
}

/* ========================================
   Room Cards Grid
   ======================================== */

.room-cards {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.room-cards__empty {
    text-align: center;
    color: var(--color-text-secondary);
    padding: var(--space-xl);
    font-size: var(--font-size-sm);
}

.room-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid transparent;
}

.room-card--free {
    border-left-color: var(--color-success);
}

.room-card--occupied {
    border-left-color: var(--color-warning);
}

.room-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xs);
}

.room-card__name {
    font-weight: 600;
    font-size: var(--font-size-base);
    color: var(--color-text);
}

.room-card__badge {
    display: inline-block;
    padding: 2px var(--space-sm);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.room-card__badge--free {
    background: #e8f5e9;
    color: var(--color-success);
}

.room-card__badge--occupied {
    background: #fff3e0;
    color: var(--color-warning);
}

.room-card__type {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xs);
}

.room-card__details {
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--color-border);
}

.room-card__guest {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--space-xs);
}

.room-card__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

.room-card__source {
    background: var(--color-primary-surface);
    color: var(--color-primary);
    padding: 1px var(--space-sm);
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}
