/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

:root {
  color-scheme: light;

  --page-bg: #f5f7fa;
  --surface: #ffffff;
  --surface-alt: #ffffff;
  --border: #e0e0e0;
  --border-strong: #a3a3a3;
  --border-soft: #f0f0f0;

  --text: #1f2933;
  --text-strong: #000000;
  --text-muted: #777777;

  --accent: #c79a3d;
  --accent-hover: #ac8231;
  --btn-dark-bg: #000000;
  --btn-dark-text: #ffffff;
  --btn-text: #2a2016;

  --sidebar-bg: #1f1f1f;
  --sidebar-text: #e6c877;
  --sidebar-border: #333333;

  --login-bg: radial-gradient(1200px 600px at 50% -10%, #fdfaf4 0%, #f5f3ef 55%, #eeebe4 100%);
  --dashboard-bg: radial-gradient(1200px 600px at 50% -10%, #fdfaf4 0%, #f5f3ef 55%, #eeebe4 100%);
  --card-border: #e7e2da;
  --card-shadow: 0 14px 34px rgb(111 50 59 / 0.12), 0 2px 6px rgb(16 24 40 / 0.06);
  --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.04);

  --input-bg: #d9d9d9;
  --input-bg-focus: #cccccc;
  --input-text: #333333;

  --flash-shadow: 0 4px 12px rgb(16 24 40 / 15%);
  --flash-notice-bg: #e3f9e5;
  --flash-notice-text: #1a7f37;
  --flash-alert-bg: #fde8e8;
  --flash-alert-text: #b42318;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --page-bg: #161310;
  --surface: #201b16;
  --surface-alt: #2a241d;
  --border: #3a3229;
  --border-strong: #4a4238;
  --border-soft: #2e2822;

  --text: #e6ded2;
  --text-strong: #f5efe5;
  --text-muted: #9b9187;

  --accent: #e6c877;
  --accent-hover: #d4b45f;
  --btn-dark-bg: #3a3229;
  --btn-dark-text: #f5efe5;
  --btn-text: #2a2016;

  --sidebar-bg: #171310;
  --sidebar-text: #e6c877;
  --sidebar-border: #2a241d;

  --login-bg: radial-gradient(1200px 600px at 50% -10%, #2a2119 0%, #1c1712 55%, #141110 100%);
  --dashboard-bg: #1a1a1a;
  --card-border: #3a3229;
  --card-shadow: 0 14px 34px rgb(0 0 0 / 0.45), 0 2px 6px rgb(0 0 0 / 0.3);
  --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.45);

  --input-bg: #2a241d;
  --input-bg-focus: #35302a;
  --input-text: #e6ded2;

  --flash-shadow: 0 4px 12px rgb(0 0 0 / 40%);
  --flash-notice-bg: #14361d;
  --flash-notice-text: #86efac;
  --flash-alert-bg: #3b1613;
  --flash-alert-text: #fca5a5;
}

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

img {
  max-width: 100%;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-strong);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 0.15s ease, background-color 0.2s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  background: var(--surface-alt);
}

.theme-toggle-icon {
  display: none;
  line-height: 0;
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  display: block;
}

.theme-toggle-moon {
  display: block;
}

:root[data-theme="dark"] .theme-toggle-moon { display: none; }

:root[data-theme="dark"] .theme-toggle-sun {
  display: block;
}

.theme-toggle-label {
  display: none;
}

.theme-toggle-label-to-dark {
  display: inline;
}

:root[data-theme="dark"] .theme-toggle-label-to-dark {
  display: none;
}

:root[data-theme="dark"] .theme-toggle-label-to-light {
  display: inline;
}

.flash {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  margin: 0;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  box-shadow: var(--flash-shadow);
  font-size: 0.95rem;
  pointer-events: none;
  animation: flash-appear 0.25s ease-out, flash-hide 0.5s ease-in 4s forwards;
}

@keyframes flash-appear {
  from { opacity: 0; transform: translate(-50%, -8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes flash-hide {
  to { opacity: 0; transform: translate(-50%, -8px); visibility: hidden; }
}

.flash-notice { background: var(--flash-notice-bg); color: var(--flash-notice-text); }
.flash-alert  { background: var(--flash-alert-bg); color: var(--flash-alert-text); }

.flash-stack {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: max-content;
  max-width: min(92vw, 32rem);
  pointer-events: none;
}

.flash-stack .flash {
  position: static;
  transform: none;
  width: auto;
  max-width: 100%;
  animation: flash-stack-appear 0.25s ease-out,
    flash-stack-hide 0.5s ease-in 4s forwards;
}

@keyframes flash-stack-appear {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes flash-stack-hide {
  to { opacity: 0; transform: translateY(-8px); visibility: hidden; }
}

.main-content .flash {
  position: static;
  top: auto;
  left: auto;
  transform: none;
  width: auto;
  max-width: 100%;
  margin: 0 0 1rem;
  animation: none;
  pointer-events: auto;
}

