:root {
    --bg-main: #FBF8F4;
    --bg-card: #FFFFFF;
    --bg-sidebar: #F5F0EA;
    --accent: #C4956A;
    --accent-hover: #B8845A;
    --accent-light: rgba(196, 149, 106, 0.12);
    --text-primary: #2D2319;
    --text-secondary: #8C7B6B;
    --text-muted: #B8A99A;
    --success: #5B9A6F;
    --success-bg: rgba(91, 154, 111, 0.1);
    --danger: #C75B4A;
    --danger-bg: rgba(199, 91, 74, 0.1);
    --warning: #D4A54A;
    --warning-bg: rgba(212, 165, 74, 0.1);
    --border: #E8E0D6;
    --shadow: rgba(45, 35, 25, 0.06);
    --shadow-md: rgba(45, 35, 25, 0.1);
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --sidebar-width: 260px;
    --bottom-nav-h: 64px;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ====== SIDEBAR (hidden on mobile) ====== */

.sidebar {
    display: none;
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 24px 20px 20px;
    border-bottom: 1px solid var(--border);
}

.logo-icon { font-size: 28px; }

.logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    text-decoration: none;
}

.nav-item:hover {
    background: var(--accent-light);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 600;
}

.nav-item-secondary { color: var(--text-muted); }
.nav-item-secondary:hover { color: var(--text-secondary); }

.nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

/* ====== MAIN CONTENT ====== */

.main-content {
    min-height: 100vh;
    padding: 16px 16px calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 20px);
}

/* ====== TAB CONTENT ====== */

.tab-content {
    display: none;
}

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

/* ====== BOTTOM NAV (visible on mobile) ====== */

.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: stretch;
    z-index: 100;
    box-shadow: 0 -2px 12px var(--shadow);
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item.active {
    color: var(--accent);
}

.bottom-nav-item:active {
    transform: scale(0.93);
}

.bottom-nav-icon {
    font-size: 22px;
    line-height: 1;
}

.bottom-nav-label {
    font-size: 10px;
    letter-spacing: 0.2px;
}

/* ====== PAGE HEADER ====== */

.page-header {
    margin-bottom: 20px;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ====== METRICS GRID ====== */

.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.metrics-grid-3 {
    grid-template-columns: 1fr;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: 0 2px 8px var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px var(--shadow-md);
}

.metric-card-danger {
    border-color: var(--danger);
    background: var(--danger-bg);
}

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

.metric-icon-bg {
    font-size: 28px;
    line-height: 1;
}

.metric-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    background: var(--accent-light);
    color: var(--accent);
}

.metric-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.metric-value-sub {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-muted);
}

.metric-value-success { color: var(--success); }
.metric-value-danger { color: var(--danger); }

.metric-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.3;
}

/* ====== PROGRESS BAR ====== */

.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    margin-top: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    animation: fillWidth 0.8s ease both;
    transition: width 0.5s ease;
}

/* ====== SECTION CARD ====== */

.section-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px var(--shadow);
}

.section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

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

.section-header .section-title {
    margin-bottom: 0;
}

.section-header-standalone {
    margin-bottom: 16px;
    display: flex;
    justify-content: flex-end;
}

/* ====== BAR CHART ====== */

.chart-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -8px;
    padding: 0 8px;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 160px;
    min-width: 500px;
}

.chart-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 18px;
}

.chart-value {
    font-size: 9px;
    color: var(--text-muted);
    margin-bottom: 4px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
}

.chart-col:hover .chart-value {
    opacity: 1;
}

.chart-bar {
    width: 100%;
    min-height: 4px;
    background: var(--accent);
    border-radius: 4px 4px 0 0;
    transition: background 0.2s;
    animation: fillBar 0.6s ease both;
    animation-delay: calc(var(--i, 0) * 0.03s);
}

.chart-col:hover .chart-bar {
    background: var(--accent-hover);
}

.chart-label {
    font-size: 9px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ====== INCOME BREAKDOWN ====== */

.income-breakdown {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.income-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.income-label { color: var(--text-secondary); }
.income-value { font-weight: 600; color: var(--text-primary); }

.income-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

.income-total .income-label {
    font-weight: 600;
    color: var(--text-primary);
}

.income-total .income-value {
    color: var(--accent);
    font-size: 16px;
}

/* ====== EVENTS LIST ====== */

.events-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.event-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

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

.event-icon { font-size: 20px; flex-shrink: 0; }

.event-info {
    flex: 1;
    min-width: 0;
}

.event-plate {
    display: block;
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.event-details {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 1px;
}

.event-time {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ====== SEARCH & FILTERS ====== */

.search-bar {
    margin-bottom: 12px;
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    font-family: var(--font-main);
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input::placeholder { color: var(--text-muted); }

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.filter-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    margin-bottom: 12px;
    scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar { display: none; }

.filter-pill {
    flex-shrink: 0;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--bg-card);
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

.filter-pill:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.filter-pill.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.filter-pill-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* ====== VEHICLE CARDS ====== */

.vehicles-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vehicle-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: 0 2px 8px var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.vehicle-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px var(--shadow-md);
}

.vehicle-card-debtor {
    border-color: var(--danger);
    border-width: 2px;
}

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

.vehicle-plate {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.vehicle-type {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.vehicle-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.vehicle-detail {
    font-size: 13px;
    color: var(--text-secondary);
}

.detail-label {
    color: var(--text-muted);
    margin-right: 4px;
}

.on-parking { color: var(--success); font-weight: 500; }
.off-parking { color: var(--text-muted); }

/* ====== STATUS BADGES ====== */

.status-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

.status-success {
    background: var(--success-bg);
    color: var(--success);
}

.status-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.status-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

/* ====== EXPENSE LIST ====== */

.expenses-list {
    display: flex;
    flex-direction: column;
}

.expense-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}

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

.expense-info { flex: 1; min-width: 0; }

.expense-name {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.expense-category {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 1px;
}

.expense-amount {
    font-size: 14px;
    font-weight: 600;
    color: var(--danger);
    white-space: nowrap;
    flex-shrink: 0;
}

.expense-total {
    border-top: 2px solid var(--border);
    border-bottom: none;
    padding-top: 14px;
    margin-top: 2px;
}

.expense-total .expense-name {
    font-weight: 700;
}

.expense-total .expense-amount {
    font-size: 16px;
    color: var(--text-primary);
}

/* ====== SALARY LINK CARD ====== */

.salary-link-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px var(--shadow);
}

.salary-link-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px var(--shadow-md);
}

.salary-link-icon { font-size: 32px; flex-shrink: 0; }

.salary-link-info { flex: 1; }

.salary-link-title {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.salary-link-sub {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.salary-link-arrow {
    font-size: 20px;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ====== GUARD CARDS ====== */

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

.guard-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: 0 2px 8px var(--shadow);
}

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

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

.guard-shift {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--accent-light);
    color: var(--accent);
}

.guard-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

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

.guard-row span:last-child {
    font-weight: 500;
    color: var(--text-primary);
}

.guard-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

.guard-row-highlight {
    font-weight: 600;
}

.guard-row-highlight span:first-child {
    color: var(--text-primary);
}

.guard-paid-badge {
    text-align: center;
    padding: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--success);
    background: var(--success-bg);
    border-radius: var(--radius-md);
}

.payments-history {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.payments-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.payment-item {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 6px 0;
    color: var(--text-secondary);
}

.payment-amount {
    font-weight: 600;
    color: var(--text-primary);
}

/* ====== TENANT CARDS ====== */

.tenants-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tenant-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: 0 2px 8px var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.tenant-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px var(--shadow-md);
}

.tenant-card-debtor {
    border-color: var(--danger);
    border-width: 2px;
}

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

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

.tenant-type {
    font-size: 12px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--accent-light);
    color: var(--accent);
    white-space: nowrap;
}

.tenant-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

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

.tenant-row span:first-child { color: var(--text-muted); }
.tenant-row span:last-child { font-weight: 500; color: var(--text-primary); }

.tenant-row-debt span:last-child {
    color: var(--danger);
    font-weight: 700;
}

.tenant-actions {
    display: flex;
    gap: 8px;
}

.tenant-actions .btn {
    flex: 1;
}

/* ====== NOTIFICATION CARDS ====== */

.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notif-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
    box-shadow: 0 1px 4px var(--shadow);
    transition: transform 0.15s;
}

.notif-card:hover {
    transform: translateX(4px);
}

.notif-debtor {
    border-left: 3px solid var(--danger);
}

.notif-payment {
    border-left: 3px solid var(--success);
}

.notif-icon {
    font-size: 22px;
    flex-shrink: 0;
    line-height: 1;
    margin-top: 1px;
}

.notif-content {
    flex: 1;
    min-width: 0;
}

.notif-main {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.4;
}

.notif-plate {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 14px;
}

.notif-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.notif-amount {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    margin-top: 3px;
}

.notif-time {
    text-align: right;
    flex-shrink: 0;
}

.notif-time > div:first-child {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

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

/* ====== DATE SEPARATOR ====== */

.date-separator {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 8px 0;
    margin: 4px 0;
    position: relative;
}

.date-separator::before,
.date-separator::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(50% - 40px);
    height: 1px;
    background: var(--border);
}

.date-separator::before { left: 0; }
.date-separator::after { right: 0; }

/* ====== BUTTONS ====== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    min-height: 44px;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: #fff;
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-sm {
    padding: 7px 14px;
    font-size: 13px;
    min-height: 36px;
}

.btn-block {
    width: 100%;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #b54f3f;
    color: #fff;
}

/* ====== MODAL ====== */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(45, 35, 25, 0.5);
    z-index: 1000;
    align-items: flex-end;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    background: var(--bg-card);
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 0;
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 1;
}

.modal-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-main);
    border-radius: 50%;
    font-size: 16px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

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

.modal-body {
    padding: 20px;
}

/* ====== FORM ====== */

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-main);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.form-input::placeholder { color: var(--text-muted); }

select.form-input {
    cursor: pointer;
}

.form-static {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    padding: 4px 0;
}

/* ====== TOAST ====== */

.toast {
    position: fixed;
    bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 16px);
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--text-primary);
    color: #fff;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ====== EMPTY STATE ====== */

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 15px;
}

/* ====== TEXT UTILITIES ====== */

.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-muted { color: var(--text-muted) !important; }
.font-bold { font-weight: 700 !important; }

/* ====== CARD ACTIONS (edit / delete buttons) ====== */

.card-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.card-action-btn {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-main);
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
    padding: 0;
    line-height: 1;
}

.card-action-btn:hover {
    background: var(--border);
    border-color: var(--text-muted);
}

.card-action-btn-danger:hover {
    background: var(--danger-bg);
    border-color: var(--danger);
}

/* ====== CONFIRM DIALOG ====== */

.confirm-msg {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 20px;
}

.confirm-actions {
    display: flex;
    gap: 10px;
}

.confirm-actions .btn { flex: 1; }

/* ====== TARIFF EDIT ROWS ====== */

.tariff-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tariff-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    gap: 8px;
    flex-wrap: wrap;
}

.tariff-row:last-child { border-bottom: none; }

.tariff-type-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    min-width: 130px;
}

.tariff-inputs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
    justify-content: flex-end;
}

.tariff-field {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.tariff-field input {
    width: 70px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 13px;
    text-align: right;
    color: var(--text-primary);
    background: var(--bg-main);
    outline: none;
}

.tariff-field input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-light);
}

/* ====== INLINE TOGGLE ====== */

.toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--bg-main);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-main);
}

.toggle-btn:hover { border-color: var(--accent); }

.toggle-btn-on {
    background: var(--success-bg);
    border-color: var(--success);
    color: var(--success);
}

.toggle-btn-off {
    color: var(--text-muted);
}

/* ====== CAPACITY EDIT ====== */

.capacity-edit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
}

.capacity-edit input {
    width: 56px;
    padding: 4px 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 14px;
    text-align: center;
    color: var(--text-primary);
    background: var(--bg-main);
    outline: none;
}

.capacity-edit input:focus {
    border-color: var(--accent);
}

/* ====== ANIMATIONS ====== */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes fillBar {
    from { transform: scaleY(0); }
    to { transform: scaleY(1); }
}

@keyframes fillWidth {
    from { width: 0; }
}

.chart-bar {
    transform-origin: bottom;
}

.animate-card {
    opacity: 0;
    animation: fadeInUp 0.4s ease forwards;
}

/* ====== RESPONSIVE — DESKTOP ====== */

@media (min-width: 769px) {
    .sidebar {
        display: flex;
    }

    .bottom-nav {
        display: none;
    }

    .main-content {
        margin-left: var(--sidebar-width);
        padding: 32px 40px;
        padding-bottom: 60px;
    }

    .page-title {
        font-size: 26px;
    }

    .metrics-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }

    .metrics-grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .metric-value {
        font-size: 32px;
    }

    .chart-bars {
        height: 200px;
    }

    .chart-value {
        font-size: 10px;
    }

    .section-card {
        padding: 24px;
    }

    .vehicles-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .guards-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .tenants-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .notifications-list {
        max-width: 700px;
    }

    .modal-overlay {
        align-items: center;
    }

    .modal-card {
        max-width: 480px;
        border-radius: var(--radius-lg);
        animation: fadeIn 0.25s ease;
    }

    .toast {
        bottom: 40px;
    }

    .filter-pill {
        padding: 8px 18px;
    }
}

@media (min-width: 1100px) {
    .vehicles-list {
        grid-template-columns: repeat(3, 1fr);
    }

    .tenants-list {
        grid-template-columns: repeat(3, 1fr);
    }

    .metrics-grid {
        gap: 20px;
    }
}

/* ── Notification badge in nav ── */
.notif-badge-nav {
    display:inline-block; background:#ef4444; color:#fff; border-radius:99px;
    font-size:10px; font-weight:700; padding:1px 6px; margin-left:4px;
    vertical-align:middle; line-height:16px;
}

/* ── Tenant: payment history ── */
.tenant-pay-history { margin-top:10px; border-top:1px solid var(--border); padding-top:10px; }
.pay-hist-title { font-size:11px; font-weight:700; color:#64748b; text-transform:uppercase; letter-spacing:.6px; margin-bottom:6px; }
.pay-hist-row { display:flex; gap:10px; align-items:center; font-size:12px; padding:3px 0; }
.pay-hist-row span:first-child { color:#64748b; min-width:60px; }

/* ── Tenant card enhanced ── */
.tenant-name { font-size:16px; font-weight:700; }
.font-bold { font-weight:700; }
.text-success { color:#22c55e; }

.notif-urgent { border-left: 3px solid #ef4444 !important; background: rgba(239,68,68,.05) !important; }
.notif-debtor { border-left: 3px solid #f59e0b; }

