/* TTPC Lockbox PWA — Mobile-first styles */

:root {
  --bg: #1a1a2e;
  --bg-card: #16213e;
  --bg-input: #0f3460;
  --primary: #e94560;
  --primary-hover: #c73650;
  --secondary: #533483;
  --success: #2ecc71;
  --danger: #e74c3c;
  --warning: #f39c12;
  --text: #eee;
  --text-muted: #aaa;
  --text-dim: #777;
  --border: #2a2a4a;
  --radius: 12px;
  --radius-sm: 8px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ==================== SCREENS ==================== */

.screen {
  display: none;
  flex-direction: column;
  min-height: 100dvh;
  padding: 24px 20px;
  animation: fadeIn 0.2s ease;
}

.screen.active {
  display: flex;
}

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

.screen-header {
  text-align: center;
  padding: 40px 0 24px;
}

.screen-header h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.screen-header h2 {
  font-size: 24px;
  font-weight: 600;
}

.subtitle {
  color: var(--text-muted);
  margin-top: 8px;
  font-size: 16px;
}

.screen-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ==================== BUTTONS ==================== */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--secondary);
  color: white;
}

.btn-action {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 20px 24px;
  font-size: 18px;
}

.btn-action:hover {
  border-color: var(--primary);
}

.btn-drop {
  border-left: 4px solid var(--warning);
}

.btn-pick {
  border-left: 4px solid var(--success);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-small {
  padding: 8px 16px;
  font-size: 14px;
}

.btn-large {
  padding: 18px 24px;
  font-size: 18px;
}

.btn-admin {
  margin-top: 24px;
  opacity: 0.7;
}

.btn-icon {
  font-size: 24px;
}

.btn-back {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 16px;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ==================== INPUTS ==================== */

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-group input,
.input-group textarea,
.input-group select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
  border-color: var(--primary);
}

.input-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23aaa' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ==================== MESSAGES ==================== */

.error-msg {
  color: var(--danger);
  font-size: 14px;
  text-align: center;
}

.info-msg {
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
}

.warning-msg {
  color: var(--warning);
  font-size: 14px;
  text-align: center;
  padding: 12px;
  background: rgba(243, 156, 18, 0.1);
  border-radius: var(--radius-sm);
}

.status-msg {
  text-align: center;
  padding: 8px;
  font-size: 14px;
}

.hidden {
  display: none !important;
}

/* ==================== CARDS ==================== */

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  font-size: 14px;
  line-height: 1.6;
}

.info-card.readonly {
  opacity: 0.7;
  border-style: dashed;
}

.info-card.danger {
  border-color: var(--danger);
  background: rgba(231, 76, 60, 0.1);
}

.info-card .label {
  color: var(--text-dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-card .value {
  color: var(--text);
  font-weight: 500;
  margin-bottom: 8px;
}

/* ==================== STATUS BADGE ==================== */

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.at-office {
  background: rgba(52, 152, 219, 0.2);
  color: #3498db;
}

.status-badge.dropped-off {
  background: rgba(243, 156, 18, 0.2);
  color: #f39c12;
}

.status-badge.picked-up {
  background: rgba(46, 204, 113, 0.2);
  color: #2ecc71;
}

/* ==================== MISC ==================== */

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-dim);
  font-size: 13px;
  margin: 8px 0;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.lock-icon {
  font-size: 64px;
  text-align: center;
  margin: 24px 0;
}

.success-icon {
  font-size: 64px;
  text-align: center;
  margin-bottom: 16px;
}

.contact-info {
  text-align: center;
  font-size: 18px;
  line-height: 1.6;
  margin: 16px 0;
}

.phone-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
  font-size: 24px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 24px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 46, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ==================== ACTIVITY LOG ==================== */

.log-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-entry {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
}

.log-entry .log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.log-entry .log-action {
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.log-entry .log-action.drop { color: var(--warning); }
.log-entry .log-action.pick { color: var(--success); }
.log-entry .log-action.set { color: #3498db; }
.log-entry .log-action.reset { color: var(--text-muted); }
.log-entry .log-action.delete { color: var(--danger); }

.log-entry .log-time {
  color: var(--text-dim);
  font-size: 11px;
}

.log-entry .log-detail {
  color: var(--text-muted);
  font-size: 12px;
}

.log-entry .log-notes {
  color: var(--text);
  font-size: 12px;
  font-style: italic;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

/* ==================== SCROLLABLE ==================== */

.screen-body {
  overflow-y: auto;
  padding-bottom: 24px;
}
