/* ─────────────────────────────────────────
   IIITB Award Repository — Design System
   Fonts: Playfair Display + Manrope
───────────────────────────────────────── */

:root {
  /* Palette */
  --gold:         #C4963A;
  --gold-dim:     rgba(196,150,58,.14);
  --gold-border:  rgba(196,150,58,.22);

  --bg:           #0C0C0C;
  --surface:      #141414;
  --surface-2:    #1A1A1A;
  --border:       #232323;
  --border-2:     #2D2D2D;

  --text-1:       #EDEBE6;
  --text-2:       #888580;
  --text-3:       #484440;

  --green:        #52A882;
  --green-dim:    rgba(82,168,130,.12);
  --red:          #B85252;
  --red-dim:      rgba(184,82,82,.12);

  /* Layout */
  --sidebar-w:    256px;
  --r:            10px;
  --r-sm:         7px;
  --r-xs:         4px;

  /* Typography */
  --f-display:    'Playfair Display', Georgia, serif;
  --f-body:       'Manrope', system-ui, sans-serif;

  /* Shadows */
  --sh-card:      0 1px 3px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.25);
  --sh-gold:      0 0 20px rgba(196,150,58,.06);
}

/* ── Reset ──────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--f-body);
  background: var(--bg);
  color: var(--text-1);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  font-size: 14px;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
input, select, textarea { font-family: inherit; color: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

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

/* ── Sidebar ────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  overflow-y: auto;
}

/* ── Sidebar brand / logo ───────────────── */
.sidebar-brand {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  padding: 1.1rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo-link { display: block; }

.sidebar-logo-img {
  height: 36px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  object-position: left center;
  filter: brightness(0) invert(1);   /* make any logo white */
}

.sidebar-logo-svg {
  height: 32px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  object-position: left center;
}

.sidebar-logo-fallback { display: block; }

.sidebar-brand-sub {
  font-size: .6rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-3);
  padding-left: 2px;
}

.brand-mark {
  width: 32px; height: 32px;
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold);
  flex-shrink: 0;
}

.brand-text { display: flex; flex-direction: column; }
.brand-name {
  font-family: var(--f-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: .06em;
  line-height: 1;
}
.brand-sub {
  font-size: .62rem;
  color: var(--text-3);
  letter-spacing: .04em;
  margin-top: 2px;
}

.sidebar-nav { flex: 1; padding: 1.25rem .875rem; }

.nav-section-label {
  font-size: .6rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0 .5rem;
  margin-bottom: .5rem;
}

.sidebar-nav ul { display: flex; flex-direction: column; gap: 1px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .6rem .75rem;
  border-radius: var(--r-sm);
  font-size: .8rem;
  font-weight: 400;
  color: var(--text-2);
  transition: background .14s, color .14s;
  cursor: pointer;
}
.nav-link svg { flex-shrink: 0; opacity: .7; }
.nav-link:hover { background: var(--surface-2); color: var(--text-1); }
.nav-link:hover svg { opacity: 1; }
.nav-link.active {
  background: var(--gold-dim);
  color: var(--gold);
  font-weight: 500;
}
.nav-link.active svg { opacity: 1; }

/* Import label */
.import-label { cursor: pointer; }

/* Reminder row */
.reminder-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: auto;
}
.reminder-left {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .8rem;
  color: var(--text-2);
}
.reminder-left svg { opacity: .7; }

/* Toggle switch */
.toggle { display: flex; align-items: center; cursor: pointer; }
.toggle input { display: none; }
.toggle-track {
  width: 32px; height: 18px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: 9px;
  position: relative;
  transition: background .2s, border-color .2s;
}
.toggle-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 12px; height: 12px;
  background: var(--text-3);
  border-radius: 50%;
  transition: transform .2s, background .2s;
}
.toggle input:checked ~ .toggle-track { background: var(--gold-dim); border-color: var(--gold-border); }
.toggle input:checked ~ .toggle-track .toggle-thumb { transform: translateX(14px); background: var(--gold); }

/* Sidebar footer */
.sidebar-footer {
  padding: .875rem;
  border-top: 1px solid var(--border);
}

.user-row {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .5rem .625rem;
  background: var(--surface-2);
  border-radius: var(--r-sm);
}

.user-avatar {
  width: 26px; height: 26px;
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .62rem;
  font-weight: 700;
  color: var(--gold);
  flex-shrink: 0;
}

.user-name { font-size: .73rem; color: var(--text-2); }

.logout-btn {
  display: flex; align-items: center;
  color: var(--text-3);
  padding: .25rem;
  border-radius: var(--r-xs);
  transition: color .15s;
}
.logout-btn:hover { color: var(--red); }

.admin-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .6rem .75rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--gold-border);
  color: var(--gold);
  font-size: .78rem;
  font-weight: 500;
  transition: background .15s;
}
.admin-link:hover { background: var(--gold-dim); }

/* ── Main content ────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 0 2.25rem 3rem;
  min-height: 100vh;
  max-width: 1280px;
}

/* ── Page header ─────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 2rem 0 1.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.75rem;
}

.page-eyebrow {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: .25rem;
}

.page-title {
  font-family: var(--f-display);
  font-size: 2rem;
  font-weight: 500;
  color: var(--text-1);
  line-height: 1.15;
}

.header-date {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .6rem .9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  flex-shrink: 0;
}

.date-day {
  font-family: var(--f-display);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--gold);
  line-height: 1;
}

.date-right {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.date-month {
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--text-2);
}

.date-year {
  font-size: .7rem;
  color: var(--text-3);
}

/* ── Alerts ──────────────────────────── */
.alert {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .8rem 1rem;
  border-radius: var(--r-sm);
  font-size: .8rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
  border: 1px solid;
}
.alert-success { background: var(--green-dim); border-color: rgba(82,168,130,.25); color: var(--green); }
.alert-error   { background: var(--red-dim);   border-color: rgba(184,82,82,.25);   color: var(--red);   }

/* ── Stats row ───────────────────────── */
.stats-row {
  display: flex;
  gap: .75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  padding: .875rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  min-width: 100px;
  transition: border-color .18s;
}
.stat-card:hover { border-color: var(--border-2); }

.stat-card.stat-main {
  border-color: var(--gold-border);
  background: var(--gold-dim);
}
.stat-card.stat-main .stat-value { color: var(--gold); }

.stat-value {
  font-family: var(--f-display);
  font-size: 1.7rem;
  font-weight: 500;
  line-height: 1;
  color: var(--text-1);
}

.stat-label {
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--text-2);
}

/* ── Toolbar ─────────────────────────── */
.toolbar { margin-bottom: 1.75rem; }

.search-row {
  display: flex;
  gap: .75rem;
  align-items: center;
}

.search-box {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}
.search-box > svg {
  position: absolute;
  left: .9rem;
  color: var(--text-3);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: .72rem .9rem .72rem 2.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: .82rem;
  color: var(--text-1);
  outline: none;
  transition: border-color .16s, box-shadow .16s;
}
.search-input::placeholder { color: var(--text-3); }
.search-input:focus {
  border-color: var(--gold-border);
  box-shadow: 0 0 0 3px var(--gold-dim);
}

.search-clear-btn {
  position: absolute;
  right: .8rem;
  display: flex;
  color: var(--text-3);
  transition: color .14s;
}
.search-clear-btn:hover { color: var(--text-1); }

.filter-btn {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .7rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: .78rem;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  transition: all .16s;
  position: relative;
}
.filter-btn:hover { border-color: var(--border-2); color: var(--text-1); }
.filter-btn--active { border-color: var(--gold-border); color: var(--gold); background: var(--gold-dim); }
.filter-badge {
  width: 6px; height: 6px;
  background: var(--gold);
  border-radius: 50%;
  position: absolute;
  top: 6px; right: 6px;
}

.filter-panel {
  margin-top: .75rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  align-items: flex-end;
  animation: fadeSlide .18s ease;
}

.filter-form {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-end;
}

.filter-group { display: flex; flex-direction: column; gap: .3rem; }

.filter-label {
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.filter-select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: .55rem .8rem;
  font-size: .78rem;
  color: var(--text-2);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23484440' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .65rem center;
  padding-right: 2rem;
  transition: border-color .16s;
  min-width: 130px;
}
.filter-select:focus { border-color: var(--gold-border); color: var(--text-1); }
.filter-select option { background: var(--surface-2); }

.clear-link {
  font-size: .75rem;
  color: var(--text-2);
  border-bottom: 1px solid var(--border-2);
  padding-bottom: 1px;
  margin-bottom: .4rem;
  transition: color .14s;
}
.clear-link:hover { color: var(--text-1); }

/* Bulk archive section inside filter panel */
.bulk-archive-form {
  display: flex;
  gap: .75rem;
  align-items: flex-end;
  padding-left: 1.25rem;
  border-left: 1px solid var(--border);
}

/* ── Awards grid ─────────────────────── */
.awards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1rem;
}

/* ── Award card ──────────────────────── */
.award-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.25rem;
  padding-top: 0;           /* thumb covers the top, body starts below it */
  display: flex;
  flex-direction: column;
  gap: .45rem;
  position: relative;
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s, transform .2s;
  animation: cardIn .35s ease both;
}

/* Body content after the thumb gets its own top spacing */
.award-card .card-header {
  margin-top: 1rem;
}

.award-card:hover {
  border-color: var(--border-2);
  box-shadow: var(--sh-card);
  transform: translateY(-1px);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-year {
  font-size: .65rem;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: .06em;
}

.card-category {
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: .1rem;
}

.card-name {
  font-family: var(--f-display);
  font-size: 1.2rem;
  font-weight: 500;
  font-style: italic;
  color: var(--text-1);
  line-height: 1.25;
  margin-top: .1rem;
}

.card-recipient {
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-2);
}

.card-grant {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .7rem;
  font-weight: 600;
  color: var(--green);
  background: var(--green-dim);
  border-radius: var(--r-xs);
  padding: .2rem .55rem;
  width: fit-content;
}

.card-meta {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  padding: .75rem 0;
  border-top: 1px solid var(--border);
  margin-top: .25rem;
}

.meta-item { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.meta-k { font-size: .6rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); flex-shrink: 0; }
.meta-v { font-size: .75rem; color: var(--text-2); text-align: right; }

.card-notes {
  font-size: .75rem;
  color: var(--text-3);
  font-style: italic;
  line-height: 1.5;
  padding: .5rem .75rem;
  border-left: 2px solid var(--border-2);
  margin-top: .1rem;
}

/* ── Card thumbnail (always on top) ─────── */
.card-thumb {
  width: calc(100% + 2.5rem);
  margin: -1.25rem -1.25rem 0;
  border-radius: var(--r) var(--r) 0 0;
  overflow: hidden;
  height: 160px;
  flex-shrink: 0;
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s ease;
}

.award-card:hover .card-thumb img { transform: scale(1.03); }

.card-thumb-placeholder {
  width: 100%;
  height: 100%;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  color: var(--text-3);
}

.card-thumb-placeholder svg { opacity: .5; }

.card-thumb-placeholder span {
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  opacity: .5;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: .75rem;
}

.card-view-btn {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: .03em;
  transition: color .14s;
}
.card-view-btn:hover { color: var(--gold); }

.card-actions {
  display: flex;
  gap: .4rem;
}

/* ── Type Pills ──────────────────────── */
.type-pill {
  display: inline-flex;
  align-items: center;
  padding: .22rem .65rem;
  border-radius: 100px;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  border: 1px solid;
}

.type-student        { color: #C4963A; border-color: rgba(196,150,58,.28); background: rgba(196,150,58,.1); }
.type-faculty        { color: #5B9BD5; border-color: rgba(91,155,213,.28); background: rgba(91,155,213,.1); }
.type-staff          { color: #9B7ED4; border-color: rgba(155,126,212,.28); background: rgba(155,126,212,.1); }
.type-alumni         { color: #52A882; border-color: rgba(82,168,130,.28); background: rgba(82,168,130,.1); }
.type-institute      { color: #D47E52; border-color: rgba(212,126,82,.28); background: rgba(212,126,82,.1); }
.type-research-fellow { color: #D4C452; border-color: rgba(212,196,82,.28); background: rgba(212,196,82,.1); }

/* ── Archived card ───────────────────── */
.award-card--archived { opacity: .75; }
.archived-tag {
  position: absolute;
  top: 0; right: 0;
  font-size: .52rem;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--text-3);
  background: var(--surface-2);
  border-bottom-left-radius: var(--r-sm);
  padding: .25rem .6rem;
}

/* ── Buttons ─────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem 1.3rem;
  background: var(--gold);
  color: #0C0C0C;
  font-family: var(--f-body);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  border-radius: var(--r-sm);
  border: none;
  cursor: pointer;
  transition: opacity .18s, transform .18s;
  white-space: nowrap;
}
.btn-primary:hover { opacity: .88; }
.btn-primary:active { transform: scale(.98); }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .68rem 1.25rem;
  background: transparent;
  color: var(--text-2);
  font-family: var(--f-body);
  font-size: .78rem;
  font-weight: 500;
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: border-color .16s, color .16s;
  white-space: nowrap;
}
.btn-outline:hover { border-color: var(--text-2); color: var(--text-1); }

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .68rem 1.25rem;
  background: var(--red-dim);
  color: var(--red);
  font-family: var(--f-body);
  font-size: .78rem;
  font-weight: 600;
  border: 1px solid rgba(184,82,82,.25);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background .16s;
}
.btn-danger:hover { background: rgba(184,82,82,.2); }

.btn-danger-sm {
  display: inline-flex;
  align-items: center;
  padding: .55rem .9rem;
  background: var(--red-dim);
  color: var(--red);
  font-family: var(--f-body);
  font-size: .72rem;
  font-weight: 600;
  border: 1px solid rgba(184,82,82,.22);
  border-radius: var(--r-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background .16s;
  margin-bottom: .4rem;
}
.btn-danger-sm:hover { background: rgba(184,82,82,.2); }

/* ── Icon buttons ────────────────────── */
.icon-btn {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-xs);
  border: 1px solid var(--border-2);
  color: var(--text-3);
  background: transparent;
  cursor: pointer;
  transition: all .16s;
}
.icon-btn:hover { border-color: var(--gold-border); color: var(--gold); background: var(--gold-dim); }
.icon-btn--danger:hover { border-color: rgba(184,82,82,.3); color: var(--red); background: var(--red-dim); }
.icon-btn--disabled { opacity: .35; cursor: not-allowed; pointer-events: none; }

/* ── Empty state ─────────────────────── */
.empty-state {
  text-align: center;
  padding: 5rem 2rem;
  color: var(--text-3);
}
.empty-state svg { margin: 0 auto 1.25rem; }
.empty-state h3 {
  font-family: var(--f-display);
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: .4rem;
}
.empty-state p { font-size: .82rem; }
.empty-state a { color: var(--gold); border-bottom: 1px solid var(--gold-border); }

/* ── Year pills ──────────────────────── */
.year-pills {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}
.year-pill {
  padding: .4rem 1rem;
  border-radius: 100px;
  font-size: .73rem;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all .16s;
  cursor: pointer;
}
.year-pill:hover { border-color: var(--border-2); color: var(--text-1); }
.year-pill.active { background: var(--gold-dim); border-color: var(--gold-border); color: var(--gold); font-weight: 600; }

/* ── Form pages ──────────────────────── */
.form-shell {
  max-width: 820px;
}

.form-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.form-section-title {
  font-family: var(--f-display);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-1);
  margin-bottom: 1.25rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: .75rem;
}

.award-form { display: flex; flex-direction: column; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
}

.field-group { display: flex; flex-direction: column; gap: .35rem; }

.field-label {
  font-size: .67rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-2);
}
.req { color: var(--gold); }

.field-input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: .68rem .9rem;
  font-size: .83rem;
  color: var(--text-1);
  outline: none;
  width: 100%;
  transition: border-color .16s, box-shadow .16s;
}
.field-input::placeholder { color: var(--text-3); }
.field-input:focus {
  border-color: var(--gold-border);
  box-shadow: 0 0 0 3px var(--gold-dim);
}

.field-select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: .68rem .9rem;
  font-size: .83rem;
  color: var(--text-1);
  outline: none;
  width: 100%;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23484440' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .9rem center;
  padding-right: 2.25rem;
  transition: border-color .16s, box-shadow .16s;
}
.field-select:focus {
  border-color: var(--gold-border);
  box-shadow: 0 0 0 3px var(--gold-dim);
}
.field-select option { background: var(--surface-2); }

.field-textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: .68rem .9rem;
  font-size: .83rem;
  color: var(--text-1);
  outline: none;
  width: 100%;
  resize: vertical;
  line-height: 1.6;
  transition: border-color .16s, box-shadow .16s;
  grid-column: 1 / -1;
}
.field-textarea::placeholder { color: var(--text-3); }
.field-textarea:focus {
  border-color: var(--gold-border);
  box-shadow: 0 0 0 3px var(--gold-dim);
}

/* Upload zone */
.upload-area {
  border: 1px dashed var(--border-2);
  border-radius: var(--r);
  min-height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color .18s, background .18s;
  overflow: hidden;
  text-align: center;
  padding: 1rem;
}
.upload-area:hover { border-color: var(--gold-border); background: var(--gold-dim); }
.upload-area.drag  { border-color: var(--gold); background: var(--gold-dim); }

.upload-text { font-size: .8rem; font-weight: 500; color: var(--text-2); margin-top: .65rem; }
.upload-hint { font-size: .68rem; color: var(--text-3); margin-top: .2rem; }

.upload-area img { max-height: 220px; border-radius: var(--r-sm); object-fit: cover; width: 100%; }

.url-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-top: .75rem;
  color: var(--text-3);
}
.url-row .field-input { flex: 1; }

/* Current image (edit form) */
.current-img-wrap { margin-bottom: .75rem; }
.current-img {
  max-height: 120px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  object-fit: cover;
}
.current-img-note { font-size: .68rem; color: var(--text-3); margin-top: .35rem; }

/* Form footer */
.form-actions {
  display: flex;
  gap: .75rem;
  justify-content: flex-end;
  margin-top: .75rem;
}

/* Categories */
.cat-add-row { display: flex; gap: .75rem; }

.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-family: var(--f-body);
  font-size: .62rem;
  font-weight: 700;
  color: var(--text-3);
  padding: 0 .4rem;
}

.cat-list { display: flex; flex-direction: column; gap: .4rem; }

.cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  transition: border-color .16s;
}
.cat-item:hover { border-color: var(--border-2); }

.cat-name { font-size: .82rem; font-weight: 500; color: var(--text-1); }
.cat-meta { font-size: .65rem; color: var(--text-3); margin-top: 2px; }

.empty-inline { font-size: .82rem; color: var(--text-3); padding: 1rem 0; }

/* ── Award Detail page ───────────────── */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
  align-items: start;
}

.detail-hero {
  display: flex;
  gap: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 2rem;
  margin-bottom: 1rem;
}

.detail-hero-left { flex: 1; }

.detail-award-name {
  font-family: var(--f-display);
  font-size: 2rem;
  font-weight: 500;
  font-style: italic;
  color: var(--text-1);
  line-height: 1.2;
  margin-bottom: .5rem;
}

.detail-recipient {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-2);
}

.detail-category {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: .5rem;
}

.detail-hero-img {
  width: 180px;
  flex-shrink: 0;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}
.detail-hero-img img { width: 100%; height: 180px; object-fit: cover; }

.detail-notes {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.5rem;
}

.detail-section-title {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 1rem;
}

.detail-notes p { font-size: .85rem; color: var(--text-2); line-height: 1.7; }

.detail-info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.25rem;
  margin-bottom: .75rem;
}

.detail-dl { display: flex; flex-direction: column; gap: .65rem; }
.detail-dl-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .5rem;
  padding-bottom: .65rem;
  border-bottom: 1px solid var(--border);
}
.detail-dl-row:last-child { border-bottom: none; padding-bottom: 0; }

.detail-dl-row dt { font-size: .65rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); flex-shrink: 0; }
.detail-dl-row dd { font-size: .78rem; color: var(--text-2); text-align: right; }

.detail-grant { color: var(--green); font-weight: 600; }
.detail-id { font-size: .68rem; color: var(--text-3); letter-spacing: .06em; }

.status-pill {
  display: inline-flex;
  padding: .15rem .55rem;
  border-radius: 100px;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .06em;
}
.status-active   { background: var(--green-dim); color: var(--green); }
.status-archived { background: var(--surface-2); color: var(--text-3); }

.detail-danger-zone {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .73rem;
  font-weight: 500;
  color: var(--text-3);
  transition: color .14s;
}
.back-link:hover { color: var(--text-1); }

/* ── Login page ──────────────────────── */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}

.login-bg-pattern {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle at 25% 25%, rgba(196,150,58,.04) 0%, transparent 60%),
                    radial-gradient(circle at 75% 75%, rgba(196,150,58,.03) 0%, transparent 60%);
  background-size: 100% 100%;
}

.login-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 380px;
  padding: 1.5rem;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 2.25rem;
  box-shadow: 0 16px 60px rgba(0,0,0,.5);
  animation: fadeSlide .4s ease both;
}

/* ── Login logo ─────────────────────────── */
.login-logo-wrap {
  margin-bottom: 1rem;
}

.login-logo-img {
  height: 44px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  object-position: left center;
  filter: brightness(0) invert(1);  /* ensure logo is white on dark bg */
}

.login-logo-svg {
  height: 40px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
}

.login-logo-fallback { display: block; }

.login-brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-bottom: 1.75rem;
}

.login-brand-divider {
  width: 1px;
  height: 14px;
  background: var(--border-2);
}

.login-brand-label {
  font-size: .7rem;
  color: var(--text-3);
  font-weight: 500;
  letter-spacing: .04em;
}

.login-title {
  font-family: var(--f-display);
  font-size: 1.8rem;
  font-weight: 500;
  color: var(--text-1);
  line-height: 1.2;
  margin-bottom: 1.75rem;
}
.login-title em { color: var(--gold); font-style: italic; }

.login-form { display: flex; flex-direction: column; gap: 1rem; }

.password-wrap { position: relative; }
.password-wrap .field-input { padding-right: 2.75rem; }
.password-eye {
  position: absolute;
  right: .85rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  color: var(--text-3);
  transition: color .14s;
}
.password-eye:hover { color: var(--text-2); }

.login-submit { width: 100%; justify-content: center; margin-top: .25rem; }

.login-sep {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .68rem;
  color: var(--text-3);
  margin: 1.25rem 0;
}
.login-sep::before, .login-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.guest-btn { width: 100%; justify-content: center; font-size: .78rem; }

/* ── Toast ───────────────────────────── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: 100px;
  padding: .6rem 1.4rem;
  font-size: .75rem;
  font-weight: 500;
  color: var(--text-2);
  opacity: 0;
  transition: opacity .25s, transform .25s;
  z-index: 999;
  pointer-events: none;
  white-space: nowrap;
}
.toast--show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Animations ──────────────────────── */
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: none; }
}

/* ── Scrollbar ───────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }

/* ── Responsive ──────────────────────── */
@media (max-width: 960px) {
  :root { --sidebar-w: 0px; }
  .sidebar { display: none; }
  .main-content { margin-left: 0; padding: 0 1rem 2rem; }
  .form-grid { grid-template-columns: 1fr; }
  .awards-grid { grid-template-columns: 1fr; }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-hero { flex-direction: column; }
  .search-row { flex-wrap: wrap; }
}
