/* ============================================================
   REGIIS SECURITY — Dashboard (Camtora-inspired)
   ============================================================ */
body.dashboard-body {
    background: #F4F6FA;
    color: #0A2540;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.92rem;
}

/* ---------- Navbar top ---------- */
.dashboard-navbar {
    background: linear-gradient(90deg, #0A2540 0%, #1F3A5F 100%);
    height: 60px;
    box-shadow: 0 2px 12px rgba(10,37,64,.18);
    z-index: 1030;
}
.dashboard-navbar .navbar-brand {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: #fff !important;
}

/* ---------- Container ---------- */
.dashboard-container {
    padding: 1.25rem;
    max-width: 100%;
}

/* ---------- Sidebar ---------- */
.dashboard-sidebar {
    padding: 0;
    position: sticky;
    top: 60px;
    height: calc(100vh - 60px);
    overflow-y: auto;
}
.sidebar-inner { padding: 1rem 0.75rem; }
.sidebar-section { margin-bottom: 1.25rem; }
.sidebar-section-title {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #94a3b8;
    margin: 0 0.75rem 0.5rem;
}
.dashboard-sidebar .nav-link {
    color: #334155;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.15rem;
    transition: all .2s ease;
}
.dashboard-sidebar .nav-link:hover {
    background: #E8EDF5;
    color: #C8102E;
}
.dashboard-sidebar .nav-link.active {
    background: #C8102E;
    color: #fff;
    box-shadow: 0 4px 12px rgba(200,16,46,.25);
}
.dashboard-sidebar .nav-link i { font-size: 1rem; width: 18px; text-align: center; }
.dashboard-sidebar .nav-link .badge {
    font-size: 0.68rem;
    padding: 0.2rem 0.5rem;
}

/* Mobile sidebar */
@media (max-width: 991.98px) {
    .dashboard-sidebar {
        position: fixed;
        top: 60px; left: 0; bottom: 0;
        width: 260px;
        background: #fff;
        z-index: 1020;
        transform: translateX(-100%);
        transition: transform .3s ease;
        box-shadow: 4px 0 20px rgba(10,37,64,.1);
    }
    .dashboard-sidebar.mobile-open { transform: translateX(0); }
    .dashboard-main { padding-left: 0 !important; }
}

/* ---------- Main content ---------- */
.dashboard-main {
    padding: 1rem 1.5rem 3rem;
}

/* ---------- Stat cards ---------- */
.stat-card {
    background: #fff;
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(10,37,64,.06);
    text-align: center;
    transition: all .25s ease;
    color: #0A2540;
    height: 100%;
    border: 1px solid #eef2f7;
}
a > .stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(10,37,64,.10);
    border-color: #C8102E;
}
.stat-card i {
    font-size: 1.6rem;
    color: #C8102E;
    display: block;
    margin-bottom: 0.35rem;
}
.stat-card-primary i { color: #0A2540; }
.stat-card-danger i { color: #dc3545; }
.stat-card-success i { color: #16a34a; }
.stat-value {
    font-family: 'Poppins', sans-serif;
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1;
}
.stat-label {
    color: #64748b;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.35rem;
}

/* ---------- Panels ---------- */
.panel {
    background: #fff;
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(10,37,64,.06);
    border: 1px solid #eef2f7;
}
.panel + .panel { margin-top: 1rem; }

/* ---------- Filter pills ---------- */
.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    background: #F1F5F9;
    color: #334155;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all .2s ease;
    border: 1px solid transparent;
}
.filter-pill:hover { background: #E2E8F0; color: #0A2540; }
.filter-pill.active { background: #0A2540; color: #fff; }
.filter-pill .count {
    background: rgba(255,255,255,.25);
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    font-size: 0.72rem;
}
.filter-pill.active .count { background: rgba(255,255,255,.3); }
.filter-pill.filter-new.active { background: #dc3545; }
.filter-pill.filter-read.active { background: #0284c7; }
.filter-pill.filter-replied.active { background: #16a34a; }
.filter-pill.filter-archived.active { background: #64748b; }

/* ---------- Status badges ---------- */
.badge { font-weight: 600; padding: 0.35rem 0.6rem; font-size: 0.72rem; border-radius: 6px; }
.badge-new { background: #fee2e2; color: #991b1b; }
.badge-read { background: #dbeafe; color: #1e40af; }
.badge-replied { background: #dcfce7; color: #166534; }
.badge-archived { background: #e2e8f0; color: #475569; }

/* ---------- Tables ---------- */
.table { font-size: 0.88rem; }
.table > :not(caption) > * > * { padding: 0.7rem 0.75rem; }
.table thead th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    border-bottom: 2px solid #eef2f7;
    font-weight: 700;
}
.table-hover tbody tr:hover { background: #F8FAFC; }

/* ---------- Forms ---------- */
.form-label {
    font-weight: 600;
    color: #334155;
    font-size: 0.82rem;
    margin-bottom: 0.35rem;
}
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 0.55rem 0.85rem;
    font-size: 0.9rem;
    transition: all .2s ease;
}
.form-control:focus, .form-select:focus {
    border-color: #C8102E;
    box-shadow: 0 0 0 3px rgba(200,16,46,.12);
}
.form-check-input:checked {
    background-color: #C8102E;
    border-color: #C8102E;
}
textarea.form-control { font-family: inherit; }

/* Buttons */
.btn { border-radius: 8px; font-weight: 600; font-size: 0.88rem; }
.btn-primary { background: #C8102E; border-color: #C8102E; }
.btn-primary:hover, .btn-primary:focus { background: #9A0B23; border-color: #9A0B23; }

/* ---------- Message detail ---------- */
.message-meta {
    display: grid;
    grid-template-columns: 100px 1fr;
    row-gap: 0.5rem;
    column-gap: 1rem;
    margin: 0;
    font-size: 0.9rem;
}
.message-meta dt { color: #64748b; font-weight: 600; font-size: 0.8rem; }
.message-meta dd { margin: 0; }
.message-body {
    background: #F8FAFC;
    padding: 1.25rem;
    border-radius: 8px;
    border-left: 3px solid #C8102E;
    font-size: 0.95rem;
    line-height: 1.65;
    color: #1e293b;
}

/* ---------- Response history ---------- */
.response-history { list-style: none; padding: 0; margin: 0; }
.response-history li {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: #F8FAFC;
    margin-bottom: 0.5rem;
    border-left: 3px solid #e2e8f0;
}
.response-history li.success { border-left-color: #16a34a; }
.response-history li.error { border-left-color: #dc3545; }

/* ---------- Login page ---------- */
body.dashboard-login-body {
    background: linear-gradient(135deg, #0A2540 0%, #C8102E 100%);
    font-family: 'Inter', sans-serif;
}
.login-card {
    background: #fff;
    padding: 2.25rem;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(10,37,64,.30);
}

/* ---------- Responsive ---------- */
@media (max-width: 767.98px) {
    .dashboard-container { padding: 0.75rem; }
    .dashboard-main { padding: 0.75rem; }
    .panel { padding: 1rem; }
    .stat-card { padding: 1rem; }
    .stat-value { font-size: 1.4rem; }
    .filter-pill { font-size: 0.76rem; padding: 0.3rem 0.65rem; }
}