/* ============================================================
   Premium Light Theme — replaces AdminLTE across both panels.
   Bootstrap 4 (CDN) still supplies grid/utility classes (row,
   col-*, form-control, table, badge, alert) so every existing
   view keeps working — this file only restyles the chrome
   (sidebar/topbar) and core components (card, btn, stat-widget)
   to a premium look, consistent with the brand color set from
   Admin → Branding.
   ============================================================ */

:root {
    --brand: #02707D;
    --ink: #111827;
    --muted: #6B7280;
    --bg: #F6F7F9;
    --border: #EEF0F3;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--ink);
    font-size: 14.5px;
}

a { color: var(--brand); }
a:hover { color: var(--brand); opacity: .85; }

h1, h2, h3, h4, h5, h6 { font-weight: 800; letter-spacing: -0.3px; color: var(--ink); }

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.app-sidebar {
    width: 264px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid var(--border);
    padding: 20px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.app-sidebar .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px 20px;
    font-weight: 800;
    font-size: 17px;
    color: var(--ink);
}
.app-sidebar .brand .logo-badge {
    width: 34px; height: 34px; border-radius: 10px;
    background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand), black 25%));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 15px;
    box-shadow: 0 4px 12px rgba(2,112,125,.25);
    position: relative; overflow: hidden;
}
.app-sidebar .brand .logo-badge::after {
    content: ''; position: absolute; top: -10px; right: -10px;
    width: 26px; height: 26px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.35), transparent 70%);
}

.app-nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 12px;
    color: #4B5563; font-weight: 600; font-size: 13.8px;
    text-decoration: none; margin-bottom: 2px;
    transition: background .12s, color .12s;
}
.app-nav-link i { width: 18px; text-align: center; font-size: 15px; color: #9CA3AF; }
.app-nav-link:hover { background: #F3F4F6; color: var(--ink); text-decoration: none; }
.app-nav-link.active { background: color-mix(in srgb, var(--brand) 12%, white); color: var(--brand); }
.app-nav-link.active i { color: var(--brand); }
.app-nav-group-label {
    font-size: 10.5px; font-weight: 800; letter-spacing: .6px; color: #9CA3AF;
    text-transform: uppercase; padding: 18px 12px 6px;
}
.app-nav-sub { padding-left: 30px; }

.app-main { flex: 1; min-width: 0; }

.app-topbar {
    background: #fff; border-bottom: 1px solid var(--border);
    padding: 14px 28px; display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 10;
}
.app-topbar h1 { font-size: 19px; margin: 0; }

.app-content {
    padding: 24px 28px 48px;
    background-image: radial-gradient(rgba(17,24,39,.025) 1px, transparent 1px);
    background-size: 22px 22px;
}

/* ---------- Cards (Bootstrap override) ---------- */
.card {
    border: none !important;
    border-radius: 16px !important;
    box-shadow: 0 2px 10px rgba(17,24,39,.05);
    position: relative;
}
.card::before {
    content: ''; position: absolute; top: 0; left: 20px; right: 20px; height: 3px;
    background: linear-gradient(90deg, var(--brand), transparent);
    border-radius: 0 0 3px 3px; opacity: .5;
}
.card-header {
    background: #fff !important;
    border-bottom: 1px solid var(--border) !important;
    font-weight: 700;
    border-radius: 16px 16px 0 0 !important;
    padding: 16px 20px;
}
.card-body { padding: 20px; }
.card-footer { background: #fff !important; border-top: 1px solid var(--border) !important; border-radius: 0 0 16px 16px !important; }

/* ---------- Buttons ---------- */
.btn { border-radius: 10px; font-weight: 700; font-size: 13.5px; padding: 8px 16px; }
.btn-sm, .btn-xs { border-radius: 8px; font-size: 12px; padding: 5px 11px; }
.btn:focus { box-shadow: none; }
.btn-brand, .btn[style*="background:var(--brand)"], .btn[style*="background: var(--brand)"] {
    background: var(--brand) !important; color: #fff !important; border: none !important;
}
.btn-outline-secondary { border-color: #E5E7EB; color: #4B5563; }
.btn-outline-primary { color: var(--brand); border-color: var(--brand); }

/* ---------- Forms ---------- */
.form-control {
    border-radius: 10px; border-color: #E5E7EB; padding: 9px 13px; font-size: 13.8px;
}
.form-control:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent); }
label { font-weight: 700; font-size: 12.5px; color: #374151; }

/* ---------- Select2 (restyled to match premium inputs) ---------- */
.select2-container--default .select2-selection--single {
    height: 42px !important; border-radius: 10px !important; border-color: #E5E7EB !important;
    display: flex; align-items: center; padding: 0 4px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 40px !important; padding-left: 10px !important; font-size: 13.8px; }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 40px !important; }
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default .select2-selection--single:focus { border-color: var(--brand) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent); }
.select2-dropdown { border-radius: 12px !important; border-color: #E5E7EB !important; overflow: hidden; box-shadow: 0 12px 32px rgba(17,24,39,.14); }
.select2-search--dropdown .select2-search__field { border-radius: 8px !important; border-color: #E5E7EB !important; padding: 6px 10px !important; }
.select2-results__option--highlighted[aria-selected] { background: var(--brand) !important; }
.field-help { color: #9CA3AF; font-size: 12px; cursor: help; margin-left: 4px; }
.field-help:hover { color: var(--brand); }

/* ---------- Address autocomplete dropdown ---------- */
.geo-suggest-wrap { position: relative; }
.geo-suggest-list {
    position: absolute; z-index: 500; background: #fff;
    border: 1px solid var(--border); border-radius: 12px;
    box-shadow: 0 12px 32px rgba(17,24,39,.14);
    margin-top: 4px; max-height: 260px; overflow-y: auto; width: 100%;
}
.geo-suggest-item { padding: 10px 14px; cursor: pointer; font-size: 13.3px; border-bottom: 1px solid #F3F4F6; color: #374151; }
.geo-suggest-item:last-child { border-bottom: none; }
.geo-suggest-item:hover, .geo-suggest-item.active { background: color-mix(in srgb, var(--brand) 8%, white); color: var(--brand); }
.quick-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.quick-actions .btn { display: flex; align-items: center; gap: 8px; }
.activity-feed-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #F3F4F6; }
.activity-feed-item:last-child { border-bottom: none; }
.activity-feed-icon { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; flex-shrink: 0; }

/* ---------- Tables ---------- */
.table { font-size: 13.5px; }
.table thead th {
    border-top: none; border-bottom: 2px solid var(--border) !important;
    text-transform: uppercase; font-size: 10.5px; letter-spacing: .5px; color: #9CA3AF;
    font-weight: 800;
}
.table td { vertical-align: middle; border-top: 1px solid #F3F4F6; }
.table-hover tbody tr:hover { background: #FAFBFC; }

/* ---------- Badges ---------- */
.badge { font-weight: 700; font-size: 10.5px; padding: 5px 10px; border-radius: 20px; }

/* ---------- Stat widgets (replaces AdminLTE small-box) ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card {
    background: #fff; border-radius: 16px; padding: 20px;
    box-shadow: 0 2px 10px rgba(17,24,39,.05);
    display: flex; align-items: center; gap: 14px;
    position: relative; overflow: hidden;
    transition: transform .15s, box-shadow .15s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(17,24,39,.08); }
.stat-card::after {
    content: ''; position: absolute; top: -30px; right: -30px;
    width: 80px; height: 80px; border-radius: 50%;
    background: radial-gradient(circle, rgba(17,24,39,.03), transparent 70%);
}
.stat-card .stat-icon {
    width: 46px; height: 46px; border-radius: 13px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 19px; color: #fff;
    position: relative; z-index: 1;
}
.stat-card .stat-value { font-size: 24px; font-weight: 800; line-height: 1.1; color: var(--ink); position: relative; z-index: 1; }
.stat-card .stat-label { font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 2px; position: relative; z-index: 1; }

.stat-brand   .stat-icon { background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand), black 25%)); }
.stat-success .stat-icon { background: linear-gradient(135deg, #22C55E, #16A34A); }
.stat-warning .stat-icon { background: linear-gradient(135deg, #F59E0B, #D97706); }
.stat-danger  .stat-icon { background: linear-gradient(135deg, #EF4444, #DC2626); }
.stat-info    .stat-icon { background: linear-gradient(135deg, #3B82F6, #2563EB); }
.stat-dark    .stat-icon { background: linear-gradient(135deg, #374151, #1F2937); }

.hero-panel {
    background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand), black 25%));
    border-radius: 20px; padding: 28px; color: #fff;
    box-shadow: 0 10px 30px color-mix(in srgb, var(--brand) 30%, transparent);
    position: relative; overflow: hidden;
}
.hero-panel::before {
    content: ''; position: absolute; top: -60px; right: -60px;
    width: 220px; height: 220px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.14), transparent 70%);
}
.hero-panel::after {
    content: ''; position: absolute; bottom: -80px; right: 80px;
    width: 160px; height: 160px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.09), transparent 70%);
}
.hero-panel > * { position: relative; z-index: 1; }

/* ---------- Auth pages ---------- */
.auth-shell {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    /*background: linear-gradient(160deg, var(--brand) 0%, #033f47 100%);*/
    padding: 24px; position: relative; overflow: hidden;
}
.auth-shell::before {
    content: '';
    position: absolute; inset: 0;
    /*background-image: radial-gradient(rgba(255,255,255,.09) 1.4px, transparent 1.4px);*/
    background-size: 26px 26px;
    opacity: .5;
}
.auth-shell::after {
    content: '';
    position: absolute; width: 480px; height: 480px; border-radius: 50%;
    /*background: radial-gradient(circle, rgba(255,255,255,.10), transparent 70%);*/
    top: -160px; left: -160px;
}
.auth-card {
    background: #fff; border-radius: 24px; padding: 40px 36px;
    width: 100%; max-width: 420px;
    box-shadow: 0 24px 60px rgba(0,0,0,.25);
    position: relative; z-index: 2; overflow: hidden;
}
.auth-card::before {
    content: ''; position: absolute; top: -50px; right: -50px;
    width: 140px; height: 140px; border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--brand) 8%, white), transparent 70%);
}
.auth-card > * { position: relative; z-index: 1; }
.auth-logo {
    width: 60px; height: 60px; border-radius: 18px; margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand), black 25%));
    display: flex; align-items: center; justify-content: center; color: #fff; font-size: 26px;
    box-shadow: 0 8px 20px color-mix(in srgb, var(--brand) 35%, transparent);
}
.auth-tabs { display: flex; background: #F3F4F6; border-radius: 12px; padding: 4px; margin-bottom: 22px; }
.auth-tab {
    flex: 1; text-align: center; padding: 9px; border-radius: 9px; font-weight: 700; font-size: 13.5px;
    color: #6B7280; cursor: pointer; border: none; background: transparent;
}
.auth-tab.active { background: #fff; color: var(--ink); box-shadow: 0 2px 6px rgba(0,0,0,.08); }

@media (max-width: 900px) {
    .app-sidebar { position: fixed; left: -280px; z-index: 40; transition: left .2s; box-shadow: 0 0 0 100vmax rgba(0,0,0,0); }
    .app-sidebar.open { left: 0; box-shadow: 0 0 40px rgba(0,0,0,.25); }
}
