/* ===== SK Detective Agency — Core Styles ===== */
:root {
    --sd-navy: #14202e;
    --sd-navy-light: #1c2e42;
    --sd-accent: #c0392b;
    --sd-accent-light: #e74c3c;
    --sd-bg: #f4f6f8;
    --sd-text-muted: #6b7785;
    --sd-border: #e3e7ec;
    --sidebar-width: 250px;
}

* { box-sizing: border-box; }

body {
    background: var(--sd-bg);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: #222;
}

/* ===== Login Page ===== */
.login-page {
    background: linear-gradient(135deg, var(--sd-navy) 0%, #0a1119 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-wrapper { width: 100%; max-width: 400px; padding: 1rem; }
.login-card {
    background: #fff;
    border-radius: 14px;
    padding: 2.5rem 2rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.35);
}
.login-logo {
    width: 64px; height: 64px;
    background: var(--sd-accent);
    color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem;
    margin: 0 auto;
}
.toggle-pass { cursor: pointer; }

.form-text {
    margin-top: .25rem;
    font-size: .875em;
    color: #c0392b !important;
}
/* ===== App Shell ===== */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--sd-navy);
    color: #cfd8e3;
    flex-shrink: 0;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease;
}
.sidebar-brand {
    display: flex; align-items: center; gap: .6rem;
    padding: 1.3rem 1.2rem;
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand i { color: var(--sd-accent-light); font-size: 1.4rem; }
.sidebar-brand small { font-weight: 400; opacity: .6; display: block; font-size: .65rem; letter-spacing: .1em; }

.sidebar-nav { flex: 1; padding: 1rem 0.7rem; overflow-y: auto; }
.sidebar-nav .nav-link, .sidebar-footer .nav-link {
    color: #aab6c4;
    padding: .65rem .9rem;
    border-radius: 8px;
    display: flex; align-items: center; gap: .7rem;
    font-size: .92rem;
    margin-bottom: .15rem;
    transition: background .15s, color .15s;
}
.sidebar-nav .nav-link i, .sidebar-footer .nav-link i { font-size: 1.05rem; width: 20px; text-align: center; }
.sidebar-nav .nav-link:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar-nav .nav-link.active { background: var(--sd-accent); color: #fff; }
.sidebar-footer { padding: 1rem .7rem; border-top: 1px solid rgba(255,255,255,0.08); }

.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1030;
}

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid var(--sd-border);
    padding: .8rem 1.3rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}
.topbar-title { flex: 1; font-weight: 600; color: var(--sd-navy); }
.btn-toggle-sidebar {
    border: none; background: none; font-size: 1.4rem; color: var(--sd-navy);
    display: none;
}

.page-body { padding: 1.5rem; flex: 1; }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .btn-toggle-sidebar { display: inline-block; }
    .sidebar-overlay.show { display: block; }
}

/* ===== Stat Cards ===== */
.stat-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--sd-border);
    padding: 1.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 100%;
}
.stat-icon {
    width: 52px; height: 52px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    flex-shrink: 0;
}
.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--sd-navy); line-height: 1.1; }
.stat-label { font-size: .8rem; color: var(--sd-text-muted); }

/* ===== Tables / Cards ===== */
.card-panel {
    background: #fff;
    border: 1px solid var(--sd-border);
    border-radius: 12px;
}
.card-panel .card-header {
    background: #fff;
    border-bottom: 1px solid var(--sd-border);
    font-weight: 600;
    color: var(--sd-navy);
}
.table thead th {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--sd-text-muted);
    border-bottom-width: 1px;
    white-space: nowrap;
}
.table td { vertical-align: middle; font-size: .9rem; }

.badge-status-open { background: #e8f6ee; color: #1e8a4c; font-weight: 600; }
.badge-status-pending { background: #fef6e0; color: #b8860b; font-weight: 600; }
.badge-status-closed { background: #eceff3; color: #5a6472; font-weight: 600; }

.badge-type {
    background: #eef2ff;
    color: #3b4fb8;
    font-weight: 500;
    font-size: .72rem;
}

.fee-balance-pos { color: var(--sd-accent); font-weight: 600; }
.fee-balance-zero { color: #1e8a4c; font-weight: 600; }

/* form */
.form-label { font-size: .85rem; font-weight: 600; color: #44505e; }
.section-divider {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--sd-accent);
    font-weight: 700;
    margin: 1.4rem 0 .8rem;
    padding-bottom: .4rem;
    border-bottom: 2px solid var(--sd-border);
}
.section-divider:first-child { margin-top: 0; }

.comment-item {
    border-left: 3px solid var(--sd-accent);
    background: #fafbfc;
    padding: .6rem .9rem;
    border-radius: 0 8px 8px 0;
    margin-bottom: .6rem;
}
.comment-meta { font-size: .75rem; color: var(--sd-text-muted); }
