/* =====================================================================
   RPZ DESIGN — Folha de estilo (Dark Mode Neon)
   Paleta oficial:
     --bg          #0b0f19  Background principal (Slate Blue profundo)
     --card        #131926  Cards / módulos
     --cyan        #00f2fe  Destaque principal (Electric Cyan)
     --royal       #4facfe  Destaque secundário (Royal Blue)
   ===================================================================== */

:root {
    --bg:        #0b0f19;
    --bg-2:      #0e1320;
    --card:      #131926;
    --card-2:    #182032;
    --border:    #1f2a3d;
    --cyan:      #00f2fe;
    --royal:     #4facfe;
    --text:      #e8eefc;
    --muted:     #8a97b1;
    --muted-2:   #5d6b80;
    --green:     #21d07a;
    --amber:     #ffb547;
    --red:       #ff5d6c;
    --radius:    8px;
    --radius-sm: 6px;
    --shadow-neon: 0 0 0 1px rgba(0,242,254,.25), 0 8px 30px rgba(0,242,254,.08);
    --grad: linear-gradient(135deg, var(--cyan) 0%, var(--royal) 100%);
}

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

html, body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
svg { display: block; }

/* ---- Layout base ------------------------------------------------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #0c1120 0%, #0a0e18 100%);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand { padding: 0 8px 28px; }
.brand-mark {
    display: block;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 2px;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: 3px; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-weight: 500;
    transition: all .18s ease;
}
.nav-item:hover { background: var(--card); color: var(--text); }
.nav-item.is-active {
    color: var(--bg);
    background: var(--grad);
    box-shadow: 0 6px 18px rgba(0,242,254,.25);
}
.nav-item.is-active svg { color: var(--bg); }

.sidebar-foot { padding-top: 16px; }

.content { flex: 1; padding: 32px 40px; max-width: 100%; overflow-x: hidden; }

/* ---- Tipografia / cabeçalhos ------------------------------------ */
.page-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 28px; gap: 16px; flex-wrap: wrap;
}
.page-title { font-size: 24px; font-weight: 700; letter-spacing: -.3px; }
.page-subtitle { color: var(--muted); font-size: 13px; margin-top: 2px; }
.section-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; color: var(--text); }

/* ---- Botões ------------------------------------------------------ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    font-weight: 600; font-size: 13px;
    cursor: pointer;
    transition: all .16s ease;
    font-family: inherit;
}
.btn:hover { border-color: var(--royal); color: #fff; }
.btn-primary {
    background: var(--grad); color: var(--bg); border: none;
    box-shadow: 0 6px 18px rgba(0,242,254,.2);
}
.btn-primary:hover { color: var(--bg); filter: brightness(1.08); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--red); border-color: rgba(255,93,108,.3); }
.btn-danger:hover { background: rgba(255,93,108,.12); border-color: var(--red); color: var(--red); }

/* ---- Cards / superfícies ---------------------------------------- */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}
.card-hover:hover { border-color: rgba(0,242,254,.4); box-shadow: var(--shadow-neon); }

/* ---- Grid de métricas (dashboard) ------------------------------- */
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 30px; }
.metric {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    position: relative; overflow: hidden;
}
.metric::after {
    content: ''; position: absolute; top: 0; right: 0; width: 80px; height: 80px;
    background: radial-gradient(circle at top right, rgba(0,242,254,.12), transparent 70%);
}
.metric-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.metric-value { font-size: 28px; font-weight: 800; margin-top: 8px; letter-spacing: -.5px; }
.metric-value.cyan { color: var(--cyan); }
.metric-value.green { color: var(--green); }
.metric-value.amber { color: var(--amber); }
.metric-value.red { color: var(--red); }

/* ---- Tabelas ----------------------------------------------------- */
.table-wrap { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
thead th {
    text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .6px;
    color: var(--muted); padding: 14px 18px; border-bottom: 1px solid var(--border); font-weight: 600;
}
tbody td { padding: 14px 18px; border-bottom: 1px solid rgba(31,42,61,.5); }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .14s ease; }
tbody tr:hover { background: rgba(255,255,255,.02); }
.table-empty { padding: 48px; text-align: center; color: var(--muted); }

/* ---- Badges / status -------------------------------------------- */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600;
    border: 1px solid transparent;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-green { color: var(--green); background: rgba(33,208,122,.12); }
.badge-amber { color: var(--amber); background: rgba(255,181,71,.12); }
.badge-red   { color: var(--red);   background: rgba(255,93,108,.12); }
.badge-cyan  { color: var(--cyan);  background: rgba(0,242,254,.1); }
.badge-muted { color: var(--muted); background: rgba(138,151,177,.1); }
.badge-royal { color: var(--royal); background: rgba(79,172,254,.12); }
.badge.plain::before { display: none; }

/* ---- Formulários ------------------------------------------------- */
.form { max-width: 720px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-group { margin-bottom: 18px; display: flex; flex-direction: column; gap: 7px; }
.form-group.full { grid-column: 1 / -1; }
label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
input, select, textarea {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 11px 13px;
    color: var(--text);
    font-family: inherit; font-size: 14px;
    transition: border-color .16s ease, box-shadow .16s ease;
    width: 100%;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(0,242,254,.12);
}
textarea { resize: vertical; min-height: 90px; }
select { cursor: pointer; }
.form-actions { display: flex; gap: 12px; margin-top: 8px; }

/* ---- Flash messages --------------------------------------------- */
.flash {
    padding: 13px 18px; border-radius: var(--radius-sm); margin-bottom: 22px;
    font-weight: 500; border: 1px solid transparent;
}
.flash-success { background: rgba(33,208,122,.1); color: var(--green); border-color: rgba(33,208,122,.3); }
.flash-error   { background: rgba(255,93,108,.1); color: var(--red);  border-color: rgba(255,93,108,.3); }

/* ---- Kanban ------------------------------------------------------ */
.kanban {
    display: flex; gap: 16px; overflow-x: auto; padding-bottom: 16px; align-items: flex-start;
}
.kanban-col {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 280px; flex-shrink: 0;
    display: flex; flex-direction: column;
    max-height: calc(100vh - 180px);
}
.kanban-col-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; border-bottom: 1px solid var(--border);
    font-weight: 600; font-size: 13px;
}
.kanban-col-head .count {
    background: var(--card-2); color: var(--muted);
    border-radius: 20px; padding: 1px 9px; font-size: 11px;
}
.kanban-col-body {
    padding: 12px; display: flex; flex-direction: column; gap: 10px;
    overflow-y: auto; flex: 1; min-height: 60px;
}
.kanban-col.drag-over { border-color: var(--cyan); box-shadow: var(--shadow-neon); }

.kard {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 13px;
    cursor: grab;
    transition: border-color .14s ease, transform .14s ease, box-shadow .14s ease;
}
.kard:hover { border-color: rgba(79,172,254,.5); transform: translateY(-1px); }
.kard.dragging { opacity: .5; border-color: var(--cyan); cursor: grabbing; }
.kard-title { font-weight: 600; font-size: 13.5px; margin-bottom: 8px; line-height: 1.35; }
.kard-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.kard-foot { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); }
.kard-foot .val { color: var(--cyan); font-weight: 700; }
.kard-client { font-size: 11.5px; color: var(--muted); margin-bottom: 8px; }
.kard-prazo.late { color: var(--red); }

/* top accent por tipo de peça */
.kard[data-tipo="branding"]     { border-top: 2px solid var(--royal); }
.kard[data-tipo="social_media"] { border-top: 2px solid var(--cyan); }
.kard[data-tipo="ui_ux"]        { border-top: 2px solid #a78bfa; }
.kard[data-tipo="impresso"]     { border-top: 2px solid var(--amber); }
.kard[data-tipo="web"]          { border-top: 2px solid var(--green); }

/* ---- Detalhe de projeto ----------------------------------------- */
.split { display: grid; grid-template-columns: 1.6fr 1fr; gap: 22px; align-items: start; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.kv { display: flex; gap: 8px; font-size: 13px; }
.kv .k { color: var(--muted); }

/* ---- Lista de tarefas / checklist ------------------------------- */
.task-list { display: flex; flex-direction: column; gap: 8px; }
.task-item {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 13px; background: var(--bg-2);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.task-item.done .task-name { text-decoration: line-through; color: var(--muted); }
.task-check {
    width: 20px; height: 20px; flex-shrink: 0; cursor: pointer;
    border: 2px solid var(--border); border-radius: 5px;
    display: grid; place-items: center; background: transparent; transition: all .14s;
}
.task-check.on { background: var(--grad); border-color: transparent; }
.task-name { flex: 1; font-size: 13.5px; }
.task-timer { display: flex; align-items: center; gap: 8px; }
.timer-display { font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--muted); min-width: 62px; text-align: right; }
.timer-display.running { color: var(--cyan); }
.timer-btn {
    width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
    border: 1px solid var(--border); background: var(--card);
    display: grid; place-items: center; cursor: pointer; color: var(--text);
    transition: all .14s;
}
.timer-btn:hover { border-color: var(--cyan); color: var(--cyan); }
.timer-btn.running { background: rgba(255,93,108,.15); border-color: var(--red); color: var(--red); }

/* ---- Versões ----------------------------------------------------- */
.version-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 13px; background: var(--bg-2);
    border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px;
}
.version-label {
    background: var(--card-2); color: var(--cyan); font-weight: 700;
    padding: 3px 10px; border-radius: 6px; font-size: 12px; flex-shrink: 0;
}
.version-body { flex: 1; min-width: 0; }
.version-obs { font-size: 12.5px; color: var(--muted); }
.version-date { font-size: 11px; color: var(--muted-2); }

/* ---- Inline add row --------------------------------------------- */
.inline-add { display: flex; gap: 8px; margin-top: 12px; }
.inline-add input { flex: 1; }

/* ---- Utilidades -------------------------------------------------- */
.row { display: flex; gap: 12px; align-items: center; }
.between { justify-content: space-between; }
.gap-sm { gap: 8px; }
.mt { margin-top: 22px; }
.muted { color: var(--muted); }
.text-right { text-align: right; }
.cyan { color: var(--cyan); }
.green { color: var(--green); }
.red { color: var(--red); }
.wa-link { color: var(--green); font-weight: 600; }
.wa-link:hover { text-decoration: underline; }
.link-cyan { color: var(--royal); }
.link-cyan:hover { color: var(--cyan); }
.hr { height: 1px; background: var(--border); border: none; margin: 22px 0; }
.empty-hint { color: var(--muted); font-size: 13px; padding: 14px 0; }
.progress { height: 6px; background: var(--bg); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.progress > span { display: block; height: 100%; background: var(--grad); }

/* ---- Telas de autenticação -------------------------------------- */
.auth-wrap {
    min-height: 100vh; display: grid; place-items: center; padding: 24px;
    background:
        radial-gradient(circle at 20% 20%, rgba(0,242,254,.08), transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(79,172,254,.08), transparent 40%),
        var(--bg);
}
.auth-card {
    width: 100%; max-width: 400px;
    background: var(--card); border: 1px solid var(--border);
    border-radius: 14px; padding: 36px 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,.4), var(--shadow-neon);
}
.auth-brand { text-align: center; margin-bottom: 24px; }
.auth-brand .brand-mark { font-size: 34px; }
.auth-title { font-size: 21px; font-weight: 700; text-align: center; }
.auth-sub { color: var(--muted); font-size: 13px; text-align: center; margin: 4px 0 24px; }

/* ---- Usuário logado na sidebar ---------------------------------- */
.user-box {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; margin-bottom: 10px;
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.user-avatar {
    width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
    background: var(--grad); color: var(--bg);
    display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.user-info { min-width: 0; flex: 1; }
.user-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logout-btn {
    background: transparent; border: none; color: var(--muted); cursor: pointer;
    padding: 6px; border-radius: 6px; flex-shrink: 0;
}
.logout-btn:hover { color: var(--red); background: rgba(255,93,108,.1); }

/* ---- Responsivo -------------------------------------------------- */
@media (max-width: 900px) {
    .sidebar { width: 70px; padding: 20px 10px; }
    .brand-sub, .nav-item span, .sidebar-foot { display: none; }
    .nav-item { justify-content: center; }
    .content { padding: 24px 18px; }
    .metrics { grid-template-columns: repeat(2, 1fr); }
    .form-grid, .split { grid-template-columns: 1fr; }
}
