/* dmpi_osa_go — mockup styles
   System font stack, neutral palette, one accent, dense business UI. */

:root {
    --bg:        #f7f8fa;
    --surface:   #ffffff;
    --border:    #e4e7eb;
    --border-2:  #cbd2d9;
    --text:      #1f2933;
    --text-mute: #616e7c;
    --text-dim:  #9aa5b1;
    --accent:    #2867d2;
    --accent-bg: #e8f0fe;
    --ok:        #1f7a3a;
    --ok-bg:     #e3f5e9;
    --warn:      #8a5a00;
    --warn-bg:   #fdf3d9;
    --err:       #a52727;
    --err-bg:    #fae5e5;
    --radius:    4px;
    --shadow:    0 1px 2px rgba(15, 23, 42, 0.04);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.45;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- layout ---------- */
.app {
    display: grid;
    grid-template-columns: 220px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: #0f172a;
    color: #cbd5e1;
    padding: 16px 0;
    display: flex;
    flex-direction: column;
}
.sidebar .brand {
    padding: 4px 20px 20px;
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.2px;
    border-bottom: 1px solid #1e293b;
    margin-bottom: 12px;
}
.sidebar .brand small {
    display: block;
    color: #64748b;
    font-weight: 400;
    font-size: 11px;
    margin-top: 2px;
}
.sidebar h6 {
    margin: 16px 20px 6px;
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.sidebar a {
    display: block;
    color: #cbd5e1;
    padding: 6px 20px;
    border-left: 3px solid transparent;
}
.sidebar a:hover {
    background: #1e293b;
    color: #fff;
    text-decoration: none;
}
.sidebar a.active {
    background: #1e293b;
    border-left-color: var(--accent);
    color: #fff;
}
.sidebar .user {
    margin-top: auto;
    padding: 12px 20px;
    border-top: 1px solid #1e293b;
    color: #94a3b8;
    font-size: 12px;
}

.main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.topbar h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}
.topbar .crumbs {
    color: var(--text-dim);
    font-size: 13px;
}
.topbar .crumbs a { color: var(--text-mute); }
.topbar .actions { margin-left: auto; display: flex; gap: 8px; }

.content {
    padding: 20px 24px;
    flex: 1;
    overflow: auto;
}

/* ---------- cards ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}
.card-head {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}
.card-head h2 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}
.card-head .meta {
    color: var(--text-mute);
    font-size: 12px;
}
.card-head .actions { margin-left: auto; display: flex; gap: 6px; }
.card-body { padding: 16px; }
.card-body.padded-tight { padding: 8px; }
.card-body.padded-none { padding: 0; }

/* ---------- buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border-2);
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
}
.btn:hover { background: var(--bg); text-decoration: none; }
.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.btn-primary:hover { background: #1f53b5; color: #fff; }
.btn-danger {
    background: var(--surface);
    border-color: var(--border-2);
    color: var(--err);
}
.btn-danger:hover { background: var(--err-bg); }
.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-mute);
}
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-sm { padding: 3px 8px; font-size: 12px; }

/* ---------- tables ---------- */
table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
table.data th, table.data td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}
table.data th {
    background: var(--bg);
    font-weight: 600;
    color: var(--text-mute);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
table.data tr:hover td { background: #fafbfc; }
table.data tr.editable td { cursor: text; }
table.data tr.editable:hover td { background: var(--accent-bg); }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td.shrink { width: 1%; white-space: nowrap; }

/* ---------- badges ---------- */
.badge {
    display: inline-block;
    padding: 1px 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-radius: 10px;
    background: var(--bg);
    color: var(--text-mute);
    border: 1px solid var(--border);
}
.badge.ok    { background: var(--ok-bg);   color: var(--ok);   border-color: transparent; }
.badge.warn  { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge.err   { background: var(--err-bg);  color: var(--err);  border-color: transparent; }
.badge.info  { background: var(--accent-bg); color: var(--accent); border-color: transparent; }

/* ---------- forms ---------- */
label.field { display: block; margin-bottom: 12px; }
label.field .lbl {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-mute);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
input[type=text], input[type=email], input[type=password],
input[type=date], input[type=number], select, textarea {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    background: var(--surface);
    font: inherit;
    color: var(--text);
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-bg);
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

/* ---------- stat cards ---------- */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: var(--shadow);
}
.stat .label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-mute);
    font-weight: 600;
}
.stat .value {
    font-size: 24px;
    font-weight: 600;
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
}
.stat .delta {
    font-size: 12px;
    color: var(--text-mute);
    margin-top: 2px;
}
.stat .delta.up   { color: var(--ok); }
.stat .delta.down { color: var(--err); }

/* ---------- toolbar (above tables) ---------- */
.toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}
.toolbar input.search {
    width: 280px;
    padding: 5px 10px;
}
.toolbar .right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.toolbar .count { color: var(--text-mute); font-size: 12px; }

/* ---------- progress ---------- */
.progress {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 100px;
    height: 8px;
    overflow: hidden;
}
.progress > div {
    height: 100%;
    background: var(--accent);
    transition: width 0.3s ease;
}
.progress-row {
    display: grid;
    grid-template-columns: 80px 1fr 60px;
    gap: 12px;
    align-items: center;
    font-size: 12px;
}

/* ---------- dropzone ---------- */
.dropzone {
    border: 2px dashed var(--border-2);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    background: var(--bg);
    color: var(--text-mute);
}
.dropzone.active {
    border-color: var(--accent);
    background: var(--accent-bg);
    color: var(--accent);
}
.dropzone .big {
    font-size: 16px;
    color: var(--text);
    font-weight: 500;
    margin-bottom: 4px;
}

/* ---------- log stream ---------- */
.log {
    background: #0f172a;
    color: #cbd5e1;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    line-height: 1.6;
    max-height: 320px;
    overflow: auto;
}
.log .ts  { color: #64748b; }
.log .ok  { color: #4ade80; }
.log .warn{ color: #fbbf24; }
.log .err { color: #f87171; }

/* ---------- login ---------- */
.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: var(--bg);
}
.login-card {
    width: 360px;
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}
.login-card h1 {
    margin: 0 0 4px;
    font-size: 18px;
}
.login-card p.sub {
    margin: 0 0 20px;
    color: var(--text-mute);
    font-size: 13px;
}
