/* =====================================================
   SmartMeter Web App - Main CSS
   Light Theme | Clean & Professional
   ===================================================== */

:root {
    --primary: #2563eb;
    --primary-light: #eff6ff;
    --primary-dark: #1d4ed8;
    --success: #16a34a;
    --success-light: #f0fdf4;
    --danger: #dc2626;
    --warning: #d97706;
    --warning-light: #fffbeb;
    --sidebar-width: 260px;
    --sidebar-bg: #0f172a;
    --sidebar-text: #94a3b8;
    --sidebar-active: #2563eb;
    --navbar-height: 62px;
    --body-bg: #f8fafc;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --font: 'Plus Jakarta Sans', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font);
    background: var(--body-bg);
    color: var(--text-primary);
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 1.4rem 1.5rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    letter-spacing: -0.02em;
}

.sidebar-divider {
    border-color: rgba(255,255,255,0.08);
    margin: 0 1rem;
}

.sidebar-heading {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #475569;
    padding: 1rem 1.5rem 0.4rem;
}

.sidebar-nav {
    list-style: none;
    padding: 0.3rem 0.8rem;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.9rem;
    border-radius: 8px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.18s ease;
    margin-bottom: 2px;
}

.sidebar-nav li a:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
}

.sidebar-nav li a.active {
    background: var(--sidebar-active);
    color: #fff;
}

.sidebar-nav li a i {
    font-size: 1rem;
    width: 1.1rem;
    text-align: center;
}

.sidebar-footer {
    margin-top: auto;
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,0.07);
}

.btn-logout {
    width: 100%;
    background: rgba(239,68,68,0.12);
    border: none;
    border-radius: 8px;
    color: #f87171;
    padding: 0.6rem 1rem;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s;
    display: flex;
    align-items: center;
}

.btn-logout:hover { background: rgba(239,68,68,0.22); }

/* ===== CONTENT WRAPPER ===== */
.content-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

/* ===== TOP NAVBAR ===== */
.top-navbar {
    height: var(--navbar-height);
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.sidebar-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 38px; height: 38px;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.sidebar-toggle:hover { background: var(--body-bg); }

.nav-breadcrumb {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    flex: 1;
}

.nav-user {
    display: flex;
    align-items: center;
    font-size: 0.87rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.badge-role {
    background: #dbeafe;
    color: var(--primary);
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.badge-role.badge-user {
    background: #dcfce7;
    color: var(--success);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    padding: 1.75rem 2rem;
}

/* ===== STAT CARDS ===== */
.stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.4rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: box-shadow 0.2s, transform 0.2s;
}

.stat-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.07);
    transform: translateY(-2px);
}

.stat-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-icon.blue   { background: #eff6ff; color: var(--primary); }
.stat-icon.green  { background: #f0fdf4; color: var(--success); }
.stat-icon.amber  { background: #fffbeb; color: var(--warning); }
.stat-icon.purple { background: #f5f3ff; color: #7c3aed; }
.stat-icon.slate  { background: #f8fafc; color: #475569; }
.stat-icon.rose   { background: #fff1f2; color: #e11d48; }

.stat-body {}
.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -0.03em;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 0.2rem;
}

/* ===== DATA TABLES ===== */
.data-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.data-card-header {
    padding: 1.1rem 1.4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.data-card-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.table-sm th {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: #f8fafc;
    border-top: none;
}

.table-sm td {
    font-size: 0.87rem;
    vertical-align: middle;
}

/* ===== STATUS BADGES ===== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.status-badge::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.badge-active    { background: #dcfce7; color: #15803d; }
.badge-inactive  { background: #f1f5f9; color: #64748b; }
.badge-suspended { background: #fef9c3; color: #a16207; }
.badge-expired   { background: #fee2e2; color: #dc2626; }
.badge-connected    { background: #dcfce7; color: #15803d; }
.badge-disconnected { background: #fee2e2; color: #dc2626; }

/* ===== FORMS ===== */
.form-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    max-width: 680px;
}

.form-label {
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.form-control, .form-select {
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.88rem;
    padding: 0.55rem 0.85rem;
    color: var(--text-primary);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* ===== BUTTONS ===== */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    font-weight: 600;
    font-size: 0.87rem;
    border-radius: 8px;
    padding: 0.55rem 1.2rem;
}

.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

.btn-sm { font-size: 0.8rem; padding: 0.35rem 0.8rem; border-radius: 6px; }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); font-weight: 600; font-size: 0.85rem; }

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.page-header-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

/* ===== LOGIN PAGE ===== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    background: var(--body-bg);
}

.login-brand-panel {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: linear-gradient(145deg, #0f172a 0%, #1e293b 45%, #0f2744 100%);
    overflow: hidden;
}

.login-brand-glow {
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.35) 0%, transparent 70%);
    top: -80px;
    right: -100px;
    pointer-events: none;
}

.login-brand-content {
    position: relative;
    z-index: 1;
    max-width: 420px;
    color: #fff;
}

.login-brand-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 12px 32px rgba(37, 99, 235, 0.35);
}

.login-brand-icon i {
    font-size: 1.8rem;
    color: #fff;
}

.login-brand-icon--sm {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    margin: 0 auto 1rem;
}

.login-brand-icon--sm i { font-size: 1.5rem; }

.login-brand-name {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-brand-name--sm {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 0.35rem;
    background: none;
    -webkit-text-fill-color: var(--text-primary);
    color: var(--text-primary);
}

.login-brand-tagline {
    font-size: 1.05rem;
    color: #94a3b8;
    margin-bottom: 2.5rem;
    line-height: 1.5;
}

.login-brand-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.login-brand-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.92rem;
    color: #cbd5e1;
    margin-bottom: 0.85rem;
}

.login-brand-features i {
    color: #60a5fa;
    font-size: 1rem;
    flex-shrink: 0;
}

.login-form-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(180deg, #f8fafc 0%, #eff6ff 100%);
}

.login-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2.5rem 2.8rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.06);
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo--mobile { display: none; }
.login-logo--desktop { display: block; }

.login-logo h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    margin-bottom: 0.35rem;
}

.login-logo p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.login-eye-toggle { cursor: pointer; }

.login-submit-btn {
    font-weight: 600;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}

.login-powered {
    margin-top: 1.75rem;
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.login-powered strong {
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.01em;
}

@media (max-width: 991px) {
    .login-wrapper { flex-direction: column; }

    .login-brand-panel { display: none; }

    .login-form-panel {
        flex: 1;
        min-height: 100vh;
        justify-content: center;
    }

    .login-logo--mobile { display: block; }
    .login-logo--desktop { display: none; }
}

/* ===== DETAIL SECTIONS ===== */
.detail-row {
    display: flex;
    padding: 0.7rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.detail-row:last-child { border-bottom: none; }
.detail-label { width: 200px; font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); flex-shrink: 0; }
.detail-value { font-size: 0.88rem; color: var(--text-primary); }

/* ===== SOCIETY CARDS (Virtual Society View) ===== */
.society-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.society-card:hover {
    box-shadow: 0 8px 28px rgba(0,0,0,0.08);
    transform: translateY(-3px);
}

.society-card-banner {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    padding: 1.4rem 1.5rem;
    position: relative;
    color: #fff;
}

.society-card-banner::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 120px; height: 120px;
    background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, transparent 70%);
}

.society-icon-badge {
    width: 46px; height: 46px;
    background: rgba(255,255,255,0.18);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 0.7rem;
}

.society-card-banner .society-name {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.15rem;
}

.society-card-banner .society-location {
    font-size: 0.78rem;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.society-card-body {
    padding: 1.2rem 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.society-topic-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #f1f5f9;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.35rem 0.65rem;
    font-size: 0.74rem;
    font-family: monospace;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    word-break: break-all;
}

.society-stat-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.society-stat-box {
    background: var(--body-bg);
    border-radius: 10px;
    padding: 0.65rem 0.5rem;
    text-align: center;
}

.society-stat-box .num {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
}

.society-stat-box .lbl {
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 0.15rem;
}

.society-card-footer {
    padding: 0.9rem 1.5rem;
    border-top: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.society-route-list {
    list-style: none;
    margin: 0; padding: 0;
}

.society-route-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.55rem 0;
    border-bottom: 1px solid #f1f5f9;
    gap: 1rem;
}

.society-route-list li:last-child { border-bottom: none; }

.society-route-list .route-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.society-route-list .route-value {
    font-size: 0.8rem;
    font-family: monospace;
    color: var(--text-primary);
    text-align: right;
    word-break: break-all;
}

.empty-state-card {
    background: #fff;
    border: 1px dashed var(--border);
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
}

.empty-state-card i {
    font-size: 2.5rem;
    color: #cbd5e1;
}

/* ===== FAULT PROFILE CARD ===== */
.fault-card {
    border: 1.5px solid #fecaca;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}

.fault-card-header {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    padding: 1rem 1.4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
}

.fault-card-header .fault-title {
    font-size: 0.9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fault-card-body { padding: 1.2rem 1.4rem; }

.fault-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.fault-none-card {
    border: 1.5px dashed #e2e8f0;
    border-radius: 12px;
    background: #fafafa;
    padding: 1.5rem;
    text-align: center;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .content-wrapper { margin-left: 0; }
    .main-content { padding: 1rem; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* ===== RESUME VERIFICATION (admin) ===== */
.form-card-wide { max-width: 980px; }
.vcard {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
}
.vcard-title { font-weight: 700; font-size: 0.95rem; color: var(--text-primary); margin-bottom: 0.9rem; }
.vrow { padding: 0.5rem 0.25rem; border-bottom: 1px dashed #e2e8f0; }
.vrow:last-child { border-bottom: none; }
.skill-chip {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    margin: 0 0.35rem 0.4rem 0;
}
.pill-chip {
    display: inline-block;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.1rem 0.5rem;
    border-radius: 20px;
}
