/* =============================
   BELIZE HIGH COURT — Case Editor
   MOBILE FIRST CSS
   ============================= */

:root {
  --navy:       #0a1628;
  --navy-mid:   #0f2044;
  --navy-light: #1a3360;
  --blue:       #1e4d8c;
  --accent:     #2e7de9;
  --gold:       #c9a84c;
  --white:      #ffffff;
  --off-white:  #f4f7fc;
  --border:     #d0ddef;
  --text-dark:  #0d1f3c;
  --text-mid:   #4a6080;
  --text-light: #8aa0bc;
  --success:    #1aab6d;
  --danger:     #e5405e;
  --warning:    #e8952d;
  --card-shadow: 0 4px 24px rgba(10,22,40,0.10);
  --radius:     12px;
  --radius-sm:  7px;
  --transition: 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--off-white);
  color: var(--text-dark);
  min-height: 100vh;
}

/* ---- TOP NAV ---- */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  padding: 0 16px;
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
  border-bottom: 1px solid var(--navy-light);
}

.topnav-inner {
  height: 60px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.topnav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.brand-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  flex-shrink: 0;
}

.brand-text { display: flex; flex-direction: column; }
.brand-title {
  font-family: 'Playfair Display', serif;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 2px;
  line-height: 1.1;
}
.brand-subtitle {
  font-size: 9px;
  color: var(--text-light);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

/* Mobile: hide tabs by default */
.topnav-tabs {
  display: none;
  flex-direction: column;
  padding: 8px 0 12px;
  gap: 2px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.topnav-tabs.open { display: flex; }

.nav-tab {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.65);
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
}
.nav-tab:hover { background: rgba(255,255,255,0.07); color: #fff; }
.nav-tab.active {
  background: rgba(46,125,233,0.22);
  color: #fff;
  border: 1px solid rgba(46,125,233,0.4);
}

.topnav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-badge {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-icon {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 16px;
  cursor: pointer;
  padding: 7px;
  border-radius: 8px;
  transition: all var(--transition);
}
.btn-icon:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* Hamburger for mobile nav tabs */
.nav-hamburger {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 18px;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all var(--transition);
}
.nav-hamburger:hover { color: #fff; background: rgba(255,255,255,0.08); }

/* ---- MAIN CONTENT ---- */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

/* ---- PAGE HEADER ---- */
.page-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.page-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.case-badge {
  background: var(--navy);
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 5px 12px;
  border-radius: 4px;
  border: 1px solid rgba(201,168,76,0.35);
  white-space: nowrap;
}
.page-title {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.1;
}
.page-subtitle {
  font-size: 12px;
  color: var(--text-mid);
  margin-top: 2px;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 6px 14px;
  border-radius: 20px;
  align-self: flex-start;
}
.status-pill.finalized {
  background: rgba(26,171,109,0.1);
  color: var(--success);
  border: 1px solid rgba(26,171,109,0.3);
}
.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* ---- CARDS ---- */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid rgba(208,221,239,0.6);
  animation: fadeSlideUp 0.4s ease forwards;
  opacity: 0;
  transform: translateY(12px);
}
.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.12s; }
.card:nth-child(3) { animation-delay: 0.19s; }

@keyframes fadeSlideUp { to { opacity:1; transform:translateY(0); } }

.card-header {
  background: linear-gradient(90deg, var(--navy), var(--navy-light));
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-icon { color: var(--gold); font-size: 14px; }
.card-title {
  font-family: 'Playfair Display', serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
}
.card-body { padding: 18px 16px 16px; }

/* ---- GRIDS — mobile: 1 col by default ---- */
.grid-2, .grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.span-2 { grid-column: span 1; }

/* ---- FORM FIELDS ---- */
.field-group { display: flex; flex-direction: column; gap: 5px; }
.field-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-mid);
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.input-field {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text-dark);
  background: var(--white);
  outline: none;
  transition: all var(--transition);
  appearance: none;
  -webkit-appearance: none;
}
.input-field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(46,125,233,0.12);
}
select.input-field {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234a6080' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 34px;
  cursor: pointer;
}
.textarea { resize: vertical; min-height: 80px; }
.status-input { color: var(--text-mid); font-weight: 600; }
.approved-input { color: var(--success); font-weight: 600; }
.unverified-input { color: var(--warning); font-weight: 600; }
input[readonly] { background: #f7f9fc; cursor: default; }

/* ---- CHECKBOXES ---- */
.checkboxes-row {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-dark);
  user-select: none;
}
.checkbox-input { display: none; }
.checkbox-custom {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}
.checkbox-input:checked + .checkbox-custom {
  background: var(--accent);
  border-color: var(--accent);
}
.checkbox-input:checked + .checkbox-custom::after {
  content: '';
  width: 5px; height: 9px;
  border: 2px solid #fff;
  border-top: none; border-left: none;
  transform: rotate(45deg) translate(-1px,-1px);
  display: block;
}

/* ---- ACTION BAR ---- */
.action-bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--white);
  border: 1px solid rgba(208,221,239,0.6);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--card-shadow);
  animation: fadeSlideUp 0.4s ease 0.26s forwards;
  opacity: 0;
  transform: translateY(12px);
}
.action-left, .action-right {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.action-right { justify-content: flex-end; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  flex: 1;
  justify-content: center;
  min-width: 100px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #1a62c8);
  color: #fff;
  box-shadow: 0 4px 14px rgba(46,125,233,0.35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(46,125,233,0.45); }
.btn-secondary { background: var(--navy); color: #fff; }
.btn-secondary:hover { background: var(--navy-light); }
.btn-outline {
  background: transparent;
  color: var(--blue);
  border: 1.5px solid var(--border);
}
.btn-outline:hover { background: var(--off-white); border-color: var(--accent); color: var(--accent); }
.btn-danger {
  background: rgba(229,64,94,0.08);
  color: var(--danger);
  border: 1.5px solid rgba(229,64,94,0.25);
}
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

/* ---- TOAST ---- */
.toast {
  position: fixed;
  bottom: 20px; right: 16px; left: 16px;
  background: var(--navy);
  color: #fff;
  padding: 13px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);
  border-left: 4px solid var(--accent);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.35s cubic-bezier(.34,1.56,.64,1);
  z-index: 999;
  pointer-events: none;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ===================================================
   TABLET — 600px+
   =================================================== */
@media (min-width: 600px) {
  .topnav { padding: 0 24px; flex-direction: row; align-items: center; height: 64px; }
  .topnav-inner { flex: 1; }
  .topnav-tabs {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    padding: 0;
    border-top: none;
    border-left: 1px solid rgba(255,255,255,0.08);
    padding-left: 16px;
    margin-left: 8px;
  }
  .nav-hamburger { display: none; }
  .nav-tab { font-size: 13px; padding: 8px 14px; }
  .brand-title { font-size: 14px; }
  .brand-subtitle { font-size: 10px; }
  .user-badge { font-size: 12px; padding: 5px 12px; }

  .main-content { padding: 24px 24px 60px; }

  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .span-2 { grid-column: span 2; }

  .page-header { flex-direction: row; align-items: center; justify-content: space-between; }
  .status-pill { align-self: auto; }

  .checkboxes-row { flex-direction: row; flex-wrap: wrap; }

  .action-bar { flex-direction: row; justify-content: space-between; padding: 16px 20px; }
  .btn { flex: 0 0 auto; }

  .toast { left: auto; width: auto; min-width: 280px; }
}

/* ===================================================
   DESKTOP — 960px+
   =================================================== */
@media (min-width: 960px) {
  .topnav { padding: 0 32px; }
  .brand-title { font-size: 15px; }
  .brand-subtitle { font-size: 10px; }
  .nav-tab { font-size: 13.5px; padding: 8px 18px; }
  .user-badge { font-size: 12.5px; }

  .main-content { padding: 32px 32px 60px; }
  .card-body { padding: 24px 24px 20px; }
  .card-header { padding: 14px 24px; }
  .card-icon { font-size: 15px; }
  .card-title { font-size: 15px; }

  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .page-title { font-size: 26px; }
  .action-bar { padding: 16px 24px; }
}