/* ════════════════════════════════════════════════════════
   Siam Legal Associate — Design System
   ════════════════════════════════════════════════════════ */

:root {
  --navy-900: #10182b;
  --navy-800: #16243d;
  --navy-700: #1f3052;
  --navy-50: #f2f5f9;
  --primary: #b22327;
  --primary-dark: #8a1b1f;
  --primary-light: #fbecec;
  --gold: #c9a24b;
  --gold-light: #f7edd8;
  --bg: #f1f5f9;
  --card: #ffffff;
  --border: #e5e9f0;
  --text: #1f2937;
  --text-muted: #64748b;
  --success: #16a34a;
  --success-bg: #dcfce7;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --info: #0284c7;
  --info-bg: #e0f2fe;
  --secondary: #64748b;
  --secondary-bg: #e2e8f0;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(16,24,40,.06), 0 1px 2px rgba(16,24,40,.04);
  --shadow-lg: 0 12px 32px rgba(16,24,40,.12);
  --sidebar-w: 250px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ───────────────────────── Public header ───────────────────────── */
.pub-nav {
  background: var(--primary);
  position: sticky; top: 0; z-index: 60;
  box-shadow: 0 2px 12px rgba(178,35,39,.25);
}
.nav-inner { display: flex; align-items: center; gap: 28px; height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 19px; letter-spacing: .3px; }
.brand:hover { color: var(--gold); }
.brand-logo img { height: 34px; width: auto; display: block; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--gold), #a87f2d);
  color: #fff; font-size: 17px;
}
.pub-links { display: flex; gap: 4px; margin-right: auto; }
.pub-links a {
  color: #f3d9d9; padding: 8px 14px; border-radius: 8px; font-weight: 500; font-size: 14px;
}
.pub-links a:hover { color: #fff; background: rgba(255,255,255,.08); }
.pub-links a.active { color: #fff; background: rgba(255,255,255,.14); }
.nav-actions { display: flex; gap: 8px; }
.nav-toggle { display: none; background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer; }
.brand.light { color: #fff; }

/* ───────────────────────── Buttons ───────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 18px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: .15s ease;
  background: var(--primary); color: #fff; line-height: 1.3; text-align: center; white-space: nowrap;
}
.btn:hover { background: var(--primary-dark); color: #fff; transform: translateY(-1px); }
.btn-light { background: #fff; color: var(--navy-800); }
.btn-light:hover { background: var(--gold-light); color: var(--navy-800); }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.btn-outline-light:hover { background: rgba(255,255,255,.12); color: #fff; }
.btn-success { background: var(--success); }
.btn-success:hover { background: #15803d; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b91c1c; }
.btn-warning { background: var(--warning); }
.btn-warning:hover { background: #b45309; }
.btn-secondary { background: var(--secondary); }
.btn-secondary:hover { background: #475569; }
.btn-outline { background: #fff; color: var(--primary); border-color: #cbd5e1; }
.btn-outline:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 7px; }
.btn-lg { padding: 13px 26px; font-size: 15.5px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ───────────────────────── Badges ───────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3.5px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.5;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success  { background: var(--success-bg); color: var(--success); }
.badge-warning  { background: var(--warning-bg); color: var(--warning); }
.badge-danger   { background: var(--danger-bg); color: var(--danger); }
.badge-info     { background: var(--info-bg); color: var(--info); }
.badge-primary  { background: var(--primary-light); color: var(--primary); }
.badge-secondary{ background: var(--secondary-bg); color: var(--secondary); }

/* ───────────────────────── Flash / alerts ───────────────────────── */
.flash-wrap { padding: 12px 0 0; }
.flash {
  max-width: 1200px; margin: 14px auto 0; padding: 12px 18px; border-radius: 10px;
  font-size: 14px; font-weight: 500; border: 1px solid; animation: fadeSlide .3s ease;
  position: relative;
}
.flash-dismiss { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); cursor: pointer; opacity: .6; }
.flash-success { background: var(--success-bg); border-color: #bbf7d0; color: #166534; }
.flash-danger  { background: var(--danger-bg); border-color: #fecaca; color: #991b1b; }
.flash-warning { background: var(--warning-bg); border-color: #fde68a; color: #92400e; }
.flash-info    { background: var(--info-bg); border-color: #bae6fd; color: #075985; }
.flash-wrap .flash { margin: 12px auto; }
@keyframes fadeSlide { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ───────────────────────── Public hero ───────────────────────── */
.hero {
  color: #fff; padding: 0; position: relative; overflow: hidden;
  min-height: 620px; display: flex; align-items: center;
  background: var(--primary);
}
.hero-slide { position: absolute; inset: 0; overflow: hidden; opacity: 0; transition: opacity 1.2s ease; }
.hero-slide.active { opacity: 1; }
.hero-slide img {
  width: 100%; height: 100%; object-fit: cover;
  animation: kenburns 22s ease-in-out infinite alternate;
  will-change: transform;
}
.hero-slide-2 img { animation-delay: 11s; }
.hero-slide::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(178,35,39,.88) 0%, rgba(178,35,39,.62) 45%, rgba(178,35,39,.25) 100%),
    linear-gradient(0deg, rgba(178,35,39,.55), transparent 60%);
}
@keyframes kenburns {
  0%   { transform: scale(1) translate(0, 0); }
  50%  { transform: scale(1.12) translate(-1.6%, -1%); }
  100% { transform: scale(1.06) translate(1.2%, .8%); }
}
.hero .container { position: relative; z-index: 5; padding: 92px 24px 96px; }
.hero h1 { font-size: 44px; font-weight: 800; line-height: 1.15; max-width: 620px; letter-spacing: -.5px; }
.hero h1 span { color: var(--gold); }
.hero p { margin-top: 18px; font-size: 17px; color: #f3d9d9; max-width: 560px; }
.hero-actions { margin-top: 30px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats { margin-top: 46px; display: flex; gap: 38px; flex-wrap: wrap; }
.hero-stat b { display: block; font-size: 26px; color: var(--gold); }
.hero-stat span { color: #eccfcf; font-size: 13px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 16px;
  background: rgba(201,162,75,.16); border: 1px solid rgba(201,162,75,.4);
  color: var(--gold); padding: 6px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
}
.hero-arrows { position: absolute; bottom: 34px; right: 34px; z-index: 6; display: flex; gap: 8px; }
.hero-arrow {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.08); color: #fff; font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: .2s;
}
.hero-arrow:hover { background: var(--gold); border-color: var(--gold); }

/* Practice area cards */
.practice-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); transition: .25s; display: flex; flex-direction: column; height: 100%;
}
.practice-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.practice-img { height: 190px; overflow: hidden; position: relative; }
.practice-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.practice-card:hover .practice-img img { transform: scale(1.08); }
.practice-img::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(178,35,39,.55), transparent 55%);
}
.practice-body { padding: 18px 20px 20px; }
.practice-body h3 { font-size: 16px; color: var(--navy-800); }
.practice-body p { font-size: 13px; color: var(--text-muted); margin-top: 6px; line-height: 1.6; }
.practice-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--primary); }
.practice-link:hover { color: var(--primary-dark); }

/* About / split features */
.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: 46px; align-items: center; }
.split-img { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); }
.split-img img { width: 100%; height: 460px; object-fit: cover; display: block; }
.split-img .badge-float {
  position: absolute; left: 18px; bottom: 18px; background: rgba(255,255,255,.94);
  padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow-lg);
}
.feature-list { display: grid; gap: 16px; margin-top: 26px; }
.feature-item { display: flex; gap: 14px; }
.feature-ico {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  background: var(--primary-light);
}
.feature-item b { color: var(--navy-800); display: block; font-size: 14.5px; }
.feature-item p { font-size: 13px; color: var(--text-muted); margin-top: 3px; line-height: 1.6; }

/* Testimonials */
.testimonial {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px; display: flex; flex-direction: column; height: 100%;
}
.testimonial .quote-mark { font-size: 30px; color: var(--gold); line-height: 1; }
.testimonial p { font-size: 13.5px; color: #475569; line-height: 1.7; margin-top: 10px; flex: 1; }
.testimonial .author { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.testimonial .author .avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--primary-light);
  display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--primary);
}
.testimonial .author b { color: var(--navy-800); font-size: 13.5px; display: block; }
.testimonial .author span { font-size: 12px; color: var(--text-muted); }

/* Client logos */
.logo-strip { display: flex; align-items: center; justify-content: center; gap: 34px; flex-wrap: wrap; }
.logo-strip img { opacity: .55; filter: grayscale(1); transition: .25s; height: 40px; width: auto; object-fit: contain; }
.logo-strip img:hover { opacity: 1; filter: none; }

/* Timeline / process */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.step {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px; text-align: center; position: relative;
}
.step .step-num {
  width: 38px; height: 38px; border-radius: 50%; margin: 0 auto 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: var(--gold); font-weight: 800;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.step b { color: var(--navy-800); font-size: 14.5px; display: block; }
.step p { font-size: 12.5px; color: var(--text-muted); margin-top: 6px; line-height: 1.6; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .steps { grid-template-columns: 1fr; } }

@media (max-width: 960px) {
  .split { grid-template-columns: 1fr; gap: 28px; }
  .hero-arrows { display: none; }
}
@media (max-width: 640px) {
  .hero { min-height: 520px; }
  .hero h1 { font-size: 32px; }
  .hero .container { padding: 64px 24px; }
  .split-img img { height: 340px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-slide img { animation: none; }
}

.section { padding: 64px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 40px; }
.section-head .eyebrow { color: var(--primary); font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; font-size: 12.5px; }
.section-head h2 { font-size: 30px; font-weight: 800; color: var(--navy-800); margin-top: 6px; letter-spacing: -.3px; }
.section-head p { color: var(--text-muted); margin-top: 10px; }

/* ───────────────────────── Cards ───────────────────────── */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px;
}
.card-pad-sm { padding: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.card-title { font-size: 16px; font-weight: 700; color: var(--navy-800); display: flex; align-items: center; gap: 9px; }
.card-title .ico { width: 32px; height: 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--primary-light); font-size: 15px; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-main-side { grid-template-columns: 2fr 1fr; }
@media (max-width: 1000px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-main-side { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .grid-2, .grid-4, .grid-3 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 32px; }
}

/* ───────────────────────── Stat cards ───────────────────────── */
.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 16px;
  transition: .2s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-ico {
  width: 52px; height: 52px; border-radius: 13px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 23px;
}
.stat-ico.blue   { background: var(--primary-light); }
.stat-ico.green  { background: var(--success-bg); }
.stat-ico.gold   { background: var(--gold-light); }
.stat-ico.red    { background: var(--danger-bg); }
.stat-ico.purple { background: #ede9fe; }
.stat-ico.cyan   { background: var(--info-bg); }
.stat-meta b { display: block; font-size: 24px; font-weight: 800; color: var(--navy-800); letter-spacing: -.3px; }
.stat-meta span { font-size: 12.5px; color: var(--text-muted); font-weight: 500; }

/* ───────────────────────── Tables ───────────────────────── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; padding: 11px 14px; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .6px; color: var(--text-muted); font-weight: 700;
  border-bottom: 2px solid var(--border); background: #f8fafc; white-space: nowrap;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:hover { background: #f8fafc; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .cell-title { font-weight: 600; color: var(--navy-800); }
.table .cell-sub { font-size: 12px; color: var(--text-muted); }
.table-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ───────────────────────── Forms ───────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 6px; }
.form-label .req { color: var(--danger); }
.form-control {
  width: 100%; padding: 10px 13px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit; color: var(--text); background: #fff; transition: .15s;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3.5px rgba(178,35,39,.13); }
textarea.form-control { min-height: 110px; resize: vertical; }
select.form-control { appearance: none; background: #fff url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 13px center; padding-right: 34px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; }
@media (max-width: 720px) { .form-grid, .form-grid-3 { grid-template-columns: 1fr; } }
.checkbox-line { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: #374151; }
.checkbox-line input { width: 16px; height: 16px; accent-color: var(--primary); }

/* Password strength meter */
.pw-meter { display: flex; gap: 5px; margin-top: 7px; }
.pw-meter i { height: 4px; flex: 1; border-radius: 4px; background: var(--border); transition: .2s; }
.pw-meter.weak i:nth-child(1) { background: var(--danger); }
.pw-meter.fair i:nth-child(-n+2) { background: var(--warning); }
.pw-meter.good i:nth-child(-n+3) { background: var(--info); }
.pw-meter.strong i { background: var(--success); }

/* ───────────────────────── Auth pages ───────────────────────── */
.auth-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background:
    radial-gradient(700px 380px at 90% 0%, rgba(201,162,75,.3), transparent 60%),
    radial-gradient(700px 420px at 5% 100%, rgba(22,36,61,.55), transparent 60%),
    var(--primary);
}
.auth-card {
  width: 100%; max-width: 430px; background: #fff; border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,.3); padding: 38px 36px; animation: fadeSlide .35s ease;
}
.auth-back { display: flex; align-items: center; justify-content: center; gap: 6px; margin-bottom: 18px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.auth-back a { color: var(--text-muted); }
.auth-back a:hover { color: var(--primary); }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 800; font-size: 21px; color: var(--navy-800); margin-bottom: 6px; }
.auth-brand.brand-logo img { height: 40px; width: auto; margin-bottom: 2px; }
.auth-sub { text-align: center; color: var(--text-muted); font-size: 13.5px; margin-bottom: 24px; }
.auth-foot { text-align: center; margin-top: 18px; font-size: 13.5px; color: var(--text-muted); }
.auth-foot a { font-weight: 600; }

/* ───────────────────────── Sidebar / app shell ───────────────────────── */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); background: var(--primary); color: #f1d5d5; flex-shrink: 0;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
  box-shadow: 4px 0 24px rgba(178,35,39,.2); z-index: 50;
}
.sidebar-close {
  display: none; position: absolute; top: 12px; right: 12px; width: 34px; height: 34px;
  border: 0; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff;
  font-size: 24px; line-height: 1; cursor: pointer; z-index: 2;
  align-items: center; justify-content: center;
}
.sidebar-close:hover { background: rgba(255,255,255,.3); }
.sidebar-overlay { display: none; }
.sidebar-brand {
  display: flex; align-items: center; gap: 10px; padding: 20px 20px 14px;
  color: #fff; font-weight: 800; font-size: 17.5px;
}
.sidebar-brand:hover { color: var(--gold); }
.sidebar-label {
  margin: 6px 20px 10px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.6px; color: #e8b9b9;
}
.sidebar-nav { flex: 1; overflow-y: auto; padding: 0 12px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 9px;
  color: #f3d9d9; font-weight: 500; font-size: 14px; margin-bottom: 3px; transition: .15s;
}
.sidebar-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar-nav a.active { background: linear-gradient(90deg, var(--gold), #a87f2d); color: #fff; box-shadow: 0 4px 14px rgba(201,162,75,.4); }
.nav-icon { width: 22px; text-align: center; font-size: 15px; }
.sidebar-bottom { padding: 14px; border-top: 1px solid rgba(255,255,255,.08); display: flex; flex-direction: column; gap: 4px; }
.side-mini { color: #eccfcf; font-size: 13px; padding: 7px 12px; border-radius: 8px; }
.side-mini:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-mini.danger:hover { background: rgba(220,38,38,.2); color: #fca5a5; }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 64px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px; padding: 0 26px; position: sticky; top: 0; z-index: 40;
}
.sidebar-toggle { display: none; background: none; border: 0; font-size: 21px; cursor: pointer; color: var(--navy-800); }
.topbar-title { font-weight: 700; font-size: 16px; color: var(--navy-800); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--gold));
  color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.admin-avatar { background: linear-gradient(135deg, var(--danger), var(--gold)); }
.topbar-user-info { line-height: 1.25; }
.topbar-user-name { font-weight: 600; font-size: 13.5px; display: block; color: var(--navy-800); }
.topbar-user-id { font-size: 11.5px; color: var(--text-muted); }

.content { padding: 26px; flex: 1; max-width: 1400px; width: 100%; }

/* Notifications bell */
.notif-wrap { position: relative; }
.notif-bell { background: none; border: 0; font-size: 19px; cursor: pointer; position: relative; color: var(--navy-800); }
.bell-ico { display: inline-block; }
.notif-bell.has-unread { animation: notifShake 1.6s ease-in-out infinite; }
.notif-bell.has-unread .bell-ico { animation: notifBlink 1.6s ease-in-out infinite; }
.notif-bell.has-unread .notif-dot { animation: notifDotPulse 1.6s ease-in-out infinite; }
@keyframes notifShake {
  0%, 100% { transform: rotate(0deg); }
  5%  { transform: rotate(-16deg); }
  10% { transform: rotate(14deg); }
  15% { transform: rotate(-10deg); }
  20% { transform: rotate(8deg); }
  25% { transform: rotate(0deg); }
  60% { transform: rotate(0deg); }
}
@keyframes notifBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: .45; }
}
@keyframes notifDotPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,.55); }
  70% { box-shadow: 0 0 0 7px rgba(220,38,38,0); }
}
.notif-dot {
  position: absolute; top: -5px; right: -8px; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; min-width: 17px; height: 17px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.notif-dropdown {
  display: none; position: absolute; right: 0; top: 40px; width: 330px; background: #fff;
  border: 1px solid var(--border); border-radius: 13px; box-shadow: var(--shadow-lg); overflow: hidden; z-index: 80;
}
.notif-dropdown.open { display: block; animation: fadeSlide .18s ease; }
.notif-head { padding: 12px 16px; font-weight: 700; font-size: 14px; border-bottom: 1px solid var(--border); color: var(--navy-800); }
.notif-item { display: block; padding: 11px 16px; border-bottom: 1px solid var(--border); }
.notif-item.unread { background: var(--primary-light); }
.notif-item:hover { background: #f1f5f9; }
.notif-title { font-size: 13px; font-weight: 600; color: var(--navy-800); }
.notif-time { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.notif-empty { padding: 20px; text-align: center; color: var(--text-muted); font-size: 13px; }
.notif-all { display: block; text-align: center; padding: 10px; font-size: 13px; font-weight: 600; }
.notif-all:hover { background: #f1f5f9; }

@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; transform: translateX(-100%); transition: .25s; }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-close { display: flex; }
  .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(22,36,61,.55); z-index: 45; }
  body.sidebar-open .sidebar-overlay { display: block; }
  .sidebar-toggle { display: block; }
  .pub-links, .nav-actions { display: none; flex-direction: column; }
  .pub-links.open, .nav-actions.open { display: flex; }
  .nav-toggle { display: block; }
  .nav-inner { flex-wrap: wrap; height: auto; padding: 12px 0; }
  .nav-inner .brand { order: 0; }
  .nav-toggle { order: 1; margin-left: auto; }
  .pub-links { order: 2; width: 100%; }
  .nav-actions { order: 3; width: 100%; }
  .topbar { padding: 0 16px; }
  .content { padding: 18px; }
}

/* ───────────────────────── Timeline ───────────────────────── */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding-bottom: 20px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute; left: -26px; top: 4px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 3px solid var(--primary); box-shadow: 0 0 0 3px var(--primary-light);
}
.tl-dot.green { border-color: var(--success); box-shadow: 0 0 0 3px var(--success-bg); }
.tl-dot.gold { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-light); }
.tl-dot.red { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-bg); }
.tl-title { font-weight: 600; font-size: 14px; color: var(--navy-800); }
.tl-time { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.tl-body { font-size: 13.5px; color: var(--text); margin-top: 4px; }

/* ───────────────────────── Misc ───────────────────────── */
.avatar-lg {
  width: 84px; height: 84px; border-radius: 20px; object-fit: cover;
  background: linear-gradient(135deg, var(--primary), var(--gold)); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 34px; font-weight: 800;
}
.avatar-md { width: 46px; height: 46px; border-radius: 12px; object-fit: cover; }
.avatar-sm { width: 32px; height: 32px; border-radius: 9px; object-fit: cover; }

.pagination ul { display: flex; gap: 5px; list-style: none; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.page-link {
  display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px;
  padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px;
  color: var(--text); background: #fff; font-weight: 600;
}
.page-link:hover { border-color: var(--primary); color: var(--primary); }
.page-link.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-link.disabled { opacity: .45; pointer-events: none; }
.page-ellipsis { padding: 0 4px; color: var(--text-muted); }

.empty {
  text-align: center; padding: 48px 20px; color: var(--text-muted);
}
.empty .empty-ico { font-size: 42px; margin-bottom: 10px; opacity: .5; }
.empty h4 { color: var(--navy-800); font-size: 16px; margin-bottom: 4px; }

.filter-bar {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 20px; box-shadow: var(--shadow);
}
.filter-bar .form-control { width: auto; min-width: 150px; }
.filter-bar .form-group { margin-bottom: 0; }
.filter-bar label { font-size: 12px; color: var(--text-muted); font-weight: 600; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 20px; flex-wrap: wrap; }
.tab {
  padding: 9px 18px; font-weight: 600; font-size: 13.5px; color: var(--text-muted);
  border-bottom: 2px solid transparent; margin-bottom: -2px; cursor: pointer;
}
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Calendar */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal-day {
  background: #fff; border: 1px solid var(--border); border-radius: 10px; min-height: 88px; padding: 8px;
  font-size: 12px; transition: .15s;
}
.cal-day:hover { border-color: var(--primary); }
.cal-day .cal-num { font-weight: 700; color: var(--navy-800); font-size: 13px; }
.cal-day.today { border-color: var(--primary); background: var(--primary-light); }
.cal-day.other { opacity: .45; }
.cal-event {
  display: block; background: var(--primary-light); color: var(--primary); border-radius: 6px;
  padding: 3px 6px; margin-top: 5px; font-size: 11px; font-weight: 600; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-event:hover { background: var(--primary); color: #fff; }
.cal-head { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; text-align: center; padding-bottom: 6px; }

/* Lawyer cards */
.lawyer-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px; text-align: center; transition: .2s; height: 100%;
}
.lawyer-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.lawyer-card .avatar-lg { margin: 0 auto 14px; }
.lawyer-card h3 { font-size: 16px; color: var(--navy-800); }
.lawyer-card .spec { color: var(--primary); font-size: 12.5px; font-weight: 600; margin: 3px 0 10px; }
.lawyer-card .meta-line { display: flex; justify-content: center; gap: 14px; color: var(--text-muted); font-size: 12.5px; margin-bottom: 12px; flex-wrap: wrap; }
.stars { color: var(--gold); font-size: 13px; letter-spacing: 1px; }

/* Detail lists */
.detail-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 22px; }
@media (max-width: 720px) { .detail-list { grid-template-columns: 1fr; } }
.detail-item label { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted); font-weight: 700; margin-bottom: 3px; }
.detail-item div { font-weight: 600; color: var(--navy-800); font-size: 14px; }

/* Doc list */
.doc-row {
  display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border);
}
.doc-row:last-child { border-bottom: 0; }
.doc-ico {
  width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 17px; background: var(--primary-light); flex-shrink: 0;
}
.doc-name { font-weight: 600; font-size: 13.5px; color: var(--navy-800); }
.doc-meta { font-size: 12px; color: var(--text-muted); }
.doc-actions { margin-left: auto; }

/* Receipt */
.receipt { border: 1px dashed var(--border); border-radius: 12px; padding: 24px; background: #fcfcfd; }
.receipt-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid var(--navy-800); padding-bottom: 14px; margin-bottom: 16px; }
.receipt h2 { color: var(--navy-800); font-size: 20px; }
.receipt .rec-no { color: var(--text-muted); font-size: 13px; }
.receipt table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.receipt td { padding: 8px 0; }
.receipt td:last-child { text-align: right; font-weight: 600; }
.receipt .grand { border-top: 2px solid var(--navy-800); font-size: 16px; font-weight: 800; color: var(--navy-800); }

/* Quick actions */
.quick-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.qa-btn {
  display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 11px;
  border: 1px solid var(--border); background: #fff; color: var(--navy-800); font-weight: 600; font-size: 13.5px;
  transition: .15s;
}
.qa-btn:hover { border-color: var(--primary); background: var(--primary-light); color: var(--primary); transform: translateY(-1px); }
.qa-btn .ico { font-size: 19px; }

/* Modal */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(178,35,39,.55); z-index: 100;
  align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; animation: fadeSlide .2s ease; }
.modal { background: #fff; border-radius: 16px; max-width: 560px; width: 100%; max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { font-size: 16px; color: var(--navy-800); }
.modal-close { background: none; border: 0; font-size: 20px; cursor: pointer; color: var(--text-muted); }
.modal-body { padding: 22px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* Progress */
.progress { height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--gold)); border-radius: 999px; }

/* ───────────────────────── WhatsApp floating widget ───────────────────────── */
.wa-widget { position: fixed; left: 22px; bottom: 22px; z-index: 90; }
.wa-float {
  position: relative; width: 58px; height: 58px; border-radius: 50%;
  background: #25d366; color: #fff; border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(37,211,102,.45), 0 2px 8px rgba(0,0,0,.18);
  transition: transform .18s ease, box-shadow .18s ease;
  animation: waPulse 2.4s ease-out infinite;
}
.wa-float:hover { transform: scale(1.08); box-shadow: 0 10px 26px rgba(37,211,102,.55); }
.wa-float:focus-visible { outline: 3px solid rgba(37,211,102,.5); outline-offset: 2px; }
.wa-float svg { width: 32px; height: 32px; fill: #fff; }
.wa-float .wa-bubble {
  position: absolute; left: calc(100% + 12px); top: 50%;
  transform: translateY(-50%) translateX(-8px);
  background: #fff; color: #1f2d3d; font-size: 13px; font-weight: 600;
  white-space: nowrap; padding: 8px 14px; border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
  opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease;
}
.wa-float:hover .wa-bubble, .wa-float:focus-visible .wa-bubble { opacity: 1; transform: translateY(-50%) translateX(0); }
.wa-float.open { background: #1fb458; }
.wa-float.open .wa-bubble { opacity: 0; }

.wa-card {
  position: absolute; left: 0; bottom: calc(100% + 14px);
  width: min(300px, calc(100vw - 48px));
  background: #fff; border-radius: 16px; overflow: hidden;
  box-shadow: 0 14px 44px rgba(0,0,0,.24);
  opacity: 0; visibility: hidden; transform: translateY(12px) scale(.96);
  transform-origin: bottom left;
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.wa-card.open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.wa-card-head { background: #075e54; color: #fff; padding: 14px 16px; display: flex; align-items: center; gap: 10px; }
.wa-card-head svg { width: 36px; height: 36px; fill: #fff; flex: none; }
.wa-card-head .wa-org { font-size: 14px; font-weight: 600; line-height: 1.2; }
.wa-card-head .wa-status { font-size: 11px; opacity: .85; margin-top: 2px; }
.wa-card-body { background: #e5ddd5; padding: 16px; }
.wa-msg {
  background: #fff; color: #1f2d3d; font-size: 13.5px; line-height: 1.5;
  padding: 10px 12px; border-radius: 4px 12px 12px 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,.12);
}
.wa-start {
  margin-top: 12px; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: #25d366; color: #fff; font-weight: 600; font-size: 14px;
  text-decoration: none; padding: 11px 14px; border-radius: 999px;
  transition: background .15s ease, transform .15s ease;
}
.wa-start:hover { background: #1fb458; transform: translateY(-1px); }
.wa-start svg { width: 18px; height: 18px; fill: #fff; }
@keyframes waPulse {
  0%   { box-shadow: 0 6px 20px rgba(37,211,102,.45), 0 0 0 0 rgba(37,211,102,.5); }
  70%  { box-shadow: 0 6px 20px rgba(37,211,102,.45), 0 0 0 16px rgba(37,211,102,0); }
  100% { box-shadow: 0 6px 20px rgba(37,211,102,.45), 0 0 0 0 rgba(37,211,102,0); }
}
@media (max-width: 640px) {
  .wa-widget { left: 16px; bottom: 16px; }
  .wa-float { width: 52px; height: 52px; }
  .wa-float svg { width: 28px; height: 28px; }
  .wa-float .wa-bubble { display: none; }
  .wa-card { width: min(280px, calc(100vw - 32px)); }
}

/* Floating translator widget (above WhatsApp) */
.tr-widget { position: fixed; left: 22px; bottom: 92px; z-index: 85; }
.tr-float {
  position: relative; width: 46px; height: 46px; border-radius: 50%;
  background: var(--primary); color: #fff; border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(178,35,39,.4), 0 2px 8px rgba(0,0,0,.18);
  transition: transform .18s ease, box-shadow .18s ease;
}
.tr-float:hover { transform: scale(1.08); box-shadow: 0 10px 24px rgba(178,35,39,.5); }
.tr-float:focus-visible { outline: 3px solid rgba(178,35,39,.5); outline-offset: 2px; }
.tr-float svg { width: 24px; height: 24px; fill: #fff; }
.tr-float .tr-bubble {
  position: absolute; left: calc(100% + 12px); top: 50%;
  transform: translateY(-50%) translateX(-8px);
  background: #fff; color: #1f2d3d; font-size: 13px; font-weight: 600;
  white-space: nowrap; padding: 8px 14px; border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
  opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease;
}
.tr-float:hover .tr-bubble, .tr-float:focus-visible .tr-bubble { opacity: 1; transform: translateY(-50%) translateX(0); }
.tr-float.open { background: #8f1b1e; }
.tr-float.open .tr-bubble { opacity: 0; }
.tr-card {
  position: absolute; left: 0; bottom: calc(100% + 12px);
  width: min(280px, calc(100vw - 48px));
  background: #fff; border-radius: 16px; overflow: hidden;
  box-shadow: 0 14px 44px rgba(0,0,0,.24);
  opacity: 0; visibility: hidden; transform: translateY(12px) scale(.96);
  transform-origin: bottom left;
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.tr-card.open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.tr-card-head { background: var(--primary); color: #fff; padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.tr-card-head svg { width: 20px; height: 20px; fill: #fff; flex: none; }
.tr-card-head .tr-title { font-size: 14px; font-weight: 600; line-height: 1.2; }
.tr-card-head .tr-status { font-size: 10.5px; opacity: .85; margin-top: 2px; }
.tr-card-body { background: #fbf7f7; padding: 14px; }
.tr-card-body .goog-te-combo {
  width: 100%; padding: 9px 10px; font-size: 13.5px; border: 1px solid #d9c8c8;
  border-radius: 8px; background: #fff; color: #1f2d3d; cursor: pointer;
}
.tr-card-body .goog-te-gadget { color: transparent; font-size: 0; line-height: 0; }
.tr-card-body .goog-te-gadget .goog-te-combo { color: #1f2d3d; }
@media (max-width: 640px) {
  .tr-widget { left: 16px; bottom: 82px; }
  .tr-float { width: 40px; height: 40px; }
  .tr-float svg { width: 21px; height: 21px; }
  .tr-float .tr-bubble { display: none; }
  .tr-card { width: min(260px, calc(100vw - 32px)); }
}
/* Hide Google Translate banner & keep layout stable */
.goog-te-banner-frame.skiptranslate, .goog-te-balloon-frame { display: none !important; }
body { top: 0px !important; }

/* iOS Add-to-Home-Screen install prompt */
.ios-install-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15, 23, 42, .55); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.ios-install-overlay[hidden] { display: none; }
.ios-install-modal {
  position: relative; background: #fff; border-radius: 18px;
  max-width: 360px; width: 100%; padding: 26px 22px 20px; text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,.3);
}
.ios-install-close {
  position: absolute; top: 10px; right: 14px; background: none; border: 0;
  font-size: 24px; line-height: 1; color: #94a3b8; cursor: pointer; padding: 2px;
}
.ios-install-close:hover { color: #334155; }
.ios-install-icon {
  width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 16px;
  background: #eaf3ff; display: flex; align-items: center; justify-content: center;
}
.ios-install-icon svg { width: 34px; height: 34px; }
.ios-install-modal h3 { font-size: 17px; color: #0f172a; margin: 0 0 14px; }
.ios-install-steps {
  text-align: left; margin: 0 0 4px; padding-left: 20px;
  color: #334155; font-size: 14px; line-height: 1.7;
}
.ios-install-steps li { margin-bottom: 8px; }
.ios-install-note { font-size: 14px; color: #475569; line-height: 1.6; margin: 0 0 10px; }
.share-glyph { display: inline-block; vertical-align: -5px; margin: 0 3px; }
.share-glyph svg { width: 20px; height: 20px; }
.ios-install-cta { width: 100%; margin-top: 8px; }
@media (max-width: 640px) {
  .ios-install-overlay { padding: 14px; }
}

/* Footer */
.pub-footer { background: var(--primary-dark); color: #f3d9d9; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 34px; padding: 52px 24px 34px; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.pub-footer h4 { color: #fff; font-size: 14px; margin-bottom: 12px; }
.pub-footer a { display: block; color: #e5b8b8; font-size: 13.5px; padding: 3px 0; }
.pub-footer a:hover { color: var(--gold); }
.pub-footer p { font-size: 13.5px; color: #94a3b8; padding: 2px 0; }
.footer-desc { margin-top: 10px; max-width: 280px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding: 16px 24px; text-align: center; color: #6b7fa3; font-size: 13px; }

/* Utility */
.mt-0{margin-top:0}.mt-1{margin-top:4px}.mt-2{margin-top:8px}.mt-3{margin-top:16px}.mt-4{margin-top:24px}.mt-5{margin-top:36px}
.mb-0{margin-bottom:0}.mb-1{margin-bottom:4px}.mb-2{margin-bottom:8px}.mb-3{margin-bottom:16px}.mb-4{margin-bottom:24px}
.ml-auto{margin-left:auto}.text-center{text-align:center}.text-right{text-align:right}
.text-muted{color:var(--text-muted)}.text-success{color:var(--success)}.text-danger{color:var(--danger)}
.text-gold{color:var(--gold)}.text-primary{color:var(--primary)}.fw-600{font-weight:600}.fw-800{font-weight:800}
.flex{display:flex}.flex-between{display:flex;align-items:center;justify-content:space-between;gap:12px}
.flex-center{display:flex;align-items:center;gap:10px}.flex-col{flex-direction:column}
.gap-1{gap:4px}.gap-2{gap:8px}.gap-3{gap:16px}.wrap{flex-wrap:wrap}
.hidden{display:none}

/* Print (receipts) */
@media print {
  .sidebar, .topbar, .btn, .pub-nav, .pub-footer, .no-print, .modal-foot { display: none !important; }
  .content { padding: 0; max-width: none; }
  .card, .receipt { border: 0; box-shadow: none; }
  body { background: #fff; }
}

/* Scrollbars */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
