:root {
  color-scheme: only light;
  --ink: #1c1b1f;
  --muted: #5a5c66;
  --surface: #f3efe8;
  --card: #ffffff;
  --accent: #f26430;
  --accent-deep: #b64014;
  --accent-soft: #ffe3d3;
  --border: #d5cbc0;
  --shadow: 0 18px 40px rgba(28, 27, 31, 0.16);
  --radius: 22px;
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 15% 20%, #f7d8b5 0%, transparent 45%),
    radial-gradient(circle at 80% 5%, #fbe9d5 0%, transparent 40%),
    linear-gradient(160deg, #fefcf9 0%, #f5efe6 60%, #efe6d8 100%);
  min-height: 100vh;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  display: grid;
  gap: 28px;
}

.login-page {
  max-width: 500px;
}

.hero {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: center;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-deep);
}

h1 {
  font-size: clamp(2rem, 3vw, 3rem);
  margin: 0 0 10px;
}

h2 {
  margin: 0 0 12px;
  font-size: clamp(1.3rem, 2.2vw, 2rem);
}

.subtitle {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.hero-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(178, 120, 80, 0.15);
  animation: floatIn 0.7s ease-out;
}

.hero-card-title {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  color: var(--muted);
}

.hero-card-value {
  margin: 6px 0 8px;
  font-size: 1.6rem;
  font-weight: 700;
}

.hero-card-note {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.panel {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(178, 120, 80, 0.12);
}

.login-panel {
  max-width: 400px;
}

.login-form {
  display: grid;
  gap: 16px;
}

.panel-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.form-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

label {
  display: grid;
  gap: 8px;
  font-weight: 600;
  color: var(--ink);
}

input,
select {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
}

input:focus,
select:focus {
  outline: 2px solid rgba(242, 100, 48, 0.4);
  border-color: var(--accent);
}

input:disabled,
select:disabled {
  background: var(--surface);
  cursor: not-allowed;
}

.hint {
  font-size: 0.8rem;
  color: var(--muted);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  box-shadow: 0 12px 24px rgba(242, 100, 48, 0.25);
  font-size: 0.95rem;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px) scale(1.01);
}

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

.btn.ghost {
  background: transparent;
  color: var(--accent-deep);
  box-shadow: none;
  border: 1px solid rgba(242, 100, 48, 0.4);
}

.btn.ghost.danger {
  color: var(--error);
  border-color: rgba(239, 68, 68, 0.4);
}

.btn.ghost.danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.1);
}

.form-message {
  margin-top: 12px;
  font-weight: 600;
}

.list-panel {
  animation: riseIn 0.8s ease-out;
}

.entries {
  display: grid;
  gap: 16px;
}

.entry-card {
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid rgba(178, 120, 80, 0.2);
  background: var(--surface);
  display: grid;
  gap: 8px;
}

.entry-title {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-weight: 700;
}

.entry-meta {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.95rem;
}

.totals {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.admin-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Month Selector */
.month-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.month-display {
  font-weight: 600;
  min-width: 140px;
  text-align: center;
}

.month-prev,
.month-next {
  padding: 8px 14px;
  font-size: 1rem;
}

/* Search */
.search-container {
  margin-bottom: 16px;
}

.search-box input {
  width: 100%;
  max-width: 400px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  padding: 14px 20px;
  border-radius: 12px;
  background: var(--card);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  font-weight: 600;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
  pointer-events: auto;
  max-width: 350px;
}

.toast-visible {
  opacity: 1;
  transform: translateX(0);
}

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

.toast-error {
  border-left: 4px solid var(--error);
}

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

.toast-info {
  border-left: 4px solid var(--accent);
}

/* Confirmation Dialog */
.dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.dialog-overlay.dialog-visible {
  opacity: 1;
}

.dialog {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 400px;
  width: 90%;
  box-shadow: var(--shadow);
  transform: scale(0.9);
  transition: transform 0.2s ease;
}

.dialog-visible .dialog {
  transform: scale(1);
}

.dialog-message {
  margin: 0 0 20px;
  font-size: 1.05rem;
  line-height: 1.5;
}

.dialog-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.dialog-confirm {
  background: var(--error);
}

/* JTR Warning */
.jtr-warning {
  color: var(--warning);
  font-weight: 700;
  cursor: help;
}

/* Animations */
@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

/* Responsive */
@media (max-width: 720px) {
  .page {
    padding: 32px 18px 64px;
  }

  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-buttons {
    flex-direction: column;
    width: 100%;
  }

  .admin-buttons .btn {
    width: 100%;
  }

  .toast-container {
    left: 10px;
    right: 10px;
  }

  .toast {
    max-width: 100%;
  }

  .month-selector {
    justify-content: center;
  }
}

/* Print styles */
@media print {
  .btn,
  .form-actions,
  .admin-actions,
  .search-container,
  .month-selector {
    display: none !important;
  }

  .page {
    padding: 0;
    max-width: 100%;
  }

  .panel {
    box-shadow: none;
    border: 1px solid #ddd;
    break-inside: avoid;
  }

  .entry-card {
    break-inside: avoid;
  }
}
/* Additional styles for user management - append to existing styles.css */

/* User info panel on entry page */
.user-info-panel {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-actions {
  display: flex;
  gap: 12px;
}

/* Admin badge */
.admin-badge {
  background: var(--accent-soft);
  color: var(--accent-deep);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.you-badge {
  background: #e0f2fe;
  color: #0369a1;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* User management section */
.user-management-panel {
  animation: riseIn 0.8s ease-out;
}

.users-list {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.user-card {
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid rgba(178, 120, 80, 0.2);
  background: var(--surface);
  display: grid;
  gap: 8px;
}

.user-info-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.user-name {
  font-weight: 700;
  font-size: 1.1rem;
}

.user-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Create user panel */
.create-user-panel {
  margin-top: 16px;
  padding: 20px;
  border-radius: 18px;
  border: 1px solid rgba(178, 120, 80, 0.2);
  background: var(--surface);
}

.create-user-panel h3 {
  margin: 0 0 16px;
  font-size: 1.1rem;
}

.create-user-form {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

/* Checkbox label styling */
.checkbox-label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Register link styling */
.register-link {
  margin-top: 16px;
  text-align: center;
  color: var(--muted);
}

.register-link a {
  color: var(--accent-deep);
  font-weight: 600;
  text-decoration: none;
}

.register-link a:hover {
  text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 720px) {
  .user-info-panel {
    flex-direction: column;
    align-items: flex-start;
  }

  .user-actions {
    width: 100%;
    flex-direction: column;
  }

  .user-actions .btn {
    width: 100%;
  }
}
