@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Inter:wght@300;400;500;600;700&display=swap');

/* =====================================================================
   ARABELLA LUXURY - style.css
   Variáveis de design, reset e estilos base
   ===================================================================== */

:root {
  /* Paleta principal: branco, preto, dourado */
  --color-bg: #fafaf7;
  --color-surface: #ffffff;
  --color-surface-2: #f4f1ea;
  --color-text: #1a1a1a;
  --color-text-muted: #6b6b6b;
  --color-border: #e5e1d6;
  --color-border-strong: #c9c2ad;

  --color-gold: #b8945a;
  --color-gold-dark: #8e6e3e;
  --color-gold-light: #d9c08a;
  --color-gold-bg: #f7f0dd;

  --color-black: #0a0a0a;
  --color-black-soft: #1a1a1a;

  --color-success: #2e7d32;
  --color-success-bg: #e7f3e8;
  --color-warning: #b8731a;
  --color-warning-bg: #fcf0d8;
  --color-danger: #b3261e;
  --color-danger-bg: #fbe9e8;
  --color-info: #1565c0;
  --color-info-bg: #e3f0fb;

  /* Tipografia */
  --font-sans: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-serif: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;

  /* Espaçamentos */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Bordas e sombras */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);

  /* Transições */
  --transition-fast: 120ms ease;
  --transition: 200ms ease;

  /* === Aliases Claude Design === */
  --bg: var(--color-bg);
  --surface: var(--color-surface);
  --surface-2: var(--color-surface-2);
  --surface-3: #ece7d8;
  --text: var(--color-text);
  --text-muted: var(--color-text-muted);
  --text-faint: #9a9a93;
  --border: var(--color-border);
  --border-strong: var(--color-border-strong);
  --gold: var(--color-gold);
  --gold-dark: var(--color-gold-dark);
  --gold-light: var(--color-gold-light);
  --gold-bg: var(--color-gold-bg);
  --gold-glow: rgba(184,148,90,0.18);
  --black: var(--color-black);
  --black-soft: var(--color-black-soft);
  --success: var(--color-success);
  --success-bg: var(--color-success-bg);
  --warning: var(--color-warning);
  --warning-bg: var(--color-warning-bg);
  --danger: var(--color-danger);
  --danger-bg: var(--color-danger-bg);
  --info: var(--color-info);
  --info-bg: var(--color-info-bg);
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --shadow-xs: 0 1px 2px rgba(20,18,12,0.04);
  --shadow-sm: 0 1px 3px rgba(20,18,12,0.06);
  --shadow-md: 0 4px 12px rgba(20,18,12,0.08);
  --shadow-lg: 0 10px 30px rgba(20,18,12,0.10);
  --shadow-xl: 0 20px 50px rgba(20,18,12,0.16);
  --sidebar-w: 248px;
  --sidebar-w-collapsed: 68px;
  --topbar-h: 64px;
  --ease-out: cubic-bezier(0.16,1,0.3,1);
  --ease-in-out: cubic-bezier(0.65,0,0.35,1);
}

[data-theme="dark"] {
  --color-bg: #0e0f11;
  --color-surface: #161719;
  --color-surface-2: #1e2023;
  --color-surface-3: #26282c;
  --color-text: #f0ede8;
  --color-text-muted: #9a9691;
  --color-border: rgba(255,255,255,0.07);
  --color-border-strong: rgba(255,255,255,0.13);
  --color-gold: #d4a853;
  --color-gold-dark: #b8943f;
  --color-gold-light: #e8c87a;
  --color-gold-bg: rgba(212,168,83,0.12);
  --color-black: #f0ede8;
  --color-black-soft: #e0ddd8;
  --color-success: #5cb87a;
  --color-success-bg: rgba(92,184,122,0.10);
  --color-warning: #d4a853;
  --color-warning-bg: rgba(212,168,83,0.10);
  --color-danger: #e06c6c;
  --color-danger-bg: rgba(224,108,108,0.10);
  --color-info: #6aabdf;
  --color-info-bg: rgba(106,171,223,0.10);
  --gold-glow: rgba(212,168,83,0.22);
  --text-faint: #5a5754;
  --surface-3: #26282c;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.40);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.50);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.60);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.70);
}

/* Reset minimalista */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
h1, h2, h3, h4, h5, h6 { margin: 0 0 var(--space-3); font-weight: 600; line-height: 1.25; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 var(--space-3); }
a { color: var(--color-gold-dark); text-decoration: none; }
a:hover { color: var(--color-gold); }

/* Botões base */
.btn-primary, .btn-secondary, .btn-ghost, .btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), border var(--transition), color var(--transition), transform var(--transition-fast);
  min-height: 42px;
}
.btn-primary {
  background: var(--color-black);
  color: var(--color-gold-light);
  border-color: var(--color-black);
}
.btn-primary:hover { background: var(--color-black-soft); color: #fff; }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border-strong);
}
.btn-secondary:hover { background: var(--color-surface-2); }

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border-color: transparent;
  padding: 6px 12px;
  min-height: 36px;
}
.btn-ghost:hover { color: var(--color-text); background: var(--color-surface-2); }

.btn-danger {
  background: var(--color-danger);
  color: #fff;
  border-color: var(--color-danger);
}
.btn-danger:hover { background: #921e17; }

/* Badges de status */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--color-surface-2);
  color: var(--color-text-muted);
}
.badge--success { background: var(--color-success-bg); color: var(--color-success); }
.badge--warning { background: var(--color-warning-bg); color: var(--color-warning); }
.badge--danger  { background: var(--color-danger-bg);  color: var(--color-danger); }
.badge--info    { background: var(--color-info-bg);    color: var(--color-info); }
.badge--gold    { background: var(--color-gold-bg);    color: var(--color-gold-dark); }

/* Toasts */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}
.toast {
  background: var(--color-black);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border-left: 3px solid var(--color-gold);
  pointer-events: auto;
  min-width: 240px;
  max-width: 360px;
  animation: toast-in 200ms ease forwards;
}
.toast--success { border-left-color: var(--color-success); }
.toast--error   { border-left-color: var(--color-danger); }
.toast--warn    { border-left-color: var(--color-warning); }
@keyframes toast-in {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* Loader global */
.global-loader {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}
.spinner {
  --size: 48px;
  width: var(--size);
  height: var(--size);
  position: relative;
  border: none;
  background: none;
  animation: none;
}
.spinner::before,
.spinner::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
}
.spinner::before {
  border-top-color: var(--color-gold);
  border-right-color: var(--color-gold-light);
  animation: luma-spin-rot 1.1s cubic-bezier(0.5,0.1,0.5,0.9) infinite;
  box-shadow: 0 0 20px var(--gold-glow, rgba(184,148,90,0.18));
}
.spinner::after {
  inset: 8px;
  border-top-color: var(--color-gold-light);
  border-right-color: var(--color-gold);
  animation-direction: reverse;
  animation-duration: 0.85s;
  opacity: 0.7;
}

.global-loader::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-gold, #c9a84c);
  box-shadow: 0 0 16px 4px rgba(201,168,76,0.5);
  animation: pulse-core 1.4s ease-in-out infinite;
}

@keyframes pulse-core {
  0%, 100% { transform: scale(0.8); opacity: 0.6; }
  50%       { transform: scale(1.3); opacity: 1;   }
}

/* Utilitários */
.text-muted { color: var(--color-text-muted); }
.text-gold { color: var(--color-gold-dark); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.hidden, [hidden] { display: none !important; }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mb-4 { margin-bottom: var(--space-4); }

.welcome-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-bg, #0e0e10);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 9997;
  animation: welcome-fade-out 400ms ease 2000ms forwards;
}

.welcome-overlay h2 {
  font-family: var(--font-serif, serif);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 400;
  font-style: italic;
  color: var(--color-text, #f4f4f5);
  margin: 0;
  animation: welcome-slide-up 600ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
  opacity: 0;
}

.welcome-overlay .welcome-line {
  width: 0;
  height: 1px;
  background: var(--color-gold, #c9a84c);
  animation: welcome-line-grow 500ms ease 400ms forwards;
  box-shadow: 0 0 8px rgba(201,168,76,0.4);
}

.welcome-overlay .welcome-sub {
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-gold, #c9a84c);
  opacity: 0;
  animation: welcome-slide-up 500ms ease 600ms forwards;
}

@keyframes welcome-slide-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes welcome-line-grow {
  from { width: 0; }
  to   { width: 120px; }
}

@keyframes welcome-fade-out {
  from { opacity: 1; pointer-events: auto; }
  to   { opacity: 0; pointer-events: none; }
}

/* === Keyframes Claude Design === */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes row-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes line-grow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
@keyframes luma-spin-rot {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* === Luma Spin === */
.luma-spin {
  --size: 48px;
  width: var(--size);
  height: var(--size);
  position: relative;
}
.luma-spin::before,
.luma-spin::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--gold);
  border-right-color: var(--gold-light);
  animation: luma-spin-rot 1.1s cubic-bezier(0.5,0.1,0.5,0.9) infinite;
  box-shadow: 0 0 20px var(--gold-glow);
}
.luma-spin::after {
  inset: 8px;
  border-top-color: var(--gold-light);
  border-right-color: var(--gold);
  animation-direction: reverse;
  animation-duration: 0.85s;
  opacity: 0.7;
}

/* === Notification Popover === */
.popover-anchor { position: relative; display: inline-flex; }
.bell-dot {
  position: absolute;
  top: 6px; right: 7px;
  width: 7px; height: 7px;
  background: var(--gold);
  border: 2px solid var(--surface);
  border-radius: 999px;
}
.popover {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
  animation: fade-up 180ms var(--ease-out) both;
}
.popover.popover-lg { width: 360px; }
.popover.popover-sm { padding: 4px; min-width: 160px; }
.popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border);
}
.popover-title { font-weight: 600; font-size: 14px; color: var(--text); }
.popover-subtitle { font-size: 12px; color: var(--text-muted); }
.popover-body { max-height: 380px; overflow-y: auto; padding: 6px; }
.popover-foot { padding: 6px; border-top: 1px solid var(--border); }
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  transition: background 140ms;
  text-decoration: none;
}
.notif-item:hover { background: var(--surface-2); }
.notif-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}
.notif-icon.overdue     { background: var(--danger-bg);  color: var(--danger); }
.notif-icon.lowstock    { background: var(--warning-bg); color: var(--warning); }
.notif-icon.reservation { background: var(--info-bg);    color: var(--info); }
.notif-icon.order       { background: var(--gold-bg);    color: var(--gold-dark); }
.notif-icon.sale        { background: var(--success-bg); color: var(--success); }
.notif-content { flex: 1; min-width: 0; }
.notif-title { font-weight: 600; font-size: 13px; color: var(--text); }
.notif-time { font-size: 11px; color: var(--text-faint); }
.notif-desc { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; line-height: 1.45; }
.notif-item .unread-dot {
  position: absolute;
  right: 10px; top: 12px;
  width: 6px; height: 6px;
  background: var(--gold);
  border-radius: 999px;
}
.popover-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 13px;
  width: 100%;
  cursor: pointer;
  text-align: left;
  background: none;
  border: none;
  font-family: inherit;
  transition: background 140ms, color 140ms;
}
.popover-item:hover { background: var(--surface-2); color: var(--text); }
.popover-item.is-active { color: var(--text); font-weight: 500; }
.theme-check { margin-left: auto; color: var(--gold-dark); }

/* === Avatar === */
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

/* === Btn-icon (topbar) === */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 10px;
  color: var(--text-muted);
  transition: all 180ms var(--ease-out);
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
}
.btn-icon:hover { color: var(--text); background: var(--surface-2); }

/* === Session pill === */
.session-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  height: 30px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 500;
}

/* === Tnum === */
.tnum {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

[data-theme="dark"] .btn-primary {
  background: var(--color-surface-3, #26282c);
  color: var(--color-text);
  border-color: var(--color-border-strong);
}

[data-theme="dark"] .btn-primary:hover {
  background: var(--color-surface-2);
  color: var(--color-text);
  border-color: var(--color-gold);
}

[data-theme="dark"] .btn-secondary {
  background: var(--color-surface-2);
  color: var(--color-text);
  border-color: var(--color-border-strong);
}

[data-theme="dark"] .btn-secondary:hover {
  background: var(--color-surface-3, #26282c);
  border-color: var(--color-gold);
}

[data-theme="dark"] .btn-ghost {
  color: var(--color-text-muted);
}

[data-theme="dark"] .btn-ghost:hover {
  background: var(--color-surface-2);
  color: var(--color-text);
}

[data-theme="dark"] .page-actions .btn-primary,
[data-theme="dark"] .btn-login-submit {
  background: var(--color-gold);
  color: #0a0a0a;
  border-color: var(--color-gold);
}

[data-theme="dark"] .page-actions .btn-primary:hover,
[data-theme="dark"] .btn-login-submit:hover {
  background: var(--color-gold-light);
  color: #0a0a0a;
}
