/* ═══════════════════════════════════════════════════════════
   DARA SaaS — Main Stylesheet
   IBM Plex Sans + IBM Plex Mono · Dark government-tech aesthetic
   ═══════════════════════════════════════════════════════════ */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body { height: 100%; font-family: 'IBM Plex Sans', system-ui, sans-serif; font-size: 14px; line-height: 1.6; color: #e2e8f0; background: #070c16; -webkit-font-smoothing: antialiased; }
a { color: #3b82f6; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1a2f4a; border-radius: 3px; }
::placeholder { color: #3d5270; }

/* ── Layout ── */
.layout-app   { display: flex; height: 100vh; overflow: hidden; }
.layout-auth  { min-height: 100vh; display: flex; background: #070c16; }

/* ── Sidebar ── */
.sidebar {
  width: 220px; flex-shrink: 0;
  background: #09101e; border-right: 1px solid #1a2f4a;
  display: flex; flex-direction: column; overflow: hidden;
}
.sidebar-logo {
  padding: 18px 16px 14px;
  border-bottom: 1px solid #1a2f4a;
  display: flex; align-items: center; gap: 9px;
}
.sidebar-logo img { width: 28px; height: 28px; object-fit: contain; }
.sidebar-logo-name { font-size: 14px; font-weight: 700; color: #e8eef7; letter-spacing: -.01em; line-height: 1; }
.sidebar-logo-sub  { font-size: 9px; color: #3b6ef0; font-family: 'IBM Plex Mono', monospace; letter-spacing: .08em; text-transform: uppercase; }

.sidebar-company {
  padding: 10px 14px; border-bottom: 1px solid #1a2f4a;
  display: flex; align-items: center; gap: 8px;
  transition: background .15s;
}
.sidebar-company:hover { background: #0f1c2e; }
.sidebar-company-avatar {
  width: 28px; height: 28px; background: #1d4ed8; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.sidebar-company-name { font-size: 12px; font-weight: 600; color: #cbd5e1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.sidebar-company-plan { font-size: 10px; color: #3b6ef0; font-family: 'IBM Plex Mono', monospace; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 8px; }
.nav-section-label {
  font-size: 9px; color: #3d5270; font-family: 'IBM Plex Mono', monospace;
  letter-spacing: .1em; text-transform: uppercase;
  padding: 12px 8px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 7px; cursor: pointer;
  margin-bottom: 2px; color: #7d97b3;
  transition: background .15s, color .15s;
  text-decoration: none;
}
.nav-item:hover { background: rgba(255,255,255,.05); color: #e8eef7; text-decoration: none; }
.nav-item.active { background: rgba(59,110,240,.15); color: #e8eef7; }
.nav-item-icon { font-size: 14px; width: 16px; text-align: center; flex-shrink: 0; }
.nav-item-label { font-size: 13px; font-weight: 500; }
.nav-badge {
  margin-left: auto; background: #1a2f4a; color: #7d97b3;
  font-size: 9px; font-weight: 700; padding: 2px 6px;
  border-radius: 10px; font-family: 'IBM Plex Mono', monospace;
}
.nav-badge.warn { background: rgba(245,158,11,.2); color: #f59e0b; }

.sidebar-user {
  padding: 12px 14px; border-top: 1px solid #1a2f4a;
  display: flex; align-items: center; gap: 9px;
  transition: background .15s; text-decoration: none;
}
.sidebar-user:hover { background: #0f1c2e; }
.sidebar-user-avatar {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, #1d4ed8, #7c3aed);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.sidebar-user-name  { font-size: 12px; font-weight: 600; color: #cbd5e1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.sidebar-user-role  { font-size: 10px; color: #3d5270; }
.sidebar-signout    { font-size: 12px; color: #3d5270; padding: 4px; }
.sidebar-signout:hover { color: #ef4444; }

/* ── Main content area ── */
.main { flex: 1; overflow-y: auto; background: #070c16; }
.page { padding: 28px 32px; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; gap: 20px; }
.page-title { font-size: 22px; font-weight: 700; color: #f0f4ff; letter-spacing: -.03em; margin-bottom: 4px; }
.page-subtitle { font-size: 13px; color: #7d97b3; }

/* ── Breadcrumb ── */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #3d5270; margin-bottom: 18px; }
.breadcrumb a { color: #7d97b3; text-decoration: none; }
.breadcrumb a:hover { color: #e8eef7; }

/* ── Cards ── */
.card { background: #0d1527; border: 1px solid #1a2f4a; border-radius: 10px; }
.card-header { padding: 14px 18px; border-bottom: 1px solid #1a2f4a; display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 13px; font-weight: 700; color: #e8eef7; }
.card-body  { padding: 18px 20px; }

/* ── Tables ── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead tr { background: #09101e; }
.data-table th {
  text-align: left; padding: 10px 14px;
  font-size: 10px; color: #3d5270; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
}
.data-table td { padding: 12px 14px; border-top: 1px solid #1a2f4a; }
.data-table tbody tr { transition: background .1s; }
.data-table tbody tr:hover { background: #0f1c2e; cursor: pointer; }
.data-table .cell-primary   { font-size: 13px; font-weight: 600; color: #cbd5e1; }
.data-table .cell-secondary { font-size: 11px; color: #3d5270; margin-top: 2px; }
.data-table .cell-mono      { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: #3d5270; }
.data-table .cell-center    { text-align: center; }
.data-table .cell-num       { font-size: 13px; font-weight: 700; color: #94a3b8; }

/* ── Badges ── */
.badge { display: inline-flex; align-items: center; font-size: 9px; font-weight: 700; padding: 3px 8px; border-radius: 4px; font-family: 'IBM Plex Mono', monospace; white-space: nowrap; }
.badge-blue    { background: rgba(59,130,246,.15);  color: #60a5fa; }
.badge-green   { background: rgba(16,185,129,.15);  color: #10b981; }
.badge-yellow  { background: rgba(245,158,11,.12);  color: #f59e0b; }
.badge-red     { background: rgba(239,68,68,.12);   color: #ef4444; }
.badge-purple  { background: rgba(168,85,247,.15);  color: #c084fc; }
.badge-gray    { background: rgba(100,116,139,.15); color: #94a3b8; }
.badge-outline { background: #0f1c2e; border: 1px solid #1a2f4a; color: #7d97b3; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border-radius: 8px; font-weight: 600; font-size: 13px; border: none; transition: opacity .15s; white-space: nowrap; text-decoration: none; }
.btn:hover { opacity: .88; text-decoration: none; }
.btn-primary  { background: #3b82f6; color: #fff; }
.btn-outline  { background: #0d1527; border: 1px solid #1a2f4a; color: #7d97b3; }
.btn-danger   { background: rgba(239,68,68,.15); border: 1px solid rgba(239,68,68,.3); color: #ef4444; }
.btn-sm       { padding: 6px 12px; font-size: 11px; border-radius: 6px; }
.btn-icon     { padding: 6px 10px; }

/* ── Forms ── */
.form-group   { margin-bottom: 16px; }
.form-label   { display: block; font-size: 11px; font-weight: 600; color: #7d97b3; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 6px; }
.form-control { width: 100%; background: #0f1c2e; border: 1px solid #1a2f4a; border-radius: 8px; padding: 10px 14px; color: #e8eef7; outline: none; transition: border-color .15s; }
.form-control:focus { border-color: #3b82f6; }
.form-select  { width: 100%; background: #0f1c2e; border: 1px solid #1a2f4a; border-radius: 8px; padding: 10px 14px; color: #e8eef7; outline: none; appearance: none; cursor: pointer; }
.form-hint    { font-size: 11px; color: #3d5270; margin-top: 5px; }
.form-error   { font-size: 11px; color: #ef4444; margin-top: 5px; }

/* ── Tabs ── */
.tab-bar  { display: flex; border-bottom: 1px solid #1a2f4a; margin-bottom: 20px; gap: 2px; }
.tab-item { padding: 9px 16px; font-size: 12px; font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; color: #7d97b3; text-decoration: none; display: flex; align-items: center; gap: 6px; white-space: nowrap; transition: color .15s; }
.tab-item:hover { color: #e8eef7; text-decoration: none; }
.tab-item.active { border-bottom-color: #3b82f6; color: #e8eef7; }

/* ── Alert/flash ── */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.alert-success { background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.25); color: #10b981; }
.alert-error   { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.25); color: #ef4444; }
.alert-info    { background: rgba(59,130,246,.1); border: 1px solid rgba(59,130,246,.25); color: #60a5fa; }
.alert-warn    { background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.25); color: #f59e0b; }

/* ── Stat cards ── */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.stat-card { background: #0d1527; border: 1px solid #1a2f4a; border-radius: 10px; padding: 18px 20px; }
.stat-card-label { font-size: 10px; color: #3d5270; font-family: 'IBM Plex Mono', monospace; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 8px; }
.stat-card-value { font-size: 30px; font-weight: 700; line-height: 1; margin-bottom: 4px; }
.stat-card-sub   { font-size: 11px; color: #3d5270; }

/* ── Progress bars ── */
.progress { background: #1a2f4a; border-radius: 4px; height: 5px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 4px; }

/* ── Mono label ── */
.mono { font-family: 'IBM Plex Mono', monospace; }

/* ── Auth layout ── */
.auth-split { display: flex; min-height: 100vh; }
.auth-panel-left {
  width: 420px; flex-shrink: 0;
  background: linear-gradient(160deg, #040913 0%, #091525 50%, #0b1f3a 100%);
  display: flex; flex-direction: column; padding: 40px 48px;
  position: relative; overflow: hidden;
}
.auth-panel-left::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(59,110,240,.12) 0%, transparent 70%);
  pointer-events: none;
}
.auth-panel-right {
  flex: 1; background: #09101e;
  display: flex; align-items: center; justify-content: center;
  padding: 40px; overflow-y: auto;
}
.auth-box { width: 100%; max-width: 400px; }
.auth-title    { font-size: 22px; font-weight: 700; color: #e8eef7; margin-bottom: 6px; letter-spacing: -.02em; }
.auth-subtitle { font-size: 13px; color: #7d97b3; margin-bottom: 28px; }

.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: #1a2f4a; }
.auth-divider span { font-size: 11px; color: #3d5270; white-space: nowrap; }

.oauth-btn {
  width: 100%; background: #0f1c2e; border: 1px solid #1a2f4a; border-radius: 8px;
  padding: 11px 16px; display: flex; align-items: center; justify-content: center;
  gap: 10px; color: #e8eef7; font-weight: 500; margin-bottom: 10px;
  transition: background .15s; text-decoration: none; font-size: 14px;
}
.oauth-btn:hover { background: #142236; text-decoration: none; }

/* ── Workflow strip ── */
.workflow-strip { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.workflow-step  { font-size: 10px; font-weight: 600; padding: 5px 10px; border-radius: 5px; white-space: nowrap; font-family: 'IBM Plex Mono', monospace; }
.workflow-done    { background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.3); color: #10b981; }
.workflow-active  { background: rgba(59,130,246,.15); border: 1px solid rgba(59,130,246,.4); color: #3b82f6; }
.workflow-pending { background: #0f1c2e; border: 1px solid #1a2f4a; color: #3d5270; }

/* ── Utility ── */
.text-muted  { color: #7d97b3; }
.text-dim    { color: #3d5270; }
.text-green  { color: #10b981; }
.text-red    { color: #ef4444; }
.text-yellow { color: #f59e0b; }
.text-blue   { color: #3b82f6; }
.flex        { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-8       { gap: 8px; }
.gap-12      { gap: 12px; }
.mt-4        { margin-top: 4px; }
.mt-8        { margin-top: 8px; }
.mt-16       { margin-top: 16px; }
.mt-24       { margin-top: 24px; }
.mb-16       { margin-bottom: 16px; }
.mb-24       { margin-bottom: 24px; }
.w-full      { width: 100%; }
