:root {
  --bg: #000000;
  --card-bg: #1a1814;
  --card-border: rgba(223, 210, 176, 0.35);
  --text: #efe7c8;
  --muted: #8b8270;
  --primary: #dfd2b0;
  --primary-hover: #ece0bf;
  --primary-text: #1a1814;
  --secondary: #25221c;
  --secondary-hover: #2f2b23;
  --secondary-text: var(--text);
  --danger: #ef4444;
  --success: #dfd2b0;
  --warn: #fbbf24;
  --input-bg: #1f1c17;
  --input-border: rgba(223, 210, 176, 0.25);
  --border: rgba(223, 210, 176, 0.18);
  --login-font: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
    monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100vh;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  position: relative;
}

/* Tiled brand-logo pattern, dimmed so it sits behind the UI. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("/assets/monogram-tile.png");
  background-repeat: repeat;
  background-size: 640px auto;
  opacity: 0.18;
  z-index: -1;
  pointer-events: none;
}

.screen {
  min-height: 100vh;
  padding: 24px;
}

#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  max-width: 720px;
  margin: 0 auto 24px;
}

/* Login card */
.login-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 4px;
  padding: 36px 32px 32px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
  max-width: 360px;
  width: 100%;
  text-align: center;
}

.login-card h1 {
  margin: 20px 0 4px;
  font-family: var(--login-font);
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--primary);
}

.login-card .login-subtitle {
  font-family: var(--login-font);
  font-size: 0.72rem;
  margin: 0 0 26px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--primary);
}

/* Match the same mono family for labels, inputs, and the submit button so
   the whole card reads as one piece. */
.login-card label,
.login-card input,
.login-card button {
  font-family: var(--login-font);
}

.login-card label {
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: none;
}

/* Searchlight: a white beam sweeps across the cream text. The gradient
   covers 2x the element width and pans via background-position. */
.searchlight {
  background-image: linear-gradient(
    100deg,
    var(--primary) 0%,
    var(--primary) 40%,
    #ffffff 50%,
    var(--primary) 60%,
    var(--primary) 100%
  );
  background-size: 200% 100%;
  background-position: -100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: searchlight-sweep 2s linear infinite;
}

@keyframes searchlight-sweep {
  0% {
    background-position: -100% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .searchlight {
    animation: none;
    background-position: 50% 0;
  }
}

.login-card form {
  text-align: left;
}

/* Thirsty Camel icon — replaces the L/Liquor badge. The PNG is already
   cropped to a transparent-cornered circle, so no additional masking. */
.login-icon {
  display: block;
  margin: 0 auto;
  width: 80px;
  height: 80px;
  object-fit: contain;
}

h1 {
  margin-top: 0;
  font-size: 1.5rem;
}

h2 {
  margin-top: 0;
}

label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  margin: 14px 0 6px;
  color: var(--primary);
  letter-spacing: 0.02em;
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  font-size: 0.95rem;
  background: var(--input-bg);
  color: var(--text);
  font-family: inherit;
}

input::placeholder {
  color: #4b5563;
}

input:focus {
  outline: 1px solid var(--primary);
  outline-offset: 0;
  border-color: var(--primary);
}

/* Inside the login card, inputs sit on a light cream surface with dark
   text to match the source design. Scoped so the rest of the app keeps
   the dark-input look. */
.login-card input[type="email"],
.login-card input[type="password"],
.login-card input[type="text"] {
  background: #f4ecd6;
  color: #1a1814;
  border: 1px solid rgba(223, 210, 176, 0.45);
}

.login-card input::placeholder {
  color: #807868;
}

button {
  font-size: 1rem;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: inherit;
}

button.primary {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  margin-top: 18px;
  width: 100%;
  font-family: var(--login-font);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  padding: 11px 16px;
}

button.primary:hover {
  background: var(--primary);
  color: var(--primary-text);
}

button.secondary {
  background: var(--secondary);
  color: var(--secondary-text);
  border-color: var(--card-border);
}

button.secondary:hover {
  background: var(--secondary-hover);
}

button.link-button {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  padding: 0;
  font-size: 0.875rem;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 720px;
  margin: 0 auto 16px;
}

.app-header h1 {
  font-size: 1.2rem;
  margin: 0;
}

.muted {
  color: var(--muted);
  font-size: 0.875rem;
  margin: 4px 0;
}

.tabs {
  max-width: 720px;
  margin: 0 auto 16px;
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--card-border);
}

.tab {
  background: none;
  border: none;
  padding: 10px 16px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-weight: 600;
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
}

.list-header h3 {
  margin: 0;
  font-size: 1rem;
}

.item-list {
  list-style: none;
  padding: 0;
  margin: 12px 0;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  background: var(--input-bg);
}

.item-list li {
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--card-border);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.875rem;
}

.item-list li:last-child {
  border-bottom: none;
}

.item-list .remove {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 0.875rem;
  padding: 2px 6px;
}

.item-list .empty {
  color: var(--muted);
  text-align: center;
  justify-content: center;
  font-style: italic;
  font-family: inherit;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
}

th,
td {
  text-align: left;
  padding: 8px;
  border-bottom: 1px solid var(--card-border);
}

th {
  font-size: 0.875rem;
  color: var(--muted);
}

td input {
  width: 100%;
  font-size: 0.875rem;
  padding: 6px 8px;
}

td.actions {
  width: 40px;
  text-align: center;
}

td .remove-row {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 1rem;
}

.status {
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.875rem;
}

.status.success {
  background: rgba(200, 218, 45, 0.15);
  color: var(--success);
  border: 1px solid rgba(200, 218, 45, 0.3);
}

.status.error {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.error {
  color: var(--danger);
  font-size: 0.875rem;
  margin: 8px 0 0;
}

#add-row {
  margin-right: 8px;
}

.lookup-status {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 4px;
  min-height: 1em;
}

.lookup-status.ok {
  color: var(--success);
}

.lookup-status.warn {
  color: var(--warn);
}

.lookup-status.error {
  color: var(--danger);
}
