/* LogiRisk Portal — Main Stylesheet */
/* Design: Industrial precision — dark navy backbone, clean white workspace */

:root {
  --navy:        #0a2540;
  --navy-light:  #0f3460;
  --accent:      #1a73e8;
  --accent-dark: #1557b0;
  --danger:      #c0392b;
  --danger-bg:   #fdf0ef;
  --warning:     #e67e22;
  --warning-bg:  #fef9ef;
  --success:     #1e7e34;
  --success-bg:  #edf7f0;
  --text:        #1a1a2e;
  --text-muted:  #6b7280;
  --border:      #e2e4e9;
  --bg:          #f5f6fa;
  --white:       #ffffff;
  --sidebar-w:   260px;
  --radius:      8px;
  --shadow:      0 1px 4px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.04);
  --shadow-md:   0 4px 12px rgba(0,0,0,.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }

body {
  font-family: 'IBM Plex Sans', 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

/* ── Typography ───────────────────────────────────────────────────────────── */
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.35rem; font-weight: 600; }
h3 { font-size: 1.1rem;  font-weight: 600; }

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

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 600;
  transition: all .15s;
  text-decoration: none;
  line-height: 1;
}
.btn-primary   { background: var(--accent);  color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-dark      { background: var(--navy);    color: #fff; }
.btn-dark:hover { background: var(--navy-light); }
.btn-danger    { background: var(--danger);  color: #fff; }
.btn-danger:hover { background: #a93226; }
.btn-outline   { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm        { padding: 6px 14px; font-size: .82rem; }
.btn-block     { width: 100%; justify-content: center; }

/* ── Forms ────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .88rem; }
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .95rem;
  color: var(--text);
  background: var(--white);
  transition: border-color .15s;
  outline: none;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(26,115,232,.12); }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; }

.form-check { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.form-check input[type=checkbox] { width: 16px; height: 16px; margin-top: 2px; cursor: pointer; flex-shrink: 0; }

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.card-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-body  { padding: 24px; }
.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: #fafbfc;
  border-radius: 0 0 var(--radius) var(--radius);
}

/* ── Alerts ───────────────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  border-left: 4px solid;
  margin-bottom: 16px;
  font-size: .9rem;
}
.alert-success { background: var(--success-bg); border-color: var(--success); color: #145a23; }
.alert-danger  { background: var(--danger-bg);  border-color: var(--danger);  color: #8b1a14; }
.alert-warning { background: var(--warning-bg); border-color: var(--warning); color: #8a4a00; }
.alert-info    { background: #eff6ff; border-color: var(--accent); color: #1e40af; }

/* ── Badges ───────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.badge-success  { background: #d1fae5; color: #065f46; }
.badge-warning  { background: #fef3c7; color: #92400e; }
.badge-danger   { background: #fee2e2; color: #991b1b; }
.badge-info     { background: #dbeafe; color: #1e40af; }
.badge-neutral  { background: #f3f4f6; color: #374151; }

/* ── Tables ───────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
thead th {
  background: #f8f9fb;
  padding: 10px 16px;
  text-align: left;
  font-weight: 600;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td { padding: 12px 16px; border-bottom: 1px solid #f0f1f5; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fafbff; }

/* ── Auth pages ───────────────────────────────────────────────────────────── */
.auth-bg {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy) 0%, #1a3a5c 100%);
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  overflow: hidden;
}
.auth-header {
  background: var(--navy);
  padding: 28px 32px;
  text-align: center;
}
.auth-logo {
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 1px;
}
.auth-logo span { color: #4fc3f7; }
.auth-tagline { color: rgba(255,255,255,.6); font-size: .8rem; margin-top: 4px; }
.auth-body { padding: 32px; }

/* ── Sidebar layout ───────────────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  color: #fff;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
}
.sidebar-logo {
  padding: 22px 20px;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 1px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-logo span { color: #4fc3f7; }

.sidebar nav { padding: 12px 0; flex: 1; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  color: rgba(255,255,255,.7);
  font-size: .9rem;
  font-weight: 500;
  transition: all .15s;
  text-decoration: none;
}
.sidebar nav a:hover,
.sidebar nav a.active {
  background: rgba(255,255,255,.1);
  color: #fff;
}
.sidebar nav a.active { border-left: 3px solid #4fc3f7; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: .82rem;
  color: rgba(255,255,255,.5);
}
.sidebar-footer a { color: rgba(255,255,255,.7); }

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.topbar-title { font-weight: 700; font-size: 1rem; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }

.page-content { padding: 28px; max-width: 1100px; }

/* ── Stat cards ───────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.stat-label { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); margin-bottom: 8px; }
.stat-value { font-size: 2rem; font-weight: 800; color: var(--navy); line-height: 1; }
.stat-value.danger { color: var(--danger); }
.stat-value.warning { color: var(--warning); }
.stat-value.success { color: var(--success); }

/* ── Search result ────────────────────────────────────────────────────────── */
.firm-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--white);
  padding: 20px 24px;
  margin-bottom: 12px;
}
.firm-card.high-threat {
  border-color: var(--danger);
  background: #fff8f8;
}
.firm-name { font-size: 1.1rem; font-weight: 700; }
.firm-meta { color: var(--text-muted); font-size: .85rem; margin-top: 4px; }
.report-item {
  background: #fafbff;
  border: 1px solid #e8eaf6;
  border-radius: 6px;
  padding: 14px 18px;
  margin-top: 10px;
}
.report-item.concordat    { border-left: 4px solid var(--danger); }
.report-item.court        { border-left: 4px solid var(--warning); }
.report-item.unpaid       { border-left: 4px solid #6c757d; }

/* ── Notification dot ─────────────────────────────────────────────────────── */
.notif-badge {
  background: var(--danger);
  color: #fff;
  border-radius: 50%;
  width: 18px; height: 18px;
  font-size: .72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ── Lang switcher ────────────────────────────────────────────────────────── */
.lang-switch { display: flex; gap: 6px; }
.lang-switch a {
  padding: 3px 10px;
  border-radius: 4px;
  font-size: .8rem;
  font-weight: 600;
  color: rgba(255,255,255,.6);
  text-decoration: none;
}
.lang-switch a.active,
.lang-switch a:hover { color: #fff; background: rgba(255,255,255,.15); }

/* ── OTP input ────────────────────────────────────────────────────────────── */
.otp-input {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 12px;
  padding: 14px;
}

/* ── Referral code display ────────────────────────────────────────────────── */
.code-box {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: 16px;
  text-align: center;
  padding: 20px;
  background: #f0f4ff;
  border-radius: 8px;
  color: var(--navy);
  border: 2px dashed var(--accent);
  margin: 16px 0;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .page-content { padding: 16px; }
}

/* ── Counter-document badges ─────────────────────────────────────────────── */
.counter-doc-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #edf7f0;
  border: 1px solid #1e7e34;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: .75rem;
  font-weight: 600;
  color: #145a23;
  margin-top: 8px;
}
.counter-doc-badge.pending {
  background: #fef9ef;
  border-color: #e67e22;
  color: #8a4a00;
}

/* ── Donate button ───────────────────────────────────────────────────────── */
.donate-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(201,168,76,.12);
  border: 1px solid rgba(201,168,76,.3);
  color: #c9a84c;
  padding: 7px 16px;
  border-radius: 20px;
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none;
  transition: all .2s;
}
.donate-pill:hover {
  background: rgba(201,168,76,.22);
  text-decoration: none;
}
