/* public/base.css — design system compartilhado do FUNimal */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');

:root {
  --bg:          #ffffff;
  --surface:     #F7F7F7;
  --surface-2:   #EBEBEB;
  --border:      #E5E5E5;
  --text:        #3C3C3C;
  --muted:       #777777;
  --primary:     #58CC02;
  --primary-d:   #46a302;
  --primary-fg:  #ffffff;
  --green:       #58CC02;
  --red:         #e01e2c;
  --blue:        #1CB0F6;
  --radius:      0.625rem;
}

[data-theme="dark"] {
  --bg:          #14181a;
  --surface:     #1e2225;
  --surface-2:   #262b2e;
  --border:      #333a3d;
  --text:        #ececec;
  --muted:       #9aa0a6;
  --primary:     #58CC02;
  --primary-d:   #6fe013;
  --primary-fg:  #ffffff;
  --green:       #58CC02;
  --red:         #ff5c5c;
  --blue:        #1CB0F6;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
}

/* NAV */
nav { background: var(--surface); border-bottom: 1px solid var(--border); padding: 0 1.5rem; display: flex; align-items: center; gap: 1.5rem; height: 56px; position: sticky; top: 0; z-index: 100; }
.nav-logo { font-weight: 800; font-size: 1.2rem; color: var(--primary); text-decoration: none; letter-spacing: -0.5px; }
.nav-links { display: flex; gap: 0.25rem; flex: 1; }
.nav-links a { color: var(--muted); text-decoration: none; padding: 0.4rem 0.75rem; border-radius: 6px; font-size: 0.9rem; transition: all 0.15s; }
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--surface-2); }
.nav-token { margin-left: auto; font-size: 0.75rem; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 0.3rem 0.6rem; cursor: pointer; white-space: nowrap; }
.nav-token:hover { border-color: var(--primary); color: var(--primary); }
.nav-balance { margin-left: auto; font-size: 0.8rem; font-weight: 700; color: var(--primary); background: rgba(88,204,2,0.1); border: 1px solid rgba(88,204,2,0.3); border-radius: 6px; padding: 0.3rem 0.65rem; }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.7rem 1.4rem; border-radius: 8px; font-weight: 700; font-size: 0.95rem; text-decoration: none; border: none; cursor: pointer; transition: all 0.15s; }
.btn-primary { background: var(--primary); color: var(--primary-fg); }
.btn-primary:hover { background: var(--primary-d); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--text); background: var(--surface-2); }
.btn-danger { background: transparent; color: var(--red); border: 1px solid var(--border); }
.btn-danger:hover { border-color: var(--red); background: rgba(224,30,44,0.08); }

/* CARDS */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.5rem; }
.card-title { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 0.75rem; }

/* STATUS BADGES */
.draw-status-badge { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.25rem 0.65rem; border-radius: 99px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.badge-open    { background: rgba(88,204,2,0.15);   color: var(--green); }
.badge-closing { background: rgba(88,204,2,0.15);   color: var(--primary); }
.badge-closed  { background: rgba(224,30,44,0.15);  color: var(--red); }
.badge-settled { background: rgba(28,176,246,0.15); color: var(--blue); }
.badge-scheduled { background: rgba(119,119,119,0.12); color: var(--muted); }
.badge-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-open .badge-dot { animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
.badge-federal-waiting { background: rgba(28,176,246,0.12); color: var(--blue); border: 1px solid rgba(28,176,246,0.25); animation: pulse-blue 2s ease-in-out infinite; }
.badge-federal-delayed  { background: rgba(224,30,44,0.1);  color: var(--red);  border: 1px solid rgba(224,30,44,0.25); }
@keyframes pulse-blue { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

/* INPUTS */
input, select, textarea { background: var(--surface); border: 1px solid var(--border); color: var(--text); border-radius: 8px; font-family: inherit; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }
input::placeholder { color: var(--muted); }

/* TOAST */
#toast { position: fixed; bottom: 1.5rem; right: 1.5rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 0.75rem 1rem; font-size: 0.875rem; opacity: 0; transform: translateY(8px); transition: all 0.2s; pointer-events: none; z-index: 999; max-width: 300px; }
#toast.show { opacity: 1; transform: translateY(0); }

/* BOTTOM TAB BAR (mobile) */
.bottom-nav { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 200; background: var(--surface); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom, 0px); }
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); text-decoration: none; font-size: 0.62rem; font-weight: 500; gap: 0.2rem; padding: 0.6rem 0.25rem; min-height: 56px; transition: color 0.15s; -webkit-tap-highlight-color: transparent; }
.bottom-nav a.active { color: var(--primary); }
.bottom-nav .tab-icon { font-size: 1.1rem; line-height: 1; }

/* THEME TOGGLE */
#themeToggle { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--border); background: var(--surface-2); cursor: pointer; color: var(--text); font-size: 1rem; transition: background 0.2s, border-color 0.2s, transform 0.15s; flex-shrink: 0; -webkit-tap-highlight-color: transparent; }
#themeToggle:hover { border-color: var(--primary); transform: scale(1.08); }

@media (max-width: 640px) {
  .bottom-nav { display: flex; }
  .nav-links, .nav-token { display: none; }
  nav { padding: 0 1rem; height: 48px; }
  #toast { bottom: calc(64px + env(safe-area-inset-bottom, 0px) + 0.5rem); left: 1rem; right: 1rem; max-width: none; text-align: center; }
}
