/*
  Colour palette:
    --dark:   #0D1B2A  very dark navy
    --teal:   #2E5F78  dark teal (primary)
    --steel:  #7A9EB3  steel blue (accent)
    --coral:  #F07060  coral (danger / highlight)
    --mid:    #1E3A50  mid navy (gradients)
*/

/* ── Reset & base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }

body {
  font-family: 'Segoe UI', system-ui, Arial, sans-serif;
  background: #e8ecf1;
  color: #0D1B2A;
  min-height: 100vh;
}

a { color: #2E5F78; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Sidebar ───────────────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 220px;
  height: 100vh;
  background: #0D1B2A;
  display: flex;
  flex-direction: column;
  z-index: 100;
  box-shadow: 2px 0 10px rgba(0,0,0,.3);
  overflow-y: auto;
}

.sidebar-brand {
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.sidebar-brand a {
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: .03em;
  text-decoration: none;
}

.sidebar-nav { padding: .5rem 0; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .6rem 1.5rem;
  color: #7A9EB3;
  font-size: .875rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  text-decoration: none;
  transition: background .12s, color .12s, border-color .12s;
}
.sidebar-link:hover {
  background: rgba(122,158,179,.15);
  color: #fff;
  border-left-color: #2E5F78;
  text-decoration: none;
}
.sidebar-link svg { flex-shrink: 0; opacity: .7; }
.sidebar-link:hover svg { opacity: 1; }

.sidebar-section-label {
  padding: .9rem 1.5rem .25rem;
  font-size: .65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #3a5a6a;
}

.sidebar-spacer { flex: 1; }

.sidebar-user {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: .75rem 1rem;
  position: relative;
  flex-shrink: 0;
}

.sidebar-user-btn {
  display: flex;
  align-items: center;
  gap: .5rem;
  width: 100%;
  background: rgba(122,158,179,.1);
  border: 1px solid rgba(122,158,179,.2);
  border-radius: 8px;
  color: #c8dce8;
  font-size: .85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  padding: .5rem .75rem;
  transition: background .15s, color .15s;
}
.sidebar-user-btn:hover { background: rgba(122,158,179,.2); color: #fff; }
.sidebar-user-name { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-chevron { transition: transform .2s; flex-shrink: 0; }
.sidebar-user-btn[aria-expanded="true"] .sidebar-chevron { transform: rotate(180deg); }

.sidebar-user-menu {
  display: none;
  position: absolute;
  bottom: calc(100% - .25rem);
  left: 1rem;
  right: 1rem;
  background: #fff;
  border: 1px solid #dce3ed;
  border-radius: 8px;
  box-shadow: 0 -4px 20px rgba(0,0,0,.18);
  padding: .4rem 0;
  z-index: 1001;
  animation: slideUp .15s ease;
}
.sidebar-user-menu.open { display: block; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.sidebar-user-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem 1rem;
  font-size: .875rem;
  color: #1a1f36;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background .12s, color .12s, border-color .12s;
}
.sidebar-user-item:hover { background: #eef4f8; color: #2E5F78; border-left-color: #2E5F78; text-decoration: none; }
.sidebar-user-item-danger:hover { background: #fef0ee; color: #F07060; border-left-color: #F07060; }

/* ── Container ─────────────────────────────────────────────────────────────── */
.container {
  max-width: 1300px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}
.container.with-sidebar {
  margin-left: 240px;
  margin-right: 2rem;
  max-width: none;
}

/* ── Alerts ────────────────────────────────────────────────────────────────── */
.alert {
  padding: .75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: .9rem;
}
.alert-error   { background: #fef0ee; color: #7a1f1f; border-left: 4px solid #F07060; }
.alert-success { background: #eafaf1; color: #1e6b3a; border-left: 4px solid #27ae60; }

/* ── Login ─────────────────────────────────────────────────────────────────── */
.login-wrap {
  display: flex;
  justify-content: center;
  padding-top: 5vh;
}

.login-card {
  background: #fff;
  border: 1px solid #dce3ed;
  border-radius: 12px;
  padding: 2.5rem 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 24px rgba(13,27,42,.12);
}

.login-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.login-header h1 {
  font-size: .95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #2E5F78;
  line-height: 1.4;
}

.login-sub {
  font-size: .8rem;
  color: #666;
  margin-top: .4rem;
}

/* ── Forms ─────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }

label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: .35rem;
  color: #2d3748;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
input[type="time"],
input[type="number"],
input[type="url"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: .5rem .75rem;
  border: 1px solid #c8d4de;
  border-radius: 6px;
  font-size: .9rem;
  font-family: inherit;
  background: #fff;
  color: #0D1B2A;
  transition: border-color .15s, box-shadow .15s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #2E5F78;
  box-shadow: 0 0 0 3px rgba(46,95,120,.12);
}

textarea { resize: vertical; min-height: 80px; }

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.form-hint {
  font-size: .78rem;
  color: #7A9EB3;
  margin-top: .25rem;
}

.form-check { display: flex; align-items: center; gap: .5rem; }
.form-check input[type="checkbox"] { width: auto; margin: 0; }

/* ── Judge chips ─────────────────────────────────────────────────────────── */
.judge-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-bottom: .5rem;
}
.judge-chip {
  background: #EBF3F8;
  border: 1px solid #B8D4E3;
  color: #2E5F78;
  border-radius: 20px;
  padding: .2rem .75rem;
  font-size: .8rem;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.judge-chip:hover {
  background: #2E5F78;
  color: #fff;
  border-color: #2E5F78;
}

/* ── Add dropdown menu ───────────────────────────────────────────────────── */
.add-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: #fff;
  border: 1px solid #dde6ed;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,.12);
  min-width: 230px;
  z-index: 200;
  overflow: hidden;
}
.add-menu.open { display: block; }
.add-menu-item {
  display: flex;
  flex-direction: column;
  padding: .6rem 1rem;
  text-decoration: none;
  color: #0D1B2A;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  transition: background .12s;
}
.add-menu-item:hover { background: #EBF3F8; }
.add-menu-item strong { font-size: .9rem; }
.add-menu-item span { font-size: .75rem; color: #7A9EB3; margin-top: .1rem; }
.add-menu-item-form { display: block; }
.add-menu-divider { border-top: 1px solid #eee; margin: .25rem 0; }

/* ── Annotation rows ─────────────────────────────────────────────────────── */
.annotation-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem .75rem;
  margin-bottom: .5rem;
  border-radius: 6px;
}
.annotation-drag { color: #aaa; cursor: grab; font-size: 1.1rem; }
.annotation-heading { background: #F0F6FA; border: 1px solid #C8DCEC; }
.annotation-heading-text { font-size: 1rem; font-weight: 700; color: #0D1B2A; letter-spacing: .03em; flex: 1; }
.annotation-divider { background: #fafafa; border: 1px dashed #ccc; }
.annotation-rule-wrap { flex: 1; }
.annotation-rule { border: none; border-top: 2px solid #B0C8D8; margin: 0; }
.annotation-pagebreak { background: #FFF8F0; border: 1px dashed #F07060; }
.annotation-pagebreak-label { flex: 1; font-size: .85rem; font-weight: 600; color: #F07060; letter-spacing: .1em; }
.annotation-note { background: #FFFBEC; border: 1px solid #E8D88A; align-items: flex-start; }
.annotation-note-text { flex: 1; font-size: .88rem; color: #5A4A00; white-space: pre-wrap; line-height: 1.5; }
.annotation-actions { margin-left: auto; flex-shrink: 0; display: flex; gap: .35rem; align-items: center; justify-content: flex-end; min-width: 72px; }

/* ── Move wrap ───────────────────────────────────────────────────────────── */
.move-wrap { position: relative; display: inline-block; }

.btn-icon { padding: .3rem .45rem; line-height: 1; }
.btn-icon svg { display: block; }

.annotation-edit-form { display: flex; gap: .4rem; align-items: center; flex: 1; }
.annotation-edit-form input,
.annotation-edit-form textarea { flex: 1; }

.radio-group { display: flex; gap: 1.25rem; flex-wrap: wrap; margin-top: .25rem; }
.radio-group label { font-weight: normal; display: flex; align-items: center; gap: .35rem; }

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .46rem 1rem;
  border: none;
  border-radius: 6px;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, box-shadow .15s, transform .08s;
  white-space: nowrap;
  letter-spacing: .01em;
}
.btn:active { transform: translateY(1px); }

.btn-primary   { background: #2E5F78; color: #fff; box-shadow: 0 1px 4px rgba(46,95,120,.35); }
.btn-primary:hover { background: #235470; text-decoration: none; box-shadow: 0 2px 8px rgba(46,95,120,.4); }

.btn-secondary { background: #eef2f6; color: #2d3748; border: 1px solid #d4dce7; }
.btn-secondary:hover { background: #e2eaf2; text-decoration: none; }

.btn-danger    { background: #F07060; color: #fff; box-shadow: 0 1px 4px rgba(240,112,96,.35); }
.btn-danger:hover { background: #d9604f; text-decoration: none; }

.btn-success   { background: #27ae60; color: #fff; box-shadow: 0 1px 4px rgba(39,174,96,.3); }
.btn-success:hover { background: #1e8449; text-decoration: none; }

.btn-warning   { background: #e67e22; color: #fff; }
.btn-warning:hover { background: #ca6f1e; text-decoration: none; }

.btn-sm { padding: .28rem .65rem; font-size: .8rem; border-radius: 5px; }
.btn-block { width: 100%; justify-content: center; }

.btn-group { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* ── Page header ───────────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: .75rem;
}

.page-header h1 { font-size: 1.4rem; font-weight: 700; color: #0D1B2A; }
.page-header h2 { font-size: 1.15rem; font-weight: 700; }

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid #dce6ef;
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 3px rgba(13,27,42,.06), 0 4px 16px rgba(13,27,42,.05);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1rem;
}

.card-title { font-size: 1rem; font-weight: 700; color: #2E5F78; }

/* ── Tables ────────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

thead th {
  background: #f0f5f9;
  padding: .65rem .85rem;
  text-align: left;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #2E5F78;
  border-bottom: 2px solid #d4e0ea;
  white-space: nowrap;
}

tbody tr { border-bottom: 1px solid #edf2f7; transition: background .1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:nth-child(even) { background: #fafcfd; }
tbody tr:hover { background: #eef5f9; }

td { padding: .6rem .85rem; vertical-align: top; }

.table-actions { white-space: nowrap; }

/* ── Status badges ─────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.badge-draft    { background: #e8ecf1; color: #4a5568; }
.badge-ready    { background: #deeef6; color: #1a4d66; }
.badge-sent     { background: #d5f5e3; color: #1e6b3a; }
.badge-admin    { background: #fef0ee; color: #7a2f28; }
.badge-user     { background: #e8f4f8; color: #2E5F78; }
.badge-active   { background: #d5f5e3; color: #1e6b3a; }
.badge-inactive { background: #fef0ee; color: #7a2f28; }

/* ── Section divider ───────────────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid #dce6ef;
  margin: 1.5rem 0;
}

/* ── Text utilities ────────────────────────────────────────────────────────── */
.text-muted    { color: #7A9EB3; font-size: .875rem; }
.text-small    { font-size: .8rem; }
.text-right    { text-align: right; }
.text-center   { text-align: center; }
.mt-1          { margin-top: .5rem; }
.mt-2          { margin-top: 1rem; }
.mb-1          { margin-bottom: .5rem; }
.mb-2          { margin-bottom: 1rem; }

/* ── Court section on roll show page ──────────────────────────────────────── */
.court-section {
  background: #fff;
  border: 1px solid #dce6ef;
  border-radius: 10px;
  margin-bottom: 1.25rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(13,27,42,.06), 0 4px 16px rgba(13,27,42,.05);
}

.court-section-header {
  background: linear-gradient(135deg, #0D1B2A 0%, #1E3A50 100%);
  color: #fff;
  padding: .9rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
}

.court-section-header h3 {
  font-size: 1rem;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 700;
  color: #fff;
}

.court-section-header .btn {
  color: #c8dce8;
  background: rgba(122,158,179,.18);
  border: 1px solid rgba(122,158,179,.28);
  border-radius: 6px;
}
.court-section-header .btn:hover {
  background: rgba(122,158,179,.32);
  color: #fff;
  text-decoration: none;
}
.court-section-header .btn-danger {
  color: #fff;
  background: rgba(240,112,96,.7);
  border-color: rgba(240,112,96,.4);
}
.court-section-header .btn-danger:hover { background: rgba(240,112,96,.9); }

.court-meta {
  padding: .6rem 1.25rem;
  background: #f5f8fb;
  border-bottom: 1px solid #dce6ef;
  font-size: .85rem;
  color: #4a5568;
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.court-meta strong { color: #2E5F78; }

.court-body { padding: 1rem 1.25rem; }

/* ── In-session annotations ──────────────────────────────────────────────── */
.in-session-annotation td { padding: .3rem .6rem; }
.in-session-heading td { background: #eef3f8; }
.in-session-heading .isa-text { font-weight: 700; font-size: .88rem; color: #0D1B2A; text-transform: uppercase; letter-spacing: .04em; }
.in-session-note td { background: #fffbf0; }
.in-session-note .isa-note-text { font-size: .82rem; color: #665; font-style: italic; }
.in-session-divider td { background: transparent; }
.isa-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; width: 100%; }
.isa-content { flex: 1; min-width: 0; }
.isa-actions { flex-shrink: 0; white-space: nowrap; }
.isa-edit-form { display: flex; flex-direction: column; flex: 1; gap: .25rem; }

/* ── Matter detail sub-row ───────────────────────────────────────────────── */
.matter-detail-row td { background: #f4f7fa; border-top: none !important; font-size: .76rem; color: #445; padding: .25rem .5rem .3rem; }
.hearing-summary-row { display: flex; flex-wrap: wrap; gap: .2rem 1.2rem; align-items: baseline; }
.hgc { letter-spacing: .02em; font-size: .76rem; }
.hgc strong { color: #1E3A50; font-weight: 600; }
.hgc-sec { color: #778; }
.hgc-note { font-style: italic; color: #886; }

/* ── Session collapse button ─────────────────────────────────────────────── */
.btn-collapse { background: none; border: none; color: rgba(255,255,255,.55); cursor: pointer; padding: .2rem .25rem; line-height:1; display:flex; align-items:center; }
.btn-collapse:hover { color: #fff; }
.btn-collapse svg { transition: transform .2s; }
.btn-collapse.collapsed svg { transform: rotate(-90deg); }

/* ── Matter count badge ──────────────────────────────────────────────────── */
.matter-count-badge {
  display: inline-block;
  background: rgba(255,255,255,.18);
  color: #fff;
  font-size: .68rem;
  font-weight: 600;
  border-radius: 10px;
  padding: .1rem .5rem;
  margin-left: .45rem;
  vertical-align: middle;
  letter-spacing: .02em;
}

/* ── Inline matter form ──────────────────────────────────────────────────── */
.inline-matter-form {
  background: #f0f5fa;
  border-top: 1px solid #d0dde8;
  padding: .85rem 1.25rem;
  border-radius: 0 0 8px 8px;
}
.imf-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .5rem; }
.imf-group { display: flex; flex-direction: column; gap: .2rem; min-width: 100px; }
.imf-group label { font-size: .7rem; font-weight: 600; color: #2E5F78; text-transform: uppercase; letter-spacing: .03em; }
.imf-group input, .imf-group select { padding: .3rem .5rem; font-size: .85rem; border: 1px solid #b8ccd8; border-radius: 5px; background: #fff; }
.imf-group input:focus, .imf-group select:focus { outline: none; border-color: #2E5F78; box-shadow: 0 0 0 2px rgba(46,95,120,.15); }
.imf-narrow { max-width: 70px; }
.imf-wide { flex: 1; min-width: 160px; }
.imf-actions { display: flex; gap: .5rem; margin-top: .4rem; }

.drag-handle {
  cursor: grab;
  color: #b0bec8;
  padding: 0 .4rem;
  font-size: 1rem;
  user-select: none;
  transition: color .15s;
}
.drag-handle:hover { color: #2E5F78; }

/* ── Virtual court info ────────────────────────────────────────────────────── */
.teams-info {
  background: #edf5fa;
  border: 1px solid #b8d4e4;
  border-radius: 6px;
  padding: .5rem .9rem;
  font-size: .82rem;
  margin-bottom: .75rem;
  color: #2E5F78;
}

/* ── Admin dashboard stat cards ────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: #fff;
  border: 1px solid #dce6ef;
  border-radius: 10px;
  padding: 1.25rem 1rem;
  text-align: center;
  box-shadow: 0 1px 3px rgba(13,27,42,.05);
}

.stat-card .stat-value { font-size: 2rem; font-weight: 700; color: #2E5F78; }
.stat-card .stat-label { font-size: .8rem; color: #7A9EB3; margin-top: .25rem; text-transform: uppercase; letter-spacing: .05em; }

/* ── Conditional virtual fields ────────────────────────────────────────────── */
.virtual-fields { display: none; }
.virtual-fields.visible { display: block; }

/* ── Sortable ghost ─────────────────────────────────────────────────────────── */
.sortable-ghost { opacity: .4; background: #deeef6; }

/* ── Settings tabs ──────────────────────────────────────────────────────────── */
.settings-tabs-nav {
  display: flex;
  gap: .25rem;
  margin-bottom: 1.25rem;
  border-bottom: 2px solid #dce6ef;
}

.settings-tab {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem 1rem;
  border: none;
  background: none;
  cursor: pointer;
  font-size: .875rem;
  font-weight: 600;
  color: #7A9EB3;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
}
.settings-tab:hover { color: #2E5F78; }
.settings-tab.active { color: #2E5F78; border-bottom-color: #2E5F78; }

.settings-tab-pane { display: none; }
.settings-tab-pane.active { display: block; }

.settings-card {
  background: #fff;
  border: 1px solid #dce6ef;
  border-radius: 10px;
  padding: 1.5rem;
  max-width: 620px;
  box-shadow: 0 1px 3px rgba(13,27,42,.05);
}

.settings-card-header {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-bottom: 1.25rem;
}
.settings-card-header h3 { font-size: 1rem; font-weight: 700; color: #2E5F78; margin: 0; }
.settings-card-desc { font-size: .85rem; color: #7A9EB3; margin-bottom: 1.25rem; }

.settings-grid { display: flex; flex-direction: column; }

.settings-row {
  display: grid;
  grid-template-columns: 170px 1fr;
  align-items: center;
  padding: .65rem 0;
  border-bottom: 1px solid #f0f5f9;
  gap: 1rem;
}
.settings-row:last-child { border-bottom: none; }
.settings-row-divider { border-top: 1px solid #dce6ef; margin-top: .5rem; padding-top: 1rem; }
.settings-row-hint { padding-top: .15rem; padding-bottom: .5rem; }

.settings-label { font-size: .85rem; font-weight: 600; color: #2d3748; margin: 0; }
.settings-hint  { font-size: .78rem; color: #7A9EB3; grid-column: 2; }

.settings-input {
  width: 100%;
  padding: .45rem .7rem;
  border: 1px solid #c8d4de;
  border-radius: 6px;
  font-size: .875rem;
  font-family: inherit;
  background: #fff;
  transition: border-color .15s;
}
.settings-input:focus { outline: none; border-color: #2E5F78; box-shadow: 0 0 0 3px rgba(46,95,120,.12); }
.settings-input-sm { max-width: 110px; }

.settings-actions {
  display: flex;
  gap: .5rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid #f0f5f9;
}

/* Custom checkbox */
.settings-checkbox { display: inline-flex; align-items: center; cursor: pointer; gap: .5rem; }
.settings-checkbox input[type="checkbox"] { display: none; }
.settings-checkbox-box {
  width: 18px; height: 18px;
  border: 2px solid #c8d4de;
  border-radius: 3px;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s;
  flex-shrink: 0;
}
.settings-checkbox input:checked + .settings-checkbox-box {
  background: #2E5F78; border-color: #2E5F78;
}
.settings-checkbox input:checked + .settings-checkbox-box::after {
  content: '';
  width: 10px; height: 5px;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
  display: block;
}

.form-msg { font-size: .85rem; margin-top: .75rem; padding: .5rem .75rem; border-radius: 6px; display: none; }
.form-msg.error   { background: #fef0ee; color: #7a1f1f; border-left: 3px solid #F07060; display: block; }
.form-msg.success { background: #eafaf1; color: #1e6b3a; border-left: 3px solid #27ae60; display: block; }

/* ── Roll index cards ──────────────────────────────────────────────────────── */
.rolls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
}

.roll-card {
  background: #fff;
  border: 1px solid #dce6ef;
  border-radius: 10px;
  padding: 1.25rem 1.4rem;
  box-shadow: 0 1px 3px rgba(13,27,42,.05), 0 4px 16px rgba(13,27,42,.04);
  display: flex;
  flex-direction: column;
  gap: .85rem;
  transition: box-shadow .15s, transform .12s;
}
.roll-card:hover {
  box-shadow: 0 4px 12px rgba(13,27,42,.1), 0 8px 28px rgba(13,27,42,.07);
  transform: translateY(-2px);
}

.roll-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
}

.roll-card-date {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0D1B2A;
  line-height: 1.3;
}

.roll-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .9rem;
}

.roll-meta-item {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .82rem;
  color: #7A9EB3;
}

.roll-card-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  padding-top: .6rem;
  border-top: 1px solid #eef2f7;
}
