:root {
  --primary: #a61b1b;
  --primary-dark: #7a1414;
  --accent: #e63946;
  --background: #f4f5f7;
  --card-bg: #ffffff;
  --border: #e0e0e0;
  --text: #212529;
  --text-secondary: #6c757d;
  --success: #28a745;
  --error: #dc3545;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--background);
  color: var(--text);
}

.navbar {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.navbar .brand {
  font-weight: 700;
  font-size: 1.4rem;
}

.logo-badge {
  background: white;
  border-radius: 10px;
  padding: 6px 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
}

.logo-badge img {
  height: 28px;
  display: block;
}

/* --- Kiosk --- */

.kiosk-layout {
  display: flex;
  min-height: calc(100vh - 64px);
}

.qr-panel {
  flex: 0 0 380px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--card-bg);
  border-right: 1px solid var(--border);
}

.qr-panel h1 {
  margin-bottom: 4px;
  color: var(--text);
}

.qr-panel p {
  color: var(--text-secondary);
}

.qr-image {
  width: 260px;
  height: 260px;
  margin: 24px 0;
  background: #fff;
  border-radius: 8px;
  padding: 12px;
  border: 1px solid var(--border);
}

.phone-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.95rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #b0b6be;
  flex-shrink: 0;
}

.status-dot.online {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.2);
}

.images-panel {
  flex: 1;
  padding: 40px;
  overflow-y: auto;
}

.images-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-actions {
  display: flex;
  gap: 10px;
}

.secondary-btn.danger {
  border-color: var(--error);
  color: var(--error);
}

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

.images-panel h2 {
  color: var(--text);
  margin: 0;
}

.secondary-btn.small {
  margin-top: 0;
  padding: 8px 16px;
  font-size: 0.9rem;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.image-card {
  background: var(--card-bg);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.image-card img {
  width: 100%;
  display: block;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.expiry-timer {
  text-align: center;
  padding: 6px 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
}

.image-card .image-actions {
  display: flex;
  border-top: 1px solid var(--border);
}

.image-card button {
  flex: 1;
  display: block;
  text-align: center;
  padding: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}

.image-card button.download-btn {
  color: var(--primary);
  border-right: 1px solid var(--border);
}

.image-card button.delete-btn {
  color: var(--error);
}

.empty-hint {
  color: var(--text-secondary);
  margin-top: 24px;
}

.secondary-btn {
  margin-top: auto;
  padding: 14px 20px;
  border-radius: 8px;
  border: 2px solid var(--primary);
  background: transparent;
  color: var(--primary);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

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

/* --- Upload (mobile) --- */

body.upload {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.upload-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.upload-card {
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.upload-btn {
  display: block;
  margin: 16px 0;
  padding: 18px;
  border-radius: 10px;
  background: var(--primary);
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
}

.upload-btn.secondary {
  background: var(--text-secondary);
}

.upload-btn input {
  display: none;
}

.status {
  margin-top: 16px;
  min-height: 1.4em;
  font-weight: 600;
}

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

.preview-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.preview-list img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}
