﻿/* ═══════════════════════════════════════════════════════════════
   ScanSecure — MSP Portal Design System
   ═══════════════════════════════════════════════════════════════ */

:root {
    --msp: #1e3a5f;
    --msp-light: #2d5a8f;
    --msp-hover: #162d4a;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --bg: #f1f5f9;
    --bg-card: #ffffff;
    --bg-hover: #f8fafc;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --critical: #dc2626;
    --critical-bg: #fef2f2;
    --critical-border: #fecaca;
    --high: #ea580c;
    --high-bg: #fff7ed;
    --medium: #d97706;
    --medium-bg: #fffbeb;
    --low: #16a34a;
    --low-bg: #f0fdf4;
    --low-border: #bbf7d0;
    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-sm: 0 1px 4px rgba(0,0,0,0.07);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.09);
    --sidebar-w: 240px;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg);
}

a {
    color: var(--msp);
    text-decoration: none;
}

    a:hover {
        text-decoration: underline;
    }

/* ── Layout ── */
.msp-layout {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ── */
.msp-sidebar {
    width: var(--sidebar-w);
    background: var(--msp);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100;
    scrollbar-width: none;
}

    .msp-sidebar::-webkit-scrollbar {
        display: none;
    }

.msp-brand {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.msp-brand-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
}

.msp-brand-icon {
    font-size: 1.25rem;
}

.msp-brand-name {
    color: white;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.msp-name {
    color: rgba(255,255,255,0.65);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.msp-nav-group {
    padding: 0.75rem 0 0.25rem;
}

.msp-nav-label {
    color: rgba(255,255,255,0.3);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 0 1.125rem 0.375rem;
}

.msp-nav-list {
    list-style: none;
    padding: 0 0.625rem;
}

    .msp-nav-list li a {
        display: flex;
        align-items: center;
        gap: 0.625rem;
        padding: 0.45rem 0.75rem;
        border-radius: var(--radius-sm);
        color: rgba(255,255,255,0.6);
        font-size: 13.5px;
        font-weight: 400;
        margin-bottom: 1px;
        transition: background 0.1s, color 0.1s;
    }

        .msp-nav-list li a:hover {
            background: rgba(255,255,255,0.08);
            color: rgba(255,255,255,0.95);
            text-decoration: none;
        }

        .msp-nav-list li a.active {
            background: rgba(255,255,255,0.14);
            color: white;
            font-weight: 500;
        }

.msp-nav-icon {
    font-size: 14px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.msp-sidebar-footer {
    margin-top: auto;
    padding: 0.875rem 1rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.msp-user-card {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.75rem;
}

.msp-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.msp-user-name {
    color: white;
    font-size: 13px;
    font-weight: 500;
}

.msp-user-role {
    color: rgba(255,255,255,0.4);
    font-size: 11px;
}

.btn-logout {
    width: 100%;
    padding: 0.45rem 0.75rem;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.65);
    font-size: 12.5px;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    transition: background 0.1s, color 0.1s;
}

    .btn-logout:hover {
        background: rgba(255,255,255,0.13);
        color: white;
    }

/* ── Main ── */
.msp-main {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-height: 100vh;
    background: var(--bg);
}

.msp-content {
    padding: 1.75rem 2rem;
    max-width: 1400px;
}

/* ── Page structure ── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 3px;
}

/* ── Cards ── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

/* ── Stat cards ── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4px;
}

.stat-green .stat-value {
    color: var(--low);
}

.stat-yellow .stat-value {
    color: var(--medium);
}

.stat-red .stat-value {
    color: var(--critical);
}

.stat-blue .stat-value {
    color: #1d4ed8;
}

/* ── Tables ── */
.table-wrap {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

    .data-table th {
        background: #f8fafc;
        padding: 0.625rem 1rem;
        text-align: left;
        font-size: 11px;
        font-weight: 700;
        color: var(--text-secondary);
        text-transform: uppercase;
        letter-spacing: 0.06em;
        border-bottom: 1px solid var(--border);
        white-space: nowrap;
    }

    .data-table td {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid #f1f5f9;
        color: var(--text-primary);
        vertical-align: middle;
    }

    .data-table tbody tr:last-child td {
        border-bottom: none;
    }

    .data-table tbody tr:hover td {
        background: var(--bg-hover);
    }

    .data-table tr.clickable {
        cursor: pointer;
    }

.table-footer {
    padding: 0.625rem 1rem;
    font-size: 12px;
    color: var(--text-muted);
    background: #f8fafc;
    border-top: 1px solid var(--border);
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: filter 0.12s;
    line-height: 1.4;
}

    .btn:hover {
        filter: brightness(0.93);
        text-decoration: none;
    }

    .btn:disabled {
        opacity: 0.45;
        cursor: not-allowed;
        filter: none;
    }

.btn-primary {
    background: var(--msp);
    color: white;
}

.btn-danger {
    background: var(--critical);
    color: white;
}

.btn-success {
    background: var(--low);
    color: white;
}

.btn-warning {
    background: var(--medium);
    color: white;
}

.btn-ghost {
    background: #f1f5f9;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-outline {
    background: white;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-purple {
    background: #7c3aed;
    color: white;
}

.btn-lg {
    padding: 0.625rem 1.375rem;
    font-size: 15px;
    border-radius: var(--radius-lg);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

.btn-xs {
    padding: 0.25rem 0.625rem;
    font-size: 11.5px;
    border-radius: var(--radius-sm);
}

.btn-full {
    width: 100%;
}

/* ── Badges ── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-critical {
    background: var(--critical-bg);
    color: var(--critical);
    border: 1px solid var(--critical-border);
}

.badge-high {
    background: var(--high-bg);
    color: var(--high);
}

.badge-medium {
    background: var(--medium-bg);
    color: var(--medium);
}

.badge-low {
    background: var(--low-bg);
    color: var(--low);
    border: 1px solid var(--low-border);
}

.badge-info {
    background: #f0f9ff;
    color: #0284c7;
    border: 1px solid #bae6fd;
}

.badge-neutral {
    background: #f1f5f9;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.status-active {
    background: var(--low-bg);
    color: var(--low);
    border: 1px solid var(--low-border);
}

.status-trial {
    background: var(--medium-bg);
    color: var(--medium);
    border: 1px solid #fde68a;
}

.status-suspended {
    background: var(--critical-bg);
    color: var(--critical);
    border: 1px solid var(--critical-border);
}

/* ── Forms ── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 1rem;
}

.form-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control, .form-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 13.5px;
    color: var(--text-primary);
    background: white;
    transition: border-color 0.12s, box-shadow 0.12s;
    box-sizing: border-box;
}

    .form-control:focus, .form-select:focus {
        outline: none;
        border-color: var(--msp);
        box-shadow: 0 0 0 3px rgba(30,58,95,0.08);
    }

/* ── Alerts ── */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 13.5px;
    border: 1px solid transparent;
    margin-bottom: 1rem;
}

.alert-success {
    background: var(--low-bg);
    color: #166534;
    border-color: var(--low-border);
}

.alert-danger {
    background: var(--critical-bg);
    color: #991b1b;
    border-color: var(--critical-border);
}

.alert-warning {
    background: var(--medium-bg);
    color: #92400e;
    border-color: #fde68a;
}

.alert-info {
    background: #f0f9ff;
    color: #0369a1;
    border-color: #bae6fd;
}

/* ── Filter bar ── */
.filter-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    font-size: 13.5px;
    font-family: inherit;
    background: white;
}

    .search-input:focus {
        outline: none;
        border-color: var(--msp);
        box-shadow: 0 0 0 3px rgba(30,58,95,0.08);
    }

.filter-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    font-size: 13px;
    background: white;
    color: var(--text-primary);
    font-family: inherit;
}

/* ── Modals ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    padding: 1.5rem;
    backdrop-filter: blur(2px);
}

.modal-box {
    background: white;
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

    .modal-header h3 {
        font-size: 16px;
        font-weight: 600;
        color: var(--text-primary);
        margin: 0;
    }

.modal-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-muted);
}

/* ── Toast ── */
.status-toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-lg);
    font-size: 13.5px;
    font-weight: 500;
    z-index: 400;
    box-shadow: var(--shadow-md);
    border: 1px solid transparent;
    max-width: 360px;
}

.toast-info {
    background: var(--low-bg);
    border-color: var(--low-border);
    color: #166534;
}

.toast-error {
    background: var(--critical-bg);
    border-color: var(--critical-border);
    color: #991b1b;
}

/* ── Login page ── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #0f172a 0%, #1e3a5f 60%, #2d5a8f 100%);
    padding: 1.5rem;
}

.login-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.35);
}

.login-logo {
    text-align: center;
    margin-bottom: 1.75rem;
}

    .login-logo h1 {
        font-size: 22px;
        font-weight: 800;
        color: var(--text-primary);
        margin: 0 0 4px;
        letter-spacing: -0.02em;
    }

.login-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

/* ── Billing card ── */
.billing-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.billing-amount {
    font-size: 32px;
    font-weight: 800;
    color: var(--msp);
    letter-spacing: -0.02em;
    line-height: 1;
}

.billing-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ── Misc ── */
.loading {
    color: var(--text-muted);
    font-size: 14px;
    padding: 2rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
    font-size: 14px;
}

.text-muted {
    color: var(--text-muted);
}

.text-success {
    color: var(--low);
}

.text-danger {
    color: var(--critical);
}

.fw-600 {
    font-weight: 600;
}

.fw-700 {
    font-weight: 700;
}

.action-btns {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 0.875rem;
}

    .section-header h3 {
        font-size: 14px;
        font-weight: 600;
        color: var(--text-primary);
        margin: 0;
    }

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   STYLE REFRESH â€” landing-page polish (light theme)
   Appended block. Remove this whole section to revert.
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

/* Typography â€” Sora for a refined, modern feel */
body {
  font-family: 'Sora', 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  letter-spacing: -0.006em;
}
.page-title, .card-title, h1, h2, h3 {
  font-family: 'Sora', 'Inter', system-ui, sans-serif;
  letter-spacing: -0.02em;
}
.page-title { font-weight: 700; }

/* Buttons â€” gradient primary, rounder corners, more presence */
.btn {
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  padding: 0.55rem 1.1rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn-primary {
  background: linear-gradient(135deg, #2a5298, #1e3a5f);
  color: #fff;
  box-shadow: 0 6px 16px -8px rgba(30, 58, 95, 0.6);
}
.btn-primary:hover {
  filter: none;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -8px rgba(30, 58, 95, 0.7);
}
.btn-secondary, .btn-ghost {
  background: #fff;
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
}
.btn-secondary:hover, .btn-ghost:hover {
  transform: translateY(-1px);
  border-color: var(--brand);
  background: #fff;
}
.btn-danger  { background: linear-gradient(135deg, #ef4444, #dc2626); box-shadow: 0 6px 16px -8px rgba(220,38,38,0.5); }
.btn-success { background: linear-gradient(135deg, #22c55e, #16a34a); box-shadow: 0 6px 16px -8px rgba(22,163,74,0.5); }
.btn-danger:hover, .btn-success:hover { filter: none; transform: translateY(-1px); }
.btn-lg { border-radius: 12px; }
.btn-sm { border-radius: 8px; }
.btn-xs { border-radius: 7px; }

/* Cards â€” softer border, refined shadow, smoother corners */
.card, .table-wrap {
  border: 1px solid #e6ecf5;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 8px 24px -16px rgba(15, 23, 42, 0.12);
  transition: box-shadow 0.2s ease;
}
.card-header { padding: 1.1rem 1.35rem; }
.card-body { padding: 1.35rem; }

/* KPI cards lift on hover (dashboard) */
.kpi-card {
  border-radius: 14px;
  border: 1px solid #e6ecf5;
}

/* Inputs â€” match the rounded refined look */
.form-control, input[type="text"], input[type="email"], input[type="password"], select, textarea {
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus, input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

/* Badges â€” slightly rounder */
.badge { border-radius: 7px; font-weight: 600; }


/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   SHARED CLASS POLISH â€” applies consistent look to all pages
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

/* Page titles a touch larger to match dashboard */
.page-title { font-size: 24px !important; letter-spacing: -0.025em; }
.page-subtitle { font-size: 14px !important; }

/* Empty states get a card container so they don't float */
.empty-state {
  background: #fff;
  border: 1px solid #e6ecf5;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(15,23,42,.04), 0 8px 24px -16px rgba(15,23,42,.12);
  padding: 3rem 1.5rem;
}

/* Generic table-wrap and card consistency (already softened by style-refresh) */
.table-wrap { border-radius: 14px; }

/* Section headings inside pages */
.section-title, .tab-hdr h3 {
  font-family: 'Sora', system-ui, sans-serif;
  letter-spacing: -0.01em;
}

/* Loading states consistent */
.loading { text-align: center; padding: 2.5rem; color: var(--text-muted); font-size: 14px; }

