/* ============================================
   ZE PITACO v2.0 — Componentes e temas
   CSS vanilla compatível com Tailwind CDN
   ============================================ */

*, *::before, *::after { box-sizing: border-box; }

/* ---- Botões ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 0.75rem;
    padding: 0.7rem 1.25rem;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    text-decoration: none;
    line-height: 1.4;
}
.btn:disabled { opacity: 0.6; cursor: wait; }
.btn-primary { background: var(--primary, #22c55e); color: #0f172a; border-color: var(--primary, #22c55e); }
.btn-primary:hover { filter: brightness(1.1); box-shadow: 0 4px 20px rgba(34,197,94,0.3); }
.btn-primary:active { transform: scale(0.97); }
.btn-outline { background: transparent; color: var(--text, #f8fafc); border-color: var(--border, rgba(255,255,255,0.12)); }
.btn-outline:hover { border-color: var(--primary, #22c55e); color: var(--primary, #22c55e); box-shadow: 0 4px 20px rgba(34,197,94,0.15); }
.btn-ghost { background: transparent; color: var(--muted, #94a3b8); border-color: transparent; }
.btn-ghost:hover { color: var(--text, #f8fafc); background: rgba(255,255,255,0.05); }
.btn-danger { background: rgba(239,68,68,0.15); color: #f87171; border-color: rgba(239,68,68,0.25); }
.btn-danger:hover { background: rgba(239,68,68,0.25); color: #fca5a5; }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.82rem; border-radius: 0.6rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1.1rem; border-radius: 1rem; }

/* ---- Cards ---- */
.card {
    border-radius: 1rem;
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    background: rgba(255,255,255,0.03);
    padding: 1.5rem;
    transition: all 0.3s ease;
}
.card-hover:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.15);
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
    transform: translateY(-2px);
}
.card-glass {
    background: rgba(255,255,255,0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-color: rgba(255,255,255,0.06);
}

/* ---- Inputs ---- */
.input-field {
    width: 100%;
    border-radius: 0.75rem;
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    background: rgba(255,255,255,0.04);
    padding: 0.7rem 1rem;
    color: var(--text, #f8fafc);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s ease;
}
.input-field::placeholder { color: var(--muted, #64748b); }
.input-field:focus { border-color: var(--primary, #22c55e); box-shadow: 0 0 0 3px rgba(34,197,94,0.15); }
.label-text { display: block; font-size: 0.85rem; font-weight: 600; color: var(--muted, #94a3b8); margin-bottom: 0.35rem; }

/* ---- Badges ---- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border-radius: 999px;
    padding: 0.2rem 0.7rem;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-success { background: rgba(34,197,94,0.15); color: #4ade80; }
.badge-warning { background: rgba(234,179,8,0.15); color: #facc15; }
.badge-danger { background: rgba(239,68,68,0.15); color: #f87171; }
.badge-info { background: rgba(59,130,246,0.15); color: #60a5fa; }
.badge-neutral { background: rgba(255,255,255,0.08); color: var(--muted, #94a3b8); }

/* ---- Stat cards ---- */
.stat-card {
    border-radius: 1rem;
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    background: rgba(255,255,255,0.03);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    transition: all 0.3s ease;
}
.stat-card:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.15);
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    transform: translateY(-1px);
}
.stat-value { font-size: 1.75rem; font-weight: 900; letter-spacing: -0.02em; color: var(--text, #f8fafc); }
.stat-label { font-size: 0.85rem; color: var(--muted, #94a3b8); }

/* ---- Sidebar ---- */
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: 0.75rem;
    padding: 0.7rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease;
}
.sidebar-link-active {
    background: rgba(34,197,94,0.12);
    color: var(--primary, #4ade80);
    border-left: 2px solid var(--primary, #22c55e);
    padding-left: calc(1rem - 2px);
}
.sidebar-link-inactive { color: var(--muted, #94a3b8); }
.sidebar-link-inactive:hover { color: var(--text, #f8fafc); background: rgba(255,255,255,0.04); }

/* ---- Toast ---- */
.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: 1rem;
    padding: 0.85rem 1.2rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid;
    animation: slide-up 0.3s ease-out;
    font-size: 0.875rem;
}
.toast-success { background: rgba(34,197,94,0.15); border-color: rgba(34,197,94,0.25); color: #86efac; }
.toast-error { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.25); color: #fca5a5; }
.toast-warning { background: rgba(234,179,8,0.15); border-color: rgba(234,179,8,0.25); color: #fde047; }
.toast-info { background: rgba(59,130,246,0.15); border-color: rgba(59,130,246,0.25); color: #93c5fd; }

/* ---- Notification dot ---- */
.notification-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid var(--ink, #111827);
    animation: pulse-dot 2s infinite;
}

/* ---- Animations ---- */
@keyframes slide-up {
    from { opacity: 0; transform: translateY(0.75rem); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slide-down {
    from { opacity: 0; transform: translateY(-0.5rem); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes scale-in {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 rgba(34,197,94,0.4); }
    70% { box-shadow: 0 0 0 12px rgba(34,197,94,0); }
    100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.3); }
}

.animate-slide-up { animation: slide-up 0.3s ease-out; }
.animate-slide-down { animation: slide-down 0.2s ease-out; }
.animate-fade-in { animation: fade-in 0.3s ease-out; }
.animate-scale-in { animation: scale-in 0.25s ease-out; }
.animate-float { animation: float 4s ease-in-out infinite; }
.animate-shimmer {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}
.animate-pulse-ring { animation: pulse-ring 2s infinite; }

/* ---- Gradient text ---- */
.gradient-text {
    background: linear-gradient(to right, var(--primary, #22c55e), #86efac);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ---- Base ---- */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--ink, #0f172a);
    color: var(--text, #f8fafc);
    margin: 0;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ---- Theme toggle ---- */
.theme-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    border-radius: 12px;
    border: 1px solid var(--border, rgba(255,255,255,0.15));
    background: var(--surface, #1e293b);
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    padding: 0;
}
.theme-toggle:hover { border-color: var(--primary, #22c55e); }
.theme-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary, #22c55e);
    transition: transform 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
/* light mode */
html:not(.dark) .theme-toggle { background: #e2e8f0; border-color: rgba(0,0,0,0.12); }
html:not(.dark) .theme-toggle::after { transform: translateX(20px); background: #fbbf24; }

/* ---- Light mode overrides ---- */
html:not(.dark) body {
    background: #f8fafc;
    color: #0f172a;
}
html:not(.dark) .card,
html:not(.dark) .stat-card {
    background: #ffffff;
    border-color: rgba(0,0,0,0.08);
}
html:not(.dark) .card-hover:hover,
html:not(.dark) .stat-card:hover {
    background: #f1f5f9;
    border-color: rgba(0,0,0,0.15);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
html:not(.dark) .card-glass {
    background: rgba(255,255,255,0.8);
    border-color: rgba(0,0,0,0.06);
}
html:not(.dark) .sidebar-link-active {
    background: rgba(34,197,94,0.1);
}
html:not(.dark) .sidebar-link-inactive { color: #64748b; }
html:not(.dark) .sidebar-link-inactive:hover { color: #0f172a; background: #f1f5f9; }
html:not(.dark) .input-field {
    background: #ffffff;
    color: #0f172a;
    border-color: rgba(0,0,0,0.1);
}
html:not(.dark) .btn-outline { color: #334155; border-color: rgba(0,0,0,0.15); }
html:not(.dark) .btn-outline:hover { color: var(--primary, #16a34a); border-color: var(--primary, #22c55e); }
html:not(.dark) .btn-ghost { color: #64748b; }
html:not(.dark) .btn-ghost:hover { color: #0f172a; background: #f1f5f9; }
html:not(.dark) .stat-value { color: #0f172a; }
html:not(.dark) .stat-label { color: #64748b; }
html:not(.dark) .label-text { color: #475569; }
html:not(.dark) .badge-neutral { background: rgba(0,0,0,0.06); color: #64748b; }

/* input fields light mode */
html:not(.dark) input[type="text"],
html:not(.dark) input[type="email"],
html:not(.dark) input[type="password"],
html:not(.dark) input[type="search"],
html:not(.dark) input[type="url"],
html:not(.dark) select,
html:not(.dark) textarea {
    background: #ffffff;
    color: #0f172a;
    border-color: rgba(0,0,0,0.15);
}

/* ---- Responsive ---- */
@media (hover: none) {
    .card-hover:hover, .stat-card:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
