/* ===== SIMPROKER Custom Styles ===== */
:root {
    --sp-primary: #1a3a6b;
    --sp-primary-dark: #122a4f;
    --sp-accent: #2f6fed;
    --sp-bg: #f2f5fa;
}

body {
    background: var(--sp-bg);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
}

/* Layout */
.app-wrapper { display: flex; min-height: 100vh; }

.app-sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--sp-primary) 0%, var(--sp-primary-dark) 100%);
    color: #fff;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform .25s ease;
}

.app-sidebar .sidebar-brand {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.app-sidebar .sidebar-brand .brand-icon {
    width: 38px; height: 38px;
    background: var(--sp-accent);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.app-sidebar .sidebar-brand .brand-title {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: .5px;
    line-height: 1.1;
}

.app-sidebar .sidebar-brand .brand-sub {
    font-size: .68rem;
    opacity: .7;
    letter-spacing: 1px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: .75rem .6rem 2rem;
}

.sidebar-nav .nav-section {
    font-size: .66rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255, 255, 255, .45);
    padding: .9rem .6rem .35rem;
    font-weight: 700;
}

.sidebar-nav a.nav-link {
    color: rgba(255, 255, 255, .78);
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem .75rem;
    border-radius: .5rem;
    font-size: .875rem;
    margin-bottom: 2px;
}

.sidebar-nav a.nav-link i { font-size: 1.05rem; width: 1.25rem; text-align: center; }

.sidebar-nav a.nav-link:hover {
    background: rgba(255, 255, 255, .1);
    color: #fff;
}

.sidebar-nav a.nav-link.active {
    background: var(--sp-accent);
    color: #fff;
    font-weight: 600;
}

.sidebar-nav .nav-badge {
    margin-left: auto;
    font-size: .68rem;
}

/* Main */
.app-main {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-topbar {
    background: #fff;
    border-bottom: 1px solid #e3e8f0;
    padding: .6rem 1.25rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.app-content { padding: 1.25rem; flex: 1; }

/* Sidebar backdrop mobile */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 1035;
}

/* Mobile */
@media (max-width: 991.98px) {
    .app-sidebar { transform: translateX(-100%); }
    .app-sidebar.show { transform: translateX(0); }
    .sidebar-backdrop.show { display: block; }
    .app-main { margin-left: 0; }
    .app-content { padding: 1rem .75rem; }
}

/* Cards */
.stat-card {
    border: none;
    border-radius: .9rem;
    box-shadow: 0 1px 3px rgba(16, 35, 67, .08);
    transition: transform .15s ease, box-shadow .15s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(16, 35, 67, .12); }
.stat-card .stat-icon {
    width: 46px; height: 46px;
    border-radius: .7rem;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.35rem;
}
.card { border: none; border-radius: .9rem; box-shadow: 0 1px 3px rgba(16, 35, 67, .07); }
.card-header { background: #fff; border-bottom: 1px solid #edf1f7; border-radius: .9rem .9rem 0 0 !important; font-weight: 600; }

.page-title { font-weight: 700; color: #16233a; font-size: 1.35rem; }

/* Progress bar */
.progress { border-radius: 999px; background: #e9eef6; }
.progress-bar { border-radius: 999px; }

/* Tables */
.table thead th {
    background: #f7f9fc;
    color: #4a5a75;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .6px;
    border-bottom: 1px solid #e6ebf3 !important;
    white-space: nowrap;
}
.table td { vertical-align: middle; font-size: .875rem; }

/* Work number pill */
.work-number {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .74rem;
    color: var(--sp-primary);
    font-weight: 600;
}

/* Timeline */
.activity-timeline { position: relative; padding-left: 1.75rem; }
.activity-timeline::before {
    content: '';
    position: absolute;
    left: .48rem; top: .4rem; bottom: .4rem;
    width: 2px;
    background: #e4e9f2;
}
.activity-timeline .timeline-item { position: relative; padding-bottom: 1.1rem; }
.activity-timeline .timeline-item:last-child { padding-bottom: 0; }
.activity-timeline .timeline-dot {
    position: absolute;
    left: -1.75rem;
    top: .2rem;
    width: 1rem; height: 1rem;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--sp-accent);
}

/* Map */
#monitoring-map, .work-map { border-radius: .9rem; z-index: 1; }
.map-preview { height: 320px; }
.map-full { height: calc(100vh - 210px); min-height: 420px; }

.leaflet-popup-content { font-size: .82rem; min-width: 220px; }

/* Auth pages */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--sp-primary) 0%, var(--sp-primary-dark) 60%, #0c1f3d 100%);
    padding: 1.5rem;
}
.auth-card {
    width: 100%;
    max-width: 420px;
    border-radius: 1rem;
    border: none;
}
.auth-brand-icon {
    width: 56px; height: 56px;
    background: var(--sp-accent);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem;
    color: #fff;
}

/* Tab pills */
.nav-pills .nav-link { border-radius: .6rem; font-size: .85rem; padding: .45rem .9rem; }
.nav-pills .nav-link.active { background: var(--sp-primary); }

/* Evidence gallery */
.evidence-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: .5rem;
    cursor: pointer;
}

/* GPS box */
.gps-box {
    background: #f0f5ff;
    border: 1px dashed #a9c1f0;
    border-radius: .6rem;
    padding: .65rem .9rem;
    font-size: .8rem;
}

/* Notification dropdown */
.notification-list .dropdown-item { white-space: normal; line-height: 1.35; }
.notification-item.unread { background: #eef4ff; }

/* Mobile action buttons */
.mobile-actions .btn { font-size: .8rem; }

/* Login hint */
.demo-accounts { font-size: .75rem; }

/* Print/PDF */
@media print {
    .app-sidebar, .app-topbar, .no-print, .btn { display: none !important; }
    .app-main { margin-left: 0; }
}

/* Small utilities */
.text-xs { font-size: .74rem; }
.cursor-pointer { cursor: pointer; }
.fw-600 { font-weight: 600; }
