/* ============================================================
   Lake Norman Treasures — Publisher (mobile web app)
   A quiet, utilitarian tool. The job is speed on a phone: big
   touch targets, high contrast, no decoration competing with
   the actual task of getting an item listed.
   ============================================================ */

:root {
  /* Matched to the live site's actual palette (css/style.css):
     #2c3e50 navy, #e74c3c red accent, white, plain sans-serif. */
  --deep:     #2c3e50;
  --deep-2:   #1e2b38;
  --sand:     #f4f6f7;
  --paper:    #ffffff;
  --ink:      #1c2b30;
  --ink-soft: #5b6b6f;
  --line:     #dfe3e6;
  --accent:   #e74c3c;
  --accent-d: #c0392b;
  --danger:   #c0392b;
  --danger-d: #962d22;
  --ok:       #2f7a4f;
  --ok-bg:    #e6f4ea;
  --radius:   10px;
  --shadow:   0 2px 10px rgba(20, 30, 30, 0.08);
  font-size: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--sand);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--deep);
  color: var(--sand);
  padding: calc(env(safe-area-inset-top) + 12px) 16px 12px;
}
.topbar .brand {
  color: var(--sand);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}
.topbar .logout-link {
  color: var(--sand);
  opacity: 0.75;
  text-decoration: none;
  font-size: 0.85rem;
}

.container {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}

.flash-messages { margin-bottom: 16px; }
.flash {
  background: #fff7ec;
  border: 1.5px solid #ead9b8;
  color: #6b4a14;
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.flash::before { content: "!"; flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 0.85rem; }
.flash.success {
  background: var(--ok-bg);
  border-color: #bfe3cc;
  color: #1d5c37;
}
.flash.success::before { content: "\2713"; background: var(--ok); color: #fff; }
.flash.error {
  background: #fbeae6;
  border-color: #f0c2ba;
  color: var(--danger-d);
}
.flash.error::before { content: "!"; background: var(--danger); color: #fff; }

h1 { font-size: 1.4rem; margin: 4px 0 16px; }
h2 { font-size: 1.15rem; margin: 0 0 4px; }
p.subtle { color: var(--ink-soft); font-size: 0.88rem; margin-top: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 14px 18px;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary { background: var(--deep); color: var(--sand); }
.btn-primary:active { background: var(--deep-2); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:active { background: var(--accent-d); }
.btn-danger { background: transparent; color: var(--danger); border: 1.5px solid var(--danger); }
.btn-danger:active { background: #fbeae6; }
.btn-ghost { background: transparent; color: var(--deep); border: 1.5px solid var(--line); }
.btn-block { display: block; }
.btn-sm { padding: 8px 12px; font-size: 0.85rem; width: auto; }

.card {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
}
.card-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}
.card-thumb {
  width: 56px; height: 56px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--sand);
  border: 1px solid var(--line);
}
.card-body { flex: 1; min-width: 0; }
.card-title { font-weight: 600; margin: 0; }
.card-sub { color: var(--ink-soft); font-size: 0.85rem; margin: 2px 0 0; }
.card-chevron { color: var(--ink-soft); font-size: 1.2rem; }

.empty-state {
  text-align: center;
  color: var(--ink-soft);
  padding: 32px 16px;
  font-size: 0.95rem;
}

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 6px;
  color: var(--ink);
}
.field .hint { color: var(--ink-soft); font-size: 0.78rem; margin-top: 4px; }
input[type="text"], input[type="number"], input[type="password"], textarea, select {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
textarea { min-height: 110px; resize: vertical; }

.file-drop {
  display: block;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  padding: 22px 14px;
  text-align: center;
  color: var(--ink-soft);
  background: var(--paper);
  cursor: pointer;
}
.file-drop input { display: none; }
.file-drop .file-drop-label { font-weight: 600; color: var(--deep); }

.photo-preview-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.photo-preview-row img {
  width: 64px; height: 64px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.divider { border: none; border-top: 1px solid var(--line); margin: 24px 0; }

.section-label {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  color: var(--ink-soft);
  font-weight: 700;
  margin-bottom: 10px;
}

.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.85rem;
}
.pill form { margin: 0; }
.pill button.remove-x {
  background: none;
  border: none;
  color: var(--danger);
  font-weight: 700;
  cursor: pointer;
  padding: 0 0 0 4px;
  font-size: 0.95rem;
}
.pill-add-form { display: flex; gap: 8px; margin-bottom: 20px; }
.pill-add-form input { flex: 1; }
.pill-add-form button {
  flex-shrink: 0;
  width: auto;
  padding: 10px 16px;
}

.center-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--paper);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 32px 28px;
  text-align: center;
}
.login-mark {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--deep);
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 1.4rem;
  font-weight: 800;
}
.login-card h1 { font-size: 1.2rem; margin-bottom: 4px; }
.login-card .field { text-align: left; margin-top: 18px; }

.status-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  font-size: 1.6rem;
}
.status-icon.pending { background: #fff1de; color: var(--accent-d); }
.status-icon.denied { background: #fbeae6; color: var(--danger-d); }

.confirm-row { display: flex; gap: 8px; margin-top: 10px; }
.confirm-row form { flex: 1; margin: 0; }

table.devices { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
table.devices th, table.devices td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.status-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}
.status-badge.pending { background: #fff1de; color: var(--accent-d); }
.status-badge.approved { background: #e7f2ec; color: var(--ok); }
.status-badge.denied { background: #fbeae6; color: var(--danger-d); }

.advanced-section {
  margin-bottom: 4px;
}
.advanced-section summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink-soft);
  font-size: 0.95rem;
  padding: 8px 0;
  -webkit-tap-highlight-color: transparent;
}
.advanced-section[open] summary { color: var(--ink); margin-bottom: 8px; }
.advanced-section .p-small {
  color: var(--ink-soft);
  font-size: 0.85rem;
  margin: 0 0 12px;
}

@media (min-width: 640px) {
  .container { padding-top: 32px; }
}
