/* =====================================================================
   Eagle's Landing Admin — clean utilitarian theme
   ===================================================================== */

:root {
  --admin-bg:        #F8F6F2;
  --admin-surface:   #FFFFFF;
  --admin-border:    #E5E0D3;
  --admin-text:      #2D3B2A;
  --admin-muted:     #6B6960;
  --admin-blue:      #2E7CC9;
  --admin-blue-dark: #1E5FA0;
  --admin-orange:    #D9943A;
  --admin-orange-dark:#B57928;
  --admin-danger:    #C0392B;
  --admin-success:   #639922;
  --radius-md: 8px;
  --radius-lg: 12px;
}

body.admin {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--admin-bg);
  color: var(--admin-text);
  font-size: 14px;
  line-height: 1.5;
}

body.admin a { color: var(--admin-blue); text-decoration: none; }
body.admin a:hover { text-decoration: underline; }

/* ---- Top nav ---- */
.admin-topnav {
  background: #2D3B2A;
  color: #FFFCF5;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.admin-topnav-brand {
  display: flex; align-items: center; gap: 10px;
  color: #FFFCF5; font-weight: 600;
}
.admin-topnav-brand img { max-height: 36px; }
.admin-topnav-links { display: flex; gap: 4px; flex-wrap: wrap; }
.admin-topnav-links a {
  color: #FFFCF5;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
}
.admin-topnav-links a:hover { background: rgba(255,255,255,0.1); text-decoration: none; }
.admin-topnav-links a.active { background: rgba(255,255,255,0.18); }
.admin-topnav-user { color: rgba(255,252,245,0.7); font-size: 12px; }

/* ---- Container ---- */
.admin-container { max-width: 1200px; margin: 0 auto; padding: 20px; }

/* ---- Page head ---- */
.admin-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 0 0 20px; flex-wrap: wrap; gap: 12px;
}
.admin-head h1 { font-size: 22px; font-weight: 600; margin: 0; }
.admin-head .actions { display: flex; gap: 8px; }

/* ---- Cards / panels ---- */
.admin-panel {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.admin-panel h2 { font-size: 16px; font-weight: 600; margin: 0 0 12px; }

/* ---- Stat cards ---- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.stat-card-label { font-size: 12px; color: var(--admin-muted); margin: 0 0 4px; }
.stat-card-value { font-size: 24px; font-weight: 600; margin: 0; }

/* ---- Tables ---- */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--admin-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.admin-table th, .admin-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--admin-border);
  font-size: 13px;
}
.admin-table th { background: #F1EDE4; font-weight: 600; color: var(--admin-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #FCFAF5; }

/* ---- Forms ---- */
.admin-form label { display: block; font-size: 13px; font-weight: 500; margin: 12px 0 4px; color: var(--admin-text); }
.admin-form input[type="text"],
.admin-form input[type="email"],
.admin-form input[type="password"],
.admin-form input[type="number"],
.admin-form input[type="date"],
.admin-form input[type="color"],
.admin-form select,
.admin-form textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: inherit;
  background: var(--admin-surface);
  color: var(--admin-text);
  box-sizing: border-box;
}
.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus { outline: 2px solid var(--admin-blue); outline-offset: 1px; border-color: var(--admin-blue); }
.admin-form .help { font-size: 12px; color: var(--admin-muted); margin: 4px 0 0; }
.admin-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .admin-form-row { grid-template-columns: 1fr; } }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--admin-border);
  background: var(--admin-surface);
  color: var(--admin-text);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: #FCFAF5; text-decoration: none; }
.btn-primary  { background: var(--admin-blue); color: #FFF; border-color: var(--admin-blue); }
.btn-primary:hover  { background: var(--admin-blue-dark); border-color: var(--admin-blue-dark); color: #FFF; }
.btn-accent   { background: var(--admin-orange); color: #FFF; border-color: var(--admin-orange); }
.btn-accent:hover { background: var(--admin-orange-dark); border-color: var(--admin-orange-dark); color: #FFF; }
.btn-danger   { color: var(--admin-danger); border-color: var(--admin-danger); }
.btn-danger:hover { background: var(--admin-danger); color: #FFF; }
.btn-small { padding: 4px 10px; font-size: 12px; }

/* ---- Notices ---- */
.notice {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 13px;
  border-left: 4px solid currentColor;
}
.notice-info    { background: #EAF2FB; color: var(--admin-blue-dark); border-left-color: var(--admin-blue); }
.notice-success { background: #EFF6E2; color: #4D7415; border-left-color: var(--admin-success); }
.notice-error   { background: #FBEAEA; color: #8B1F1F; border-left-color: var(--admin-danger); }
.notice-warn    { background: #FCF1E0; color: #8B4B0B; border-left-color: var(--admin-orange); }

/* ---- Photo grid (admin) ---- */
.admin-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.admin-photo-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #EFEBE0;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
}
.admin-photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.admin-photo-tile .actions {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.15s ease;
  display: flex;
  align-items: flex-end;
  padding: 8px;
  gap: 4px;
}
.admin-photo-tile:hover .actions { opacity: 1; }
.admin-photo-tile .actions a {
  background: rgba(255,255,255,0.95);
  color: var(--admin-text);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  text-decoration: none;
}

/* ---- Upload dropzone ---- */
.dropzone {
  border: 2px dashed var(--admin-border);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  text-align: center;
  background: var(--admin-surface);
  color: var(--admin-muted);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.dropzone.dragover { border-color: var(--admin-blue); background: #F0F7FE; color: var(--admin-blue-dark); }
.dropzone i { font-size: 40px; display: block; margin-bottom: 8px; }
.dropzone strong { font-size: 16px; color: var(--admin-text); }

.upload-list { margin-top: 16px; }
.upload-item {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  font-size: 13px;
}
.upload-item-name { flex: 1; }
.upload-item-status.ok    { color: var(--admin-success); }
.upload-item-status.fail  { color: var(--admin-danger); }
.upload-progress {
  width: 80px; height: 6px;
  background: var(--admin-border);
  border-radius: 3px;
  overflow: hidden;
}
.upload-progress-bar {
  height: 100%; background: var(--admin-blue);
  transition: width 0.15s ease;
}

/* ---- Theme calendar grid ---- */
.theme-week-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px; }
.theme-day {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  padding: 8px;
  min-height: 70px;
  font-size: 12px;
  cursor: pointer;
}
.theme-day:hover { border-color: var(--admin-blue); }
.theme-day-date { font-weight: 600; color: var(--admin-muted); margin-bottom: 4px; }
.theme-day-text { color: var(--admin-text); }
.theme-day-text.empty { color: #BDB8AB; font-style: italic; }

/* ---- Modal ---- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.modal {
  background: var(--admin-surface);
  border-radius: var(--radius-lg);
  max-width: 540px;
  width: calc(100% - 32px);
  max-height: 90vh;
  overflow: auto;
  padding: 20px;
}
.modal h2 { font-size: 18px; font-weight: 600; margin: 0 0 14px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* ---- Badges ---- */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  background: #EFEBE0;
  color: var(--admin-muted);
}
.badge-info    { background: #DCEAF8; color: var(--admin-blue-dark); }
.badge-success { background: #DCEDC2; color: #4D7415; }
.badge-warn    { background: #FBE3C1; color: #8B4B0B; }
.badge-danger  { background: #F8D7D2; color: #8B1F1F; }


/* Topnav specificity fix - beats generic body.admin a rule */
body.admin .admin-topnav,
body.admin .admin-topnav a,
body.admin .admin-topnav-brand,
body.admin .admin-topnav-brand a,
body.admin .admin-topnav-links a {
  color: #FFFCF5;
}
body.admin .admin-topnav-links a:hover {
  color: #FFFCF5;
  background: rgba(255,255,255,0.1);
  text-decoration: none;
}
body.admin .admin-topnav-links a.active {
  color: #FFFCF5;
  background: rgba(255,255,255,0.18);
}
body.admin .admin-topnav-user {
  color: rgba(255,252,245,0.7);
}

/* =====================================================================
   Eagle's Landing Admin — Batch 7 patch
   Append this to assets/css/admin-theme.css
   ===================================================================== */

/* Fix: blue button text was invisible because body.admin a (specificity 0,1,2)
   was beating .btn-primary (0,1,1). Bump specificity to win. */
body.admin .btn-primary,
body.admin a.btn-primary,
body.admin button.btn-primary {
  color: #FFFCF5 !important;
}
body.admin .btn-primary:hover,
body.admin a.btn-primary:hover,
body.admin button.btn-primary:hover {
  color: #FFFCF5 !important;
  background: var(--admin-blue-dark, #1E5FA0);
}
body.admin .btn-danger,
body.admin a.btn-danger,
body.admin button.btn-danger {
  color: #FFFCF5 !important;
  background: var(--admin-danger, #C0392B);
}
body.admin .btn-danger:hover {
  color: #FFFCF5 !important;
}

/* Year selector — used on themes and albums admin pages */
.year-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 8px 12px;
  background: #FCFAF5;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
}
.year-selector label {
  font-size: 13px;
  font-weight: 600;
  color: var(--admin-text);
}
.year-selector select {
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--admin-border);
  background: white;
  font-size: 13px;
  cursor: pointer;
}
.year-selector .meta {
  font-size: 12px;
  color: var(--admin-muted);
  margin-left: auto;
}

/* Themes calendar grid — 5 weekday cells per row */
.theme-week-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.theme-day {
  background: #FCFAF5;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  min-height: 78px;
  transition: background 0.1s, border-color 0.1s;
}
.theme-day:hover {
  background: #F8F4EC;
  border-color: var(--admin-blue);
}
.theme-day-date {
  font-size: 11px;
  color: var(--admin-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.theme-day-text {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--admin-text);
  word-wrap: break-word;
}
.theme-day-text.empty {
  color: #B0AC9F;
  font-style: italic;
  font-weight: 400;
}

/* Modal styles (in case they aren't defined elsewhere) */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.modal {
  background: white;
  border-radius: 12px;
  padding: 24px;
  max-width: 480px;
  width: calc(100% - 40px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.modal h2 { margin-top: 0; }
.modal-actions {
  display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px;
}
.admin-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Help text */
.help, p.help {
  font-size: 12px;
  color: var(--admin-muted);
  margin: 4px 0;
}
