﻿/* ============================================================
   ZENIT DESIGN SYSTEM — Purple Theme (v2)
   SocialZenit Panel | Primary: #7B4FE0 | BG: #0d0820
   ============================================================ */

/* ---------- 1. Fontes ---------- */
@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=Outfit:wght@300;400;500;600;700;800&family=Montserrat:wght@600;700;800;900&family=Share+Tech+Mono&display=swap');

/* ---------- 2. CSS Variables ---------- */
:root {
    --background: #0d0820;
    --card: #0f0b1e;
    --card-hover: #130f28;
    --foreground: rgba(255, 255, 255, 0.9);
    --primary: #7B4FE0;
    --primary-light: #a78bfa;
    --primary-dark: #5B2FCC;
    --muted: #160e2e;
    --accent: #1e1540;
    --border: rgba(123, 79, 224, 0.2);
    --border-hover: rgba(123, 79, 224, 0.4);
    --sidebar-bg: #0B0030;
    --sidebar-border: rgba(123, 79, 224, 0.15);
    --text-muted: rgba(255, 255, 255, 0.5);
    --text-dim: rgba(255, 255, 255, 0.4);
    --text-body: rgba(255, 255, 255, 0.8);
    --radius: 0.625rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
}

/* ---------- 3. Animated Border ---------- */
@property --border-angle {
    syntax: '<angle>';
    inherits: true;
    initial-value: 0deg;
}

@keyframes spin-border {
    to { --border-angle: 360deg; }
}

.border-animated {
    background:
        linear-gradient(var(--card), var(--card)) padding-box,
        conic-gradient(from var(--border-angle), #7B4FE0, #a78bfa, #5B2FCC, #7B4FE0) border-box;
    border: 1.5px solid transparent;
    animation: spin-border 4s linear infinite;
}

/* ---------- 4. Base ---------- */
*, *::before, *::after {
    border-color: var(--border);
}

html {
    background: var(--background);
    color-scheme: dark;
    overflow-x: hidden;
}

body {
    background: var(--background);
    color: var(--foreground);
    font-family: 'Outfit', system-ui, sans-serif;
    min-height: 100dvh;
    overflow-x: hidden;
    margin: 0;
}

::selection {
    background: rgba(123, 79, 224, 0.35);
    color: #e9e0ff;
}

/* ---------- 5. Typography ---------- */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    color: #ffffff;
    letter-spacing: -0.01em;
    line-height: 1.4;
}

.font-heading {
    font-family: 'Archivo Black', sans-serif;
}

.label-mono {
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
    font-size: 10px;
    color: var(--text-dim);
}

code, pre, .font-mono {
    font-family: 'Share Tech Mono', monospace;
    letter-spacing: 0.02em;
}

/* ---------- 6. Scrollbar ---------- */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(123, 79, 224, 0.4);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(123, 79, 224, 0.7);
}

/* ---------- 7. Sidebar ---------- */
.sidebar {
    width: 14rem;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 40;
    overflow-y: auto;
}

.sidebar-logo {
    font-family: 'Archivo Black', sans-serif;
    font-size: 1.25rem;
    color: #ffffff;
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-logo span {
    background: linear-gradient(135deg, #a78bfa 0%, #7B4FE0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    transition: all 150ms ease;
    border-left: 2px solid transparent;
}

.sidebar-nav a:hover {
    background: rgba(123, 79, 224, 0.08);
    color: rgba(255, 255, 255, 0.85);
}

.sidebar-nav a.active {
    background: rgba(123, 79, 224, 0.2);
    color: #c4b5fd;
    border-left-color: #7B4FE0;
    font-weight: 600;
}

.sidebar-nav a.active i {
    color: #a78bfa;
}

.sidebar-nav a i {
    width: 1.25rem;
    text-align: center;
    font-size: 0.875rem;
    opacity: 0.7;
}

.sidebar-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--sidebar-border);
}

.sidebar-footer .logout-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    color: rgba(252, 165, 165, 0.7);
    cursor: pointer;
    transition: all 150ms ease;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
}

.sidebar-footer .logout-btn:hover {
    background: rgba(244, 63, 94, 0.1);
    color: #fca5a5;
}

/* ---------- 8. Main Content ---------- */
.main-content {
    margin-left: 14rem;
    padding: 1.5rem 2rem;
    min-height: 100dvh;
}

.page-title {
    font-family: 'Archivo Black', sans-serif;
    font-size: 1.5rem;
    color: #ffffff;
    margin-bottom: 1.5rem;
}

/* ---------- 9. Cards ---------- */
.card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 1.25rem;
}

.card:hover {
    border-color: var(--border-hover);
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 1rem 1.25rem;
}

.stat-card .stat-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-dim);
    margin-bottom: 0.25rem;
}

.stat-card .stat-value {
    font-size: 1.875rem;
    font-weight: 900;
    color: #ffffff;
    line-height: 1.2;
}

/* ---------- 10. Tables ---------- */
.table-wrapper {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    overflow: hidden;
}

.table-wrapper table {
    width: 100%;
    border-collapse: collapse;
}

.table-wrapper thead {
    background: rgba(255, 255, 255, 0.03);
}

.table-wrapper th {
    padding: 0.75rem;
    text-align: left;
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.table-wrapper tbody tr {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.table-wrapper tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.table-wrapper td {
    padding: 0.625rem 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-body);
}

/* ---------- 11. Buttons ---------- */
.btn-primary {
    background: #7B4FE0;
    color: #ffffff;
    border: none;
    border-radius: 0.75rem;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 150ms ease;
}

.btn-primary:hover {
    background: #6B3FD0;
}

.btn-secondary {
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 150ms ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 0.75rem;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 150ms ease;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
}

/* ---------- 12. Inputs ---------- */
.input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    color: #ffffff;
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.input:focus {
    border-color: rgba(123, 79, 224, 0.5);
    box-shadow: 0 0 0 3px rgba(123, 79, 224, 0.15);
}

select.input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='rgba(255,255,255,0.5)' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

/* ---------- 13. Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-info {
    background: rgba(123, 79, 224, 0.1);
    color: #a78bfa;
    border: 1px solid rgba(123, 79, 224, 0.3);
}

.badge-neutral {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ---------- 14. Tabs ---------- */
.tabs {
    display: flex;
    gap: 0.25rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.25rem;
    border-radius: 0.625rem;
}

.tab {
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 150ms ease;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
}

.tab:hover {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.05);
}

.tab.active {
    background: #7B4FE0;
    color: #ffffff;
}

/* ---------- 15. Toast (compatível com app.js) ---------- */
.toast-root {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    color: var(--foreground);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    animation: toast-in 200ms ease;
}

.toast.success { border-color: rgba(16, 185, 129, 0.4); }
.toast.error { border-color: rgba(239, 68, 68, 0.4); }
.toast.warning { border-color: rgba(245, 158, 11, 0.4); }

@keyframes toast-in {
    from { opacity: 0; transform: translateX(1rem); }
    to { opacity: 1; transform: translateX(0); }
}

/* ---------- 16. Login Page ---------- */
.login-container {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background);
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 380px;
    padding: 2rem;
    border-radius: 1.25rem;
}

.login-card h1 {
    font-family: 'Archivo Black', sans-serif;
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-card .form-group {
    margin-bottom: 1rem;
}

.login-card label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ---------- 17. Kanban ---------- */
.kanban-board {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 1rem;
}

.kanban-column {
    min-width: 260px;
    flex: 1;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    padding: 0.75rem;
}

.kanban-column-header {
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kanban-column-header .count {
    background: rgba(123, 79, 224, 0.2);
    color: #a78bfa;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 10px;
}

.kanban-card {
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.625rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    cursor: grab;
    transition: border-color 150ms ease;
}

.kanban-card:hover {
    border-color: var(--border-hover);
}

/* ---------- 18. Utilities ---------- */
.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.text-body { color: var(--text-body); }
.text-primary { color: var(--primary-light); }
.bg-card { background: var(--card); }
.border-subtle { border-color: rgba(255, 255, 255, 0.05); }

/* Grid stat cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

/* Section header */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.section-header h3 {
    font-size: 0.875rem;
    font-weight: 700;
    color: #ffffff;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-dim);
}

.empty-state i {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    opacity: 0.4;
}

/* ---------- 19. Responsive ---------- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 200ms ease;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .kanban-board {
        flex-direction: column;
    }
    .kanban-column {
        min-width: unset;
    }
}

/* ---------- 20. Animations ---------- */
@keyframes fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-in {
    animation: fade-in 300ms ease both;
}

/* Stagger children */
.stagger > *:nth-child(1) { animation-delay: 0ms; }
.stagger > *:nth-child(2) { animation-delay: 50ms; }
.stagger > *:nth-child(3) { animation-delay: 100ms; }
.stagger > *:nth-child(4) { animation-delay: 150ms; }
.stagger > *:nth-child(5) { animation-delay: 200ms; }
.stagger > *:nth-child(6) { animation-delay: 250ms; }
