:root {
  --bg: #f2efe9;
  --ink: #121a22;
  --muted: #596271;
  --panel: #ffffff;
  --line: #d7deea;
  --primary: #0e3f63;
  --primary-2: #175c8f;
  --accent: #c89435;
  --shadow: 0 16px 36px rgba(12, 21, 35, 0.1);
  --radius: 16px;
}

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

body {
  font-family: "Manrope", sans-serif;
  color: var(--ink);
}

.auth-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 0% 0%, rgba(200, 148, 53, 0.18), transparent 40%),
    radial-gradient(circle at 90% 10%, rgba(23, 92, 143, 0.2), transparent 42%),
    var(--bg);
}

.auth-layout {
  min-height: 100vh;
  width: min(1080px, 92%);
  margin: 0 auto;
  display: grid;
  place-items: center;
  padding: 32px 0;
}

.auth-panel {
  width: min(500px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
}

.back-link {
  display: inline-block;
  margin-bottom: 10px;
  margin-right: 10px;
  color: var(--primary-2);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
}

.auth-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  background: #e7f0f8;
  border-radius: 999px;
  padding: 6px 12px;
  margin-bottom: 10px;
}

.auth-title {
  font-size: clamp(1.55rem, 3vw, 2rem);
  margin-bottom: 8px;
}

.auth-subtitle {
  color: var(--muted);
  margin-bottom: 18px;
}

.auth-form {
  display: grid;
  gap: 10px;
}

.auth-form label {
  font-weight: 700;
  font-size: 0.9rem;
}

.auth-form input {
  width: 100%;
  border: 1px solid #c7d3e3;
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-form input:focus {
  border-color: var(--primary-2);
  box-shadow: 0 0 0 3px rgba(23, 92, 143, 0.14);
}

.form-row {
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.checkbox-wrap {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.87rem;
  font-weight: 500;
}

.checkbox-wrap input {
  width: 15px;
  height: 15px;
}

.text-link {
  color: var(--primary-2);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
}

.text-link:hover {
  text-decoration: underline;
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  border: none;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
  padding: 11px 14px;
  transition: 0.2s ease;
  font-size: 0.92rem;
}

.btn-primary {
  background: linear-gradient(145deg, var(--primary), var(--primary-2));
  color: #fff;
}

.btn-primary:hover {
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid #9bb2ca;
  color: var(--primary);
}

.btn-outline:hover {
  background: #eef4fa;
}

.btn-full {
  width: 100%;
  margin-top: 6px;
}

.auth-links {
  display: grid;
  gap: 10px;
}

.switch-text {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.admin-theme .auth-tag {
  background: #e7ece9;
  color: #1a5945;
}

@media (max-width: 600px) {
  .auth-panel {
    padding: 24px 16px;
  }

  .form-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

.dashboard-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 90% 0%, rgba(23, 92, 143, 0.2), transparent 30%),
    radial-gradient(circle at 0% 100%, rgba(200, 148, 53, 0.18), transparent 35%),
    #f5f7fb;
}

.dashboard-wrap {
  width: min(1220px, 94%);
  margin: 0 auto;
  padding: 20px 0 28px;
}

.dash-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.dash-brand h1 {
  font-size: clamp(1.4rem, 2.5vw, 1.95rem);
  margin-bottom: 4px;
}

.dash-brand p {
  color: var(--muted);
  font-size: 0.92rem;
}

.dash-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-light {
  background: #fff;
  border: 1px solid #cdd9e8;
  color: var(--primary);
}

.grid-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  background: #fff;
  border: 1px solid #dae2ee;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 8px 22px rgba(15, 26, 41, 0.06);
}

.stat-label {
  color: var(--muted);
  font-size: 0.84rem;
  margin-bottom: 7px;
}

.stat-value {
  font-size: 1.42rem;
  color: var(--primary);
  font-weight: 800;
}

.stat-note {
  margin-top: 6px;
  color: #1f8b5a;
  font-size: 0.82rem;
  font-weight: 700;
}

.dashboard-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 12px;
}

.dash-card {
  background: #fff;
  border: 1px solid #dae2ee;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 10px 26px rgba(12, 24, 40, 0.07);
}

.dash-card h3 {
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: 10px;
}

.notice-list {
  list-style: none;
  display: grid;
  gap: 9px;
}

.notice-list li {
  border: 1px solid #dbe5f1;
  border-radius: 11px;
  padding: 10px 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: #fdfefe;
}

.notice-meta strong {
  display: block;
  font-size: 0.93rem;
}

.notice-meta span {
  color: var(--muted);
  font-size: 0.82rem;
}

.pill {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.77rem;
  font-weight: 800;
  white-space: nowrap;
}

.pill.pending {
  background: #fff2dc;
  color: #9b6200;
}

.pill.progress {
  background: #e8f2ff;
  color: #1351a7;
}

.pill.done {
  background: #dcf7ea;
  color: #1c714b;
}

.timeline-mini {
  list-style: none;
  display: grid;
  gap: 8px;
}

.timeline-mini li {
  border-left: 3px solid #98b3ce;
  padding: 4px 0 4px 10px;
  color: #26303d;
  font-size: 0.88rem;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.quick-tile {
  border: 1px solid #d8e2ef;
  border-radius: 10px;
  padding: 11px 10px;
  text-decoration: none;
  color: #1a2b3e;
  font-weight: 700;
  font-size: 0.88rem;
  background: #f8fbff;
}

.quick-tile:hover {
  border-color: #a9bfd7;
}

.table-like {
  display: grid;
  gap: 8px;
}

.row {
  border: 1px solid #dae3ef;
  border-radius: 10px;
  padding: 9px 10px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.88rem;
}

.row span {
  color: var(--muted);
}

@media (max-width: 980px) {
  .grid-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .grid-stats {
    grid-template-columns: 1fr;
  }

  .dash-topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .quick-grid {
    grid-template-columns: 1fr;
  }
}

/* Modern app dashboard layout */
.app-shell {
  min-height: 100vh;
  background: #f4f7fb;
  display: grid;
  grid-template-columns: 270px 1fr;
}

.app-sidebar {
  background: linear-gradient(175deg, #0b2d46, #123f60);
  color: #dce8f2;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  z-index: 20;
}

.brand-wrap {
  padding: 10px 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.brand-wrap h2 {
  font-size: 1.08rem;
  font-weight: 800;
  color: #fff;
}

.brand-wrap p {
  margin-top: 4px;
  font-size: 0.8rem;
  color: #b8ccdd;
}

.side-nav {
  margin-top: 14px;
  display: grid;
  gap: 5px;
}

.side-link {
  text-decoration: none;
  color: #d7e6f2;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 10px 11px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: 0.2s ease;
}

.side-link:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}

.side-link.active {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.side-footer {
  margin-top: 18px;
  padding: 12px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 0.82rem;
  color: #cde0ef;
}

.app-main {
  min-width: 0;
}

.top-header {
  position: sticky;
  top: 0;
  z-index: 15;
  background: rgba(244, 247, 251, 0.96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid #d9e2ef;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-toggle {
  border: 1px solid #c8d6e8;
  background: #fff;
  color: #1b3f5f;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 1.2rem;
  cursor: pointer;
  display: none;
}

.header-title h1 {
  font-size: clamp(1.2rem, 2.2vw, 1.7rem);
  color: #11273c;
}

.header-title p {
  color: var(--muted);
  font-size: 0.86rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.avatar-chip {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 800;
  background: #e1eefb;
  color: #104779;
  border: 1px solid #c8dbef;
}

.app-content {
  padding: 18px 24px 30px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stat-item {
  background: #fff;
  border: 1px solid #dbe5f1;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 8px 24px rgba(14, 28, 47, 0.06);
}

.stat-item .k {
  color: #5e6878;
  font-size: 0.83rem;
}

.stat-item .v {
  margin-top: 7px;
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f3d61;
}

.stat-item .delta {
  margin-top: 6px;
  color: #1a8558;
  font-size: 0.82rem;
  font-weight: 700;
}

.content-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 12px;
}

.panel {
  background: #fff;
  border: 1px solid #dbe5f1;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 10px 26px rgba(13, 29, 47, 0.07);
}

.panel h3 {
  margin-bottom: 10px;
  color: #103c5f;
  font-size: 1.02rem;
}

.status-list {
  list-style: none;
  display: grid;
  gap: 8px;
}

.status-list li {
  border: 1px solid #dbe5f1;
  border-radius: 11px;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.status-list strong {
  display: block;
  font-size: 0.95rem;
}

.status-list small {
  display: block;
  color: #647084;
  margin-top: 2px;
}

.chip {
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.chip.blue {
  background: #e7f1ff;
  color: #1659b0;
}

.chip.orange {
  background: #fff0d8;
  color: #9a6200;
}

.chip.green {
  background: #def6e8;
  color: #1e6f4b;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.action-btn {
  text-decoration: none;
  border: 1px solid #d7e3f0;
  border-radius: 10px;
  background: #f9fbff;
  color: #1b3149;
  padding: 11px 10px;
  font-size: 0.88rem;
  font-weight: 700;
}

.action-btn:hover {
  border-color: #a9bfd7;
}

.event-list {
  list-style: none;
  display: grid;
  gap: 9px;
}

.event-list li {
  border-left: 3px solid #9ab8d4;
  padding-left: 10px;
  color: #304157;
  font-size: 0.89rem;
}

.kv-list {
  display: grid;
  gap: 8px;
}

.kv {
  border: 1px solid #dce5f0;
  border-radius: 10px;
  padding: 9px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
}

.kv span {
  color: #657286;
}

.admin-shell .app-sidebar {
  background: linear-gradient(175deg, #0b2d46, #123f60);
}

.admin-shell .avatar-chip {
  background: #e1f5ec;
  color: #1e6c50;
  border-color: #c6e8d9;
}

.admin-shell .chip.blue {
  background: #e8f6ef;
  color: #206d51;
}

.lawyer-shell .app-sidebar {
  background: linear-gradient(175deg, #0b2d46, #123f60);
}

.lawyer-shell .avatar-chip {
  background: #eee8ff;
  color: #4a2d9c;
  border-color: #dbccff;
}

.lawyer-shell .chip.blue {
  background: #f0e9ff;
  color: #5a35b4;
}

.mobile-overlay {
  display: none;
}

@media (max-width: 1100px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .menu-toggle {
    display: inline-grid;
    place-items: center;
  }

  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    width: 270px;
  }

  .app-shell.sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  .mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 18, 28, 0.45);
    z-index: 19;
  }

  .app-shell.sidebar-open .mobile-overlay {
    display: block;
  }

  .top-header {
    padding: 12px 14px;
  }

  .app-content {
    padding: 12px 14px 22px;
  }
}

@media (max-width: 640px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .action-grid {
    grid-template-columns: 1fr;
  }

  .header-actions .btn {
    padding: 9px 10px;
    font-size: 0.84rem;
  }
}

/* Landing page */
.landing-wrap {
  width: min(1180px, 94%);
  margin: 0 auto;
  padding: 40px 0;
}

.landing-hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
}

.landing-main {
  background: linear-gradient(145deg, #ffffff, #f6f9fd);
  border: 1px solid #d7e3f1;
  border-radius: 20px;
  box-shadow: 0 18px 38px rgba(12, 24, 40, 0.1);
  padding: 28px;
}

.landing-main h1 {
  font-size: clamp(1.7rem, 3.2vw, 2.6rem);
  line-height: 1.2;
  color: #10283d;
}

.landing-main p {
  margin-top: 10px;
  color: #5c6778;
  max-width: 62ch;
}

.landing-actions {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.landing-aside {
  background: linear-gradient(165deg, #0f3e61, #15527d);
  color: #e3eef7;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 22px;
}

.landing-aside h3 {
  font-size: 1.02rem;
  margin-bottom: 10px;
}

.flow-list {
  list-style: none;
  display: grid;
  gap: 8px;
}

.flow-list li {
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 11px;
  padding: 9px 10px;
  font-size: 0.86rem;
  background: rgba(255, 255, 255, 0.08);
}

.role-section {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.role-box {
  background: #fff;
  border: 1px solid #d8e3f1;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 10px 24px rgba(12, 25, 42, 0.07);
}

.role-box h4 {
  color: #113f61;
  margin-bottom: 8px;
}

.role-box p {
  color: #607084;
  font-size: 0.88rem;
}

@media (max-width: 980px) {
  .landing-hero {
    grid-template-columns: 1fr;
  }

  .landing-actions {
    grid-template-columns: 1fr;
  }

  .role-section {
    grid-template-columns: 1fr;
  }
}

/* Landing page v2 */
.landing-v2 {
  width: min(1240px, 94%);
  margin: 0 auto;
  padding: 26px 0 34px;
}

.landing-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 2px 16px;
}

.landing-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #173650;
}

.landing-logo .dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: linear-gradient(140deg, #0e3f63, #c89435);
  box-shadow: 0 0 0 5px rgba(14, 63, 99, 0.14);
}

.landing-logo strong {
  font-size: 1rem;
}

.hero-v2 {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
}

.hero-left-v2 {
  background:
    radial-gradient(circle at 95% 10%, rgba(14, 63, 99, 0.1), transparent 35%),
    #ffffff;
  border: 1px solid #d7e3f1;
  border-radius: 22px;
  padding: 30px;
  box-shadow: 0 20px 42px rgba(12, 24, 40, 0.12);
}

.hero-left-v2 h1 {
  margin-top: 6px;
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  line-height: 1.14;
  color: #122c43;
  max-width: 20ch;
}

.hero-copy {
  margin-top: 14px;
  color: #5d6879;
  max-width: 62ch;
  font-size: 1.02rem;
}

.hero-cta {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.trust-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.trust-box {
  border: 1px solid #d6e2f1;
  border-radius: 12px;
  padding: 11px 10px;
  background: #f9fbff;
}

.trust-box span {
  display: block;
  font-size: 0.76rem;
  color: #68768a;
  margin-bottom: 4px;
}

.trust-box strong {
  color: #163f61;
  font-size: 0.9rem;
}

.hero-right-v2 {
  background: linear-gradient(170deg, #0d4167, #154f7b);
  border-radius: 22px;
  padding: 24px;
  color: #e6f2fb;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 20px 42px rgba(12, 24, 40, 0.12);
}

.hero-right-v2 h3 {
  font-size: 1.12rem;
  margin-bottom: 10px;
}

.flow-steps {
  list-style: none;
  display: grid;
  gap: 9px;
}

.flow-steps li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 9px;
  align-items: start;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 9px;
}

.flow-steps span {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: #0f3f62;
  background: #d9ecfb;
}

.flow-steps p {
  font-size: 0.88rem;
  color: #d8e8f5;
  padding-top: 4px;
}

.portal-v2 {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.portal-card {
  background: #fff;
  border: 1px solid #d9e4f2;
  border-radius: 15px;
  padding: 16px;
  box-shadow: 0 12px 28px rgba(12, 25, 42, 0.08);
}

.portal-card h4 {
  font-size: 1.06rem;
  margin-bottom: 7px;
  color: #103c5f;
}

.portal-card p {
  color: #607085;
  font-size: 0.9rem;
  min-height: 48px;
}

.portal-card a {
  display: inline-block;
  margin-top: 11px;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.86rem;
  color: #144f7c;
}

.portal-card.client {
  border-top: 4px solid #1f5d8c;
}

.portal-card.lawyer {
  border-top: 4px solid #2f7f5e;
}

.portal-card.admin {
  border-top: 4px solid #88612e;
}

@media (max-width: 1060px) {
  .hero-v2 {
    grid-template-columns: 1fr;
  }

  .portal-v2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .landing-nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-left-v2 {
    padding: 22px 16px;
  }

  .hero-cta {
    grid-template-columns: 1fr;
  }

  .trust-grid {
    grid-template-columns: 1fr;
  }

  .hero-right-v2 {
    padding: 18px 14px;
  }
}
