/* DMARCMon by visuaFUSION - application styles. Dependency-free. */
:root {
    --bg: #f4f6f9;
    --panel: #ffffff;
    --ink: #1f2933;
    --ink-soft: #52606d;
    --muted: #7b8794;
    --line: #e4e7eb;
    --brand: #0f9d8f;        /* teal */
    --brand-dark: #0b7d72;
    --accent: #2f80ed;       /* blue */
    --good: #27ae60;
    --warn: #f2994a;
    --bad: #eb5757;
    --purple: #9b51e0;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(16,24,40,.06), 0 1px 2px rgba(16,24,40,.04);
    --shadow-lg: 0 8px 24px rgba(16,24,40,.10);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.5; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5rem; font-weight: 650; color: var(--ink); }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
small { color: var(--muted); }
code { background: #eef1f5; padding: .1rem .35rem; border-radius: 4px; font-size: .85em; }

/* Layout shell */
.shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 236px; background: #0f2027; color: #cfd8dc; flex-shrink: 0;
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { display: block; padding: 1rem 1rem .9rem; border-bottom: 1px solid rgba(255,255,255,.08); text-align: center; }
.sidebar .brand:hover { text-decoration: none; }
.sidebar .brand-logo { display: block; width: 100%; max-width: 184px; height: auto; margin: 0 auto; }
.sidebar .brand-by { display: block; font-size: .64rem; color: #8fa3ab; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; margin-top: 5px; }
.sidebar nav { padding: .6rem .6rem; flex: 1; overflow-y: auto; }
.sidebar nav a { display: flex; align-items: center; gap: .6rem; color: #b8c4cc; padding: .55rem .8rem; border-radius: 8px; margin-bottom: 2px; font-weight: 500; }
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.sidebar nav a.active { background: var(--brand); color: #fff; }
.sidebar nav .group { text-transform: uppercase; font-size: .68rem; letter-spacing: .8px; color: #6b7c85; padding: .9rem .8rem .3rem; }
.sidebar .who { padding: .9rem 1rem; border-top: 1px solid rgba(255,255,255,.08); font-size: .82rem; color: #90a0a8; }
.sidebar .who strong { color: #e3e8eb; display: block; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { background: var(--panel); border-bottom: 1px solid var(--line); padding: .75rem 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; position: sticky; top: 0; z-index: 20; }
.topbar .title { font-size: 1.05rem; font-weight: 650; }
.content { padding: 1.5rem; max-width: 1400px; width: 100%; margin: 0 auto; }

/* Cards + grid */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.2rem; }
.card h2, .card h3 { margin-top: 0; }
.card .sub { color: var(--muted); font-size: .85rem; margin: -.25rem 0 1rem; }
.grid { display: grid; gap: 1.1rem; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.dash { grid-template-columns: 1.4fr 1.4fr 1fr; }
@media (max-width: 1100px){ .grid.cols-3,.grid.cols-4,.grid.dash{ grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px){ .grid.cols-2,.grid.cols-3,.grid.cols-4,.grid.dash{ grid-template-columns: 1fr; } .sidebar{ display:none; } }

/* Stat tiles */
.stat { display: flex; flex-direction: column; gap: .2rem; }
.stat .label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .4px; }
.stat .value { font-size: 1.8rem; font-weight: 700; }
.stat .value.good { color: var(--good); }
.stat .value.warn { color: var(--warn); }
.stat .value.bad { color: var(--bad); }
.stat .meta { color: var(--muted); font-size: .8rem; }

/* Gauge (compliance ring) */
.gauge { display: flex; align-items: center; gap: 1rem; }
.gauge .pct { font-size: 1.6rem; font-weight: 700; }

/* Badges */
.badge { display: inline-block; padding: .15rem .5rem; border-radius: 999px; font-size: .74rem; font-weight: 600; }
.badge.good { background: #e3f6ec; color: #1e7e45; }
.badge.warn { background: #fef1e3; color: #b46a1e; }
.badge.bad  { background: #fde8e8; color: #b32020; }
.badge.info { background: #e7f0fd; color: #2160b0; }
.badge.muted{ background: #eef1f5; color: #5b6b78; }

/* Tables */
table.data { width: 100%; border-collapse: collapse; font-size: .86rem; }
table.data th, table.data td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data th { color: var(--ink-soft); font-weight: 600; background: #fafbfc; position: sticky; top: 0; }
table.data tr:hover td { background: #fafbfc; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); }
.table-wrap table.data th, .table-wrap table.data td { white-space: nowrap; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .9rem; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-weight: 600; cursor: pointer; font-size: .86rem; }
.btn:hover { background: #f5f7f9; text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { background: #fff; border-color: #f0c2c2; color: var(--bad); }
.btn.danger:hover { background: #fdecec; }
.btn.sm { padding: .3rem .6rem; font-size: .78rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Forms */
.form-row { margin-bottom: .9rem; }
.form-row label { display: block; font-weight: 600; margin-bottom: .3rem; font-size: .85rem; }
.form-row .hint { color: var(--muted); font-size: .8rem; margin-top: .25rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea {
    width: 100%; padding: .5rem .6rem; border: 1px solid #cbd2d9; border-radius: 8px; font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15,157,143,.12); }
.checkline { display: flex; align-items: center; gap: .5rem; }
.checkline input { width: auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
@media (max-width: 640px){ .form-grid{ grid-template-columns: 1fr; } }

/* Filters (date range pills) */
.filters { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.filters a.pill { padding: .35rem .75rem; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink-soft); font-weight: 600; font-size: .82rem; }
.filters a.pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.filters a.pill:hover { text-decoration: none; }

/* Flash */
.flash { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-weight: 500; }
.flash.success { background: #e3f6ec; color: #1e7e45; border: 1px solid #b7e4c9; }
.flash.error { background: #fde8e8; color: #b32020; border: 1px solid #f2c0c0; }

/* Banner */
.banner { background: #fff8e6; border: 1px solid #f4e2a8; color: #8a6d1a; padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; }

/* Legend */
.legend { list-style: none; padding: 0; margin: .5rem 0 0; font-size: .82rem; }
.legend li { display: flex; align-items: center; gap: .5rem; padding: .15rem 0; color: var(--ink-soft); }
.legend .dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.legend .val { margin-left: auto; font-weight: 600; color: var(--ink); }

/* Page header */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.page-head .actions { display: flex; gap: .5rem; }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.copy-field { display: flex; gap: .5rem; align-items: stretch; }
.copy-field input { font-family: ui-monospace, monospace; font-size: .82rem; }

.muted-box { background: #f7f9fb; border: 1px dashed var(--line); border-radius: 8px; padding: .8rem 1rem; }
ol.steps { margin: .3rem 0 .3rem 1.1rem; padding: 0; }
ol.steps li { margin-bottom: .5rem; }

.spread { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.dim { color: var(--muted); }
hr.soft { border: none; border-top: 1px solid var(--line); margin: 1rem 0; }
