/* ============================================================
   SNOWCOOL AIR-CONDITIONING — Web Portal
   Matches the Flutter app's Deep Blue / Cyan brand
   ============================================================ */

:root {
    --primary: #0B3D6E;
    --primary-dark: #072A4D;
    --primary-light: #14568F;
    --accent: #00BCD4;
    --accent-light: #62EFFF;
    --background: #F7FAFC;
    --surface: #FFFFFF;
    --text-primary: #1A2B3C;
    --text-secondary: #6B7C8D;
    --success: #2ECC71;
    --warning: #F5A623;
    --error: #E74C3C;
    --border: #E2E8F0;
    --radius: 14px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    -webkit-tap-highlight-color: transparent;
}

a { color: inherit; text-decoration: none; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- Top navigation ---------- */
.topbar {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}

.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.topbar .brand .icon { font-size: 22px; }
.topbar .actions { display: flex; align-items: center; gap: 14px; }
.topbar .actions a, .topbar .actions button {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}
.topbar .actions a:hover, .topbar .actions button:hover { background: rgba(255,255,255,0.25); }

/* ---------- Sidebar layout (desktop) ---------- */
.layout { display: flex; min-height: calc(100vh - 60px); }

.sidebar {
    width: 230px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 20px 0;
    flex-shrink: 0;
}

.sidebar a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 22px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
    border-left: 3px solid transparent;
}

.sidebar a.active, .sidebar a:hover {
    color: var(--primary);
    background: rgba(11,61,110,0.06);
    border-left-color: var(--primary);
}

.main-content { flex: 1; padding: 24px; }

@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { padding: 16px; }
}

/* ---------- Cards ---------- */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.04);
    margin-bottom: 16px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.04);
}
.stat-card .stat-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    margin-bottom: 10px;
    background: rgba(11,61,110,0.1);
    color: var(--primary);
}
.stat-card .stat-value { font-size: 24px; font-weight: 800; }
.stat-card .stat-label { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 12px;
    border: none;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-success { background: var(--success); color: #fff; }
.btn-error { background: var(--error); color: #fff; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-size: 14px;
    background: var(--surface);
}
.form-control:focus { outline: none; border-color: var(--primary); }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; font-size: 13px; border-bottom: 1px solid var(--border); }
th { color: var(--text-secondary); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; }

/* ---------- Badges ---------- */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}
.badge-success { background: rgba(46,204,113,0.15); color: var(--success); }
.badge-error { background: rgba(231,76,60,0.15); color: var(--error); }
.badge-warning { background: rgba(245,166,35,0.15); color: var(--warning); }
.badge-muted { background: rgba(107,124,141,0.15); color: var(--text-secondary); }

/* ---------- Bottom nav (mobile) ---------- */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 8px 0;
    z-index: 100;
}
.bottom-nav .nav-items { display: flex; justify-content: space-around; }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10px; color: var(--text-secondary); font-weight: 600; }
.bottom-nav a.active { color: var(--primary); }
.bottom-nav .icon { font-size: 20px; }

@media (max-width: 768px) {
    .bottom-nav { display: block; }
    .main-content { padding-bottom: 80px; }
}

/* ---------- Login / auth screens ---------- */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background);
    padding: 20px;
}
.auth-box {
    background: var(--surface);
    border-radius: 20px;
    padding: 36px 28px;
    max-width: 380px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
}
.auth-box .logo-circle {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: rgba(11,61,110,0.08);
    display: flex; align-items: center; justify-content: center;
    font-size: 30px;
    margin: 0 auto 20px;
    color: var(--primary);
}

/* ---------- Empty / error states ---------- */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-secondary); }
.empty-state .icon { font-size: 40px; opacity: 0.4; margin-bottom: 10px; }
