/* ============================================================
   SafeWork HRM - Custom Styles
   ============================================================ */
:root {
    --sw-dark: #16213e;
    --sw-navy: #0f3460;
    --sw-blue: #185FA5;
    --sw-accent: #3B8BD4;
}

body.app-body {
    background: #f4f6fb;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ---------- LOGIN ---------- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    font-family: 'Segoe UI', system-ui, sans-serif;
    padding: 1rem;
}
.login-wrapper { width: 100%; max-width: 400px; }
.login-card {
    background: #fff;
    border-radius: 18px;
    padding: 2.5rem 2rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-brand { text-align: center; margin-bottom: 2rem; }
.login-brand i { font-size: 2.5rem; color: var(--sw-navy); margin-bottom: 0.5rem; }
.login-brand h1 { font-size: 1.6rem; font-weight: 700; color: var(--sw-dark); margin: 0; }
.login-brand p { font-size: 0.85rem; color: #888; margin: 0; }
.login-foot { text-align: center; margin-top: 1.5rem; color: #aaa; }
.login-card .input-group-text { background: #f4f6fb; border-right: 0; color: var(--sw-blue); }
.login-card .form-control { border-left: 0; }

/* ---------- NAVBAR ---------- */
.app-navbar {
    background: linear-gradient(90deg, var(--sw-dark), var(--sw-navy));
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.navbar-brand { font-weight: 700; letter-spacing: -0.5px; }
.navbar-brand span { color: var(--sw-accent); }
.navbar-brand i { color: var(--sw-accent); margin-right: 4px; }
.app-navbar .nav-link { font-size: 0.9rem; padding: 0.5rem 0.9rem; border-radius: 8px; transition: 0.2s; }
.app-navbar .nav-link:hover, .app-navbar .nav-link.active { background: rgba(255,255,255,0.12); }
.app-navbar .nav-link i { margin-right: 4px; opacity: 0.85; }
.user-chip { font-size: 0.85rem; }
.user-chip .badge { font-size: 0.65rem; margin-left: 4px; }

/* ---------- PAGE HEAD ---------- */
.page-head h2 { font-weight: 700; color: var(--sw-dark); font-size: 1.5rem; }
.page-head p { font-size: 0.9rem; }

/* ---------- CARDS ---------- */
.app-card {
    border: none;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    overflow: hidden;
}
.app-card .card-header {
    background: #fff;
    border-bottom: 1px solid #eef0f5;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--sw-dark);
    padding: 0.9rem 1.1rem;
}
.app-card .card-header i { color: var(--sw-blue); margin-right: 5px; }

/* ---------- STAT CARDS ---------- */
.stat-card {
    background: #fff;
    border-radius: 14px;
    padding: 1.1rem;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    height: 100%;
}
.stat-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}
.stat-num { font-size: 1.6rem; font-weight: 700; line-height: 1; color: var(--sw-dark); }
.stat-label { font-size: 0.78rem; color: #888; margin-top: 3px; }
.stat-card.blue  .stat-icon { background: #E6F1FB; color: #185FA5; }
.stat-card.teal  .stat-icon { background: #E1F5EE; color: #0F6E56; }
.stat-card.amber .stat-icon { background: #FAEEDA; color: #854F0B; }
.stat-card.coral .stat-icon { background: #FAECE7; color: #993C1D; }

/* ---------- CAMERA ---------- */
.camera-box {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    background: #1a1a2e;
    border-radius: 12px;
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
.camera-box video, .camera-box img {
    width: 100%; height: 100%; object-fit: cover;
}
.camera-box::after {
    content: 'Kamera belum aktif';
    position: absolute;
    color: #667;
    font-size: 0.85rem;
}
.camera-box video:not(.d-none) ~ ::after,
.camera-box img:not(.d-none) ~ ::after { display: none; }

/* ---------- GPS STATUS ---------- */
.gps-status {
    padding: 0.6rem 0.9rem;
    border-radius: 10px;
    font-size: 0.85rem;
    background: #f0f2f8;
    color: #555;
}
.gps-status.ok   { background: #E1F5EE; color: #0F6E56; }
.gps-status.warn { background: #FAEEDA; color: #854F0B; }

/* ---------- USER PIN (leaflet) ---------- */
.user-pin {
    background: var(--sw-blue);
    color: #fff;
    width: 32px; height: 32px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.user-pin i { transform: rotate(45deg); font-size: 0.9rem; }

/* ---------- RIWAYAT ---------- */
.riwayat-card { transition: transform 0.2s; }
.riwayat-card:hover { transform: translateY(-3px); }
.riwayat-img {
    width: 100%; height: 180px; object-fit: cover;
    border-radius: 14px 14px 0 0;
}

/* ---------- MONITOR ---------- */
.monitor-item {
    display: flex; gap: 12px;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #f0f2f5;
}
.monitor-thumb {
    width: 56px; height: 56px;
    object-fit: cover; border-radius: 10px;
    cursor: pointer; flex-shrink: 0;
}
.monitor-info { flex: 1; min-width: 0; }
.search-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; }

/* ---------- NEWS / RSS ---------- */
.news-list { list-style: none; padding: 0; margin: 0; }
.news-list li { padding: 0.6rem 0; border-bottom: 1px solid #f0f2f5; }
.news-list li:last-child { border-bottom: none; }
.news-list a { color: var(--sw-dark); text-decoration: none; font-size: 0.85rem; font-weight: 500; display: block; }
.news-list a:hover { color: var(--sw-blue); }
.news-time { font-size: 0.72rem; color: #aaa; display: block; margin-top: 2px; }

.news-item { padding: 0.8rem 0; border-bottom: 1px solid #f0f2f5; }
.news-item:last-child { border-bottom: none; }
.news-title { color: var(--sw-dark); text-decoration: none; font-weight: 600; font-size: 0.92rem; }
.news-title:hover { color: var(--sw-blue); }
.news-desc { font-size: 0.82rem; color: #777; margin: 4px 0; }

/* ---------- WEATHER ---------- */
.weather-box { text-align: center; padding: 1rem 0; }
.weather-box img { width: 100px; height: 100px; }
.weather-temp { font-size: 2.8rem; font-weight: 700; color: var(--sw-dark); line-height: 1; }
.weather-city { font-size: 1.1rem; font-weight: 600; color: #555; }
.weather-desc { color: #888; margin-bottom: 1rem; }
.weather-detail { display: flex; justify-content: center; gap: 1.2rem; font-size: 0.85rem; color: #666; }
.weather-detail i { color: var(--sw-blue); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
    .stat-num { font-size: 1.3rem; }
    .page-head h2 { font-size: 1.25rem; }
}
