﻿@import url("https://fonts.googleapis.com/css2?family=Public+Sans:wght@300;400;500;600;700&display=swap");

:root {
  /* Paleta OnnixConnect */
  --navy-900: #0F172A;
  --navy-700: #1E293B;
  --navy-500: #2563EB;
  --accent-600: #2563EB;
  --accent-500: #3B82F6;
  --accent-300: #93C5FD;
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --bg-elevated: #F1F5F9;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --text: #1E293B;
  --text-heading: #0F172A;
  --text-muted: #64748B;
  --text-faint: #94A3B8;
  --ok: #16A34A;
  --err: #DC2626;
  --info: #2563EB;
  --warn: #F59E0B;
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-tint: rgba(37, 99, 235, 0.10);
  --primary-shadow: rgba(37, 99, 235, 0.15);
  --r-card: 12px;
  --font: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { font-family: var(--font); background: var(--bg); color: var(--text); margin: 0; font-size: 14px; }

.app-wrapper { display: flex; height: 100vh; overflow: hidden; }
.sidebar { width: 260px; background: var(--surface); color: var(--text); border-right: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; overflow-y: auto; }
.main-area { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.topbar { height: 60px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 24px; gap: 16px; flex-shrink: 0; }
.content-area { flex: 1; padding: 24px 28px 28px; overflow-y: auto; }

.sb-brand { padding: 0 20px; height: 64px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); }
.sb-brand .mark { width: 30px; height: 30px; border-radius: 7px; background: var(--primary); display: grid; place-items: center; flex-shrink: 0; }
.sb-brand .name { font-weight: 700; font-size: 16px; color: var(--text-heading); letter-spacing: -0.02em; }
.sb-brand .sub { font-size: 11px; color: var(--text-muted); letter-spacing: 0.06em; text-transform: uppercase; }

.sb-section { padding: 14px 16px 6px; font-size: 11px; color: var(--text-muted); font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
.sb-nav { display: flex; flex-direction: column; padding: 4px 12px; gap: 2px; }
.sb-item { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 8px; font-size: 13.5px; font-weight: 500; color: var(--text-muted); cursor: pointer; text-decoration: none; position: relative; transition: background .15s, color .15s; }
.sb-item:hover { background: var(--bg-elevated); color: var(--text); }
.sb-item.active { background: var(--primary-tint); color: var(--primary); font-weight: 600; }
.sb-item .sb-badge { margin-left: auto; background: var(--primary); color: #fff; font-size: 10.5px; font-weight: 600; padding: 1px 6px; border-radius: 10px; min-width: 18px; text-align: center; }
.sb-bottom { margin-top: auto; padding: 12px 16px 18px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--text-faint); }

.tb-greeting { font-size: 14px; }
.tb-greeting strong { font-weight: 600; }
.tb-greeting .muted { color: var(--text-muted); margin-right: 6px; }
.tb-spacer { flex: 1; }
.tb-select { display: flex; align-items: center; gap: 8px; padding: 7px 10px 7px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; background: var(--surface); color: var(--text); cursor: pointer; }
.tb-select .lbl { color: var(--text-muted); font-size: 12px; }
.tb-select .val { font-weight: 500; }
.tb-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 6px; color: var(--text-muted); cursor: pointer; position: relative; background: transparent; border: none; }
.tb-icon:hover { background: var(--bg); }
.tb-icon .notif-dot { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-600); border: 2px solid var(--surface); }
.tb-avatar { display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border-radius: 30px; cursor: pointer; }
.tb-avatar:hover { background: var(--bg); }
.tb-filter-wrap { position: relative; }
.tb-dropdown { position: absolute; top: calc(100% + 6px); left: 0; min-width: 210px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,.14); z-index: 300; display: none; padding: 4px; }
.tb-filter-wrap.open .tb-dropdown { display: block; }
.tb-dd-item { display: block; padding: 8px 12px; font-size: 13px; border-radius: 5px; cursor: pointer; color: var(--text); text-decoration: none; white-space: nowrap; }
.tb-dd-item:hover { background: var(--bg); }
.tb-dd-item.active { font-weight: 600; color: var(--primary); background: var(--primary-tint); }

.page-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; }
.page-header h1 { font-size: 22px; font-weight: 600; margin: 0; letter-spacing: -0.015em; display: flex; align-items: center; gap: 10px; }
.crumb { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.crumb a { color: var(--text-muted); text-decoration: none; }
.crumb a:hover { color: var(--text); }
.page-actions { display: flex; gap: 8px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: 0 10px 15px rgba(15,23,42,0.05), 0 4px 6px rgba(15,23,42,0.03); }
.card-header { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-header h3 { margin: 0; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 16px 18px; }

.kpi-card { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.kpi-label { font-size: 12.5px; color: var(--text-muted); font-weight: 500; }
.kpi-value { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi-trend { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 5px; }
.kpi-trend.up { color: var(--ok); }
.kpi-trend.down { color: var(--err); }
.kpi-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 7px; background: var(--primary-tint); color: var(--primary); }

.btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 6px; font-size: 13px; font-weight: 500; border: 1px solid transparent; cursor: pointer; white-space: nowrap; text-decoration: none; font-family: var(--font); }
.btn-primary { background: var(--accent-600); color: #fff; border-color: var(--accent-600); }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg); }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: transparent; }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-danger { background: var(--err); color: #fff; border-color: var(--err); }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 6px 10px; font-size: 12.5px; }
.btn-xs { padding: 4px 8px; font-size: 12px; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; font-size: 11.5px; font-weight: 500; border-radius: 4px; line-height: 1.5; }
.badge-ok { background: #ECFDF5; color: #047857; }
.badge-warn { background: #FFFBEB; color: #B45309; }
.badge-err { background: #FEF2F2; color: #B91C1C; }
.badge-info { background: #EFF6FF; color: #1D4ED8; }
.badge-neutral { background: var(--bg); color: var(--text-muted); }
.badge-accent { background: var(--primary-tint); color: var(--primary); }

.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; color: #fff; flex-shrink: 0; }
.avatar-lg { width: 40px; height: 40px; font-size: 14px; }
.avatar-xl { width: 64px; height: 64px; font-size: 22px; }

.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.table thead th { text-align: left; font-weight: 500; font-size: 11.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; padding: 10px 14px; background: var(--bg); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table tbody td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #FAFBFE; }
.table .num { font-variant-numeric: tabular-nums; }
.table .right { text-align: right; }

.form-group { margin-bottom: 16px; }
.form-label { font-size: 12.5px; font-weight: 500; display: block; margin-bottom: 6px; }
.form-control { width: 100%; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: 6px; font-size: 13.5px; background: var(--surface); color: var(--text); font-family: var(--font); }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-shadow); }
.form-control.is-invalid { border-color: var(--err); }
.invalid-feedback { font-size: 12px; color: var(--err); margin-top: 4px; }
.input-group { position: relative; display: flex; align-items: center; }
.input-group .form-control { padding-left: 36px; }
.input-group .input-icon { position: absolute; left: 11px; color: var(--text-faint); pointer-events: none; }

.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
.grid-3-2 { display: grid; grid-template-columns: 3fr 2fr; gap: 14px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); padding: 0 4px; }
.tab { padding: 10px 14px; font-size: 13px; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; text-decoration: none; display: inline-block; }
.tab.active { color: var(--text); border-bottom-color: var(--accent-600); }

.alert { padding: 12px 16px; border-radius: 6px; font-size: 13px; margin-bottom: 16px; display: flex; gap: 10px; align-items: flex-start; }
.alert-success { background: #ECFDF5; color: #047857; border: 1px solid #A7F3D0; }
.alert-danger { background: #FEF2F2; color: #B91C1C; border: 1px solid #FECACA; }
.alert-warning { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }

.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.status-dot.ok { background: var(--ok); }
.status-dot.warn { background: var(--warn); }
.status-dot.err { background: var(--err); }

.pagination { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-muted); }

.progress-bar-track { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 3px; }

.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item { display: flex; gap: 12px; position: relative; padding-bottom: 16px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot { width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; }
.timeline-line { width: 2px; background: var(--border); margin: 4px auto; }
.timeline-dot.done { background: var(--ok); }
.timeline-dot.pending { background: var(--surface); border: 2px solid var(--border-strong); }

.empty-state { text-align: center; padding: 60px 24px; color: var(--text-muted); }
.empty-state .empty-icon { margin-bottom: 12px; opacity: 0.4; }
.empty-state h3 { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 6px; }

.divider { height: 1px; background: var(--border); }
.text-muted { color: var(--text-muted); }
.text-faint { color: var(--text-faint); }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.mono { font-family: monospace; font-variant-numeric: tabular-nums; }
.tab-num { font-variant-numeric: tabular-nums; }
.mb-14 { margin-bottom: 14px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-14 { gap: 14px; }
.ms-auto { margin-left: auto; }
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-box { background: var(--surface); border-radius: 10px; padding: 28px; width: 480px; max-width: 95vw; box-shadow: 0 20px 60px rgba(0,0,0,0.18); }
.modal-title { font-size: 16px; font-weight: 600; margin: 0 0 18px; }
.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-bar .form-control { width: auto; }
.section-title { font-size: 13px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 14px; }
.detail-row { display: flex; padding: 10px 0; border-bottom: 1px solid var(--border); }
.detail-row:last-child { border-bottom: none; }
.detail-label { width: 180px; flex-shrink: 0; font-size: 12.5px; color: var(--text-muted); font-weight: 500; }
.detail-value { font-size: 13.5px; flex: 1; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent-600); cursor: pointer; }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2-1 { grid-template-columns: 1fr; }
  .grid-3-2 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .content-area { padding: 16px; }
}

