/* ============================================================
   NQA-1 Audit360 — Design A Stylesheet
   Navy enterprise theme
   ============================================================ */

/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: Arial, sans-serif;
    font-size: 13px;
    color: #1a2540;
    background: #f2f4f8;
    min-height: 100vh;
}

a { color: #1a4fa0; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── App shell ────────────────────────────────────────────── */
.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-body {
    display: flex;
    flex: 1;
}

.app-main {
    flex: 1;
    padding: 28px;
    overflow: auto;
}

/* ── Topbar ───────────────────────────────────────────────── */
.topbar {
    background: #0f2744;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    flex-shrink: 0;
    position: relative;
}

.topbar-logo {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .02em;
    text-decoration: none;
}

.topbar-nav {
    display: flex;
    gap: 2px;
}

.topbar-nav a {
    color: rgba(255,255,255,.65);
    font-size: 13px;
    padding: 6px 14px;
    border-radius: 4px;
    text-decoration: none;
    transition: background .15s, color .15s;
}

.topbar-nav a:hover,
.topbar-nav a.active {
    background: rgba(255,255,255,.12);
    color: #fff;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-user-name {
    color: rgba(255,255,255,.7);
    font-size: 12px;
}

.topbar-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #1a4fa0;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.topbar-logout {
    color: rgba(255,255,255,.5);
    font-size: 12px;
    text-decoration: none;
    margin-left: 8px;
    padding: 5px 10px;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 4px;
    transition: all .15s;
}

.topbar-logout:hover {
    color: #fff;
    border-color: rgba(255,255,255,.5);
    text-decoration: none;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
    width: 200px;
    background: #f8f9fc;
    border-right: 1px solid #d8dde8;
    padding: 20px 0;
    flex-shrink: 0;
}

.sidebar-section {
    padding: 0 12px;
    margin-bottom: 24px;
}

.sidebar-section-title {
    font-size: 10px;
    font-weight: 700;
    color: #9aafcc;
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 0 8px;
    margin-bottom: 6px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border-radius: 4px;
    color: #3d4966;
    font-size: 13px;
    text-decoration: none;
    transition: background .12s, color .12s;
    cursor: pointer;
}

.sidebar-item:hover {
    background: #eaeff8;
    color: #1a2540;
    text-decoration: none;
}

.sidebar-item.active {
    background: #e8edf8;
    color: #1a4fa0;
    font-weight: 600;
}

.sidebar-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #c8d0e0;
    flex-shrink: 0;
}

.sidebar-item.active .sidebar-dot {
    background: #1a4fa0;
}

/* ── Page header ──────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-title {
    font-size: 20px;
    font-weight: 600;
    color: #1a2540;
}

.page-subtitle {
    font-size: 12px;
    color: #7a8499;
    margin-top: 3px;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: background .15s;
}

.btn-primary {
    background: #1a4fa0;
    color: #fff;
}
.btn-primary:hover { background: #153e80; color: #fff; text-decoration: none; }

.btn-secondary {
    background: #fff;
    color: #3d4966;
    border: 1px solid #d8dde8;
}
.btn-secondary:hover { background: #f0f3f8; text-decoration: none; }

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

.btn-danger {
    background: #fde8e8;
    color: #a32d2d;
    border: 1px solid #f5c1c1;
}

/* ── Stat cards ───────────────────────────────────────────── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 28px;
}

.stat-card {
    background: #fff;
    border: 1px solid #d8dde8;
    border-radius: 6px;
    padding: 16px 18px;
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 11px;
    color: #7a8499;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.stat-number.blue   { color: #1a4fa0; }
.stat-number.green  { color: #1a6e1a; }
.stat-number.amber  { color: #7a5000; }
.stat-number.red    { color: #a32d2d; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
    background: #fff;
    border: 1px solid #d8dde8;
    border-radius: 6px;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #eaeef5;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a2540;
}

.card-body {
    padding: 18px;
}

/* ── Tables ───────────────────────────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    background: #f8f9fc;
    padding: 10px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: #7a8499;
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 1px solid #d8dde8;
    white-space: nowrap;
}

.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #eaeef5;
    color: #1a2540;
    vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }

.data-table tr:hover td { background: #fafbfd; }

.data-table .col-name { font-weight: 600; }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.badge-blue   { background: #e8edf8; color: #1a4fa0; }
.badge-green  { background: #e4f5e3; color: #1a6e1a; }
.badge-amber  { background: #fff4e0; color: #7a5000; }
.badge-red    { background: #fde8e8; color: #a32d2d; }
.badge-gray   { background: #f0f2f7; color: #5a6478; }

/* ── Progress bar ─────────────────────────────────────────── */
.progress-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-bar {
    flex: 1;
    max-width: 100px;
    background: #eaeef5;
    border-radius: 2px;
    height: 6px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 2px;
    background: #1a6e1a;
    transition: width .3s;
}

.progress-fill.amber { background: #c47d00; }
.progress-fill.red   { background: #a32d2d; }

.progress-pct {
    font-size: 11px;
    color: #7a8499;
    min-width: 28px;
}

/* ── Forms ────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #3d4966;
    margin-bottom: 5px;
}

.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d8dde8;
    border-radius: 4px;
    font-size: 13px;
    color: #1a2540;
    background: #fff;
    transition: border-color .15s;
}

.form-control:focus {
    outline: none;
    border-color: #1a4fa0;
    box-shadow: 0 0 0 3px rgba(26,79,160,.08);
}

textarea.form-control { resize: vertical; min-height: 80px; }

/* ── Alerts ───────────────────────────────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 18px;
    border: 1px solid transparent;
}

.alert-success { background: #e4f5e3; color: #1a6e1a; border-color: #b8e0b6; }
.alert-error   { background: #fde8e8; color: #a32d2d; border-color: #f5c1c1; }
.alert-info    { background: #e8edf8; color: #1a4fa0; border-color: #c0d0ea; }

/* ── Footer ───────────────────────────────────────────────── */
.app-footer {
    background: #f8f9fc;
    border-top: 1px solid #d8dde8;
    padding: 12px 24px;
    font-size: 11px;
    color: #9aafcc;
    text-align: center;
}

/* ── Utilities ────────────────────────────────────────────── */
.text-muted  { color: #7a8499; }
.text-small  { font-size: 11px; }
.text-right  { text-align: right; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.w-100  { width: 100%; }
/* ============================================================
   Additional styles — consolidated from inline page blocks
   ============================================================ */

/* ── Standalone pages (auth, billing) ────────────────────── */
.standalone-body {
    font-family: 'DM Sans', Arial, sans-serif;
    background: #f2f4f8;
    color: #1a2540;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.standalone-topbar {
    background: #0f2744;
    padding: 0 40px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.standalone-topbar-logo {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.standalone-topbar-link {
    font-size: 13px;
    color: rgba(255,255,255,.6);
    text-decoration: none;
}
.standalone-topbar-link:hover { color: #fff; text-decoration: none; }
.standalone-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}
.auth-card {
    background: #fff;
    border-radius: 10px;
    padding: 40px 36px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 4px 24px rgba(15,39,68,.10);
}
.auth-card-wide { max-width: 520px; }
.auth-title {
    font-size: 26px;
    font-weight: 700;
    color: #0f2744;
    margin-bottom: 8px;
}
.auth-subtitle {
    font-size: 13px;
    color: #7a8499;
    margin-bottom: 28px;
    line-height: 1.6;
}
.auth-footer-link {
    text-align: center;
    margin-top: 18px;
    font-size: 12px;
    color: #7a8499;
}
.auth-footer-link a { color: #1a4fa0; }
.error-msg {
    background: #fde8e8;
    color: #a32d2d;
    border: 1px solid #f5c0c0;
    border-radius: 5px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 18px;
}
.success-msg {
    background: #eaf5ea;
    color: #1a6e1a;
    border: 1px solid #b8ddb8;
    border-radius: 5px;
    padding: 14px;
    font-size: 13px;
    margin-bottom: 18px;
    line-height: 1.6;
}
.name-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.niac-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #f8f9fc;
    border: 1px solid #d8dde8;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.niac-section {
    display: none;
    background: #f0f4ff;
    border: 1px solid #c0d0f0;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 16px;
}
.niac-section.visible { display: block; }
.niac-note {
    font-size: 11px;
    color: #7a8499;
    margin-top: 6px;
    line-height: 1.5;
}
.btn-submit {
    width: 100%;
    padding: 12px;
    background: #1a4fa0;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
    margin-top: 8px;
}
.btn-submit:hover { background: #153e80; }
.billing-card {
    background: #fff;
    border-radius: 12px;
    padding: 48px 40px;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: 0 4px 24px rgba(15,39,68,.10);
}
.workspace-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 28px;
}
.workspace-card {
    border: 2px solid #d8dde8;
    border-radius: 8px;
    padding: 24px 16px;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, transform .15s;
    text-align: center;
    background: #fff;
}
.workspace-card:hover {
    border-color: #1a4fa0;
    box-shadow: 0 4px 20px rgba(26,79,160,.12);
    transform: translateY(-2px);
}
.workspace-card.niac-card { border-color: #c0a030; background: #fffbf0; }
.workspace-card.niac-card:hover { border-color: #c9a84c; }
@media (max-width: 600px) {
    .workspace-grid  { grid-template-columns: 1fr; }
    .name-row        { grid-template-columns: 1fr; }
    .standalone-topbar { padding: 0 16px; }
    .auth-card       { padding: 28px 20px; }
}
