/* ============================================================
   PARALELO PROMOTORA — Sistema de Produção
   Design: Dark industrial / refinado
   ============================================================ */

:root {
    --bg:        #0d0f14;
    --bg2:       #13161e;
    --bg3:       #1a1e28;
    --border:    #252a38;
    --border2:   #2e3447;
    --text:      #e8eaf0;
    --text2:     #8b90a0;
    --text3:     #555c72;
    --accent:    #f0a500;
    --accent2:   #e09000;
    --green:     #22c87a;
    --red:       #f04060;
    --blue:      #4090f0;
    --purple:    #9060f0;
    --sidebar-w: 240px;
    --radius:    10px;
    --radius-sm: 6px;
    --shadow:    0 4px 24px rgba(0,0,0,0.4);
}

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

html { font-size: 15px; }

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ---- LOGOS ---- */
.sidebar-logo {
    width: 120px;
    height: auto;
    display: block;
    margin: 0 auto;
    mix-blend-mode: screen;
}

.login-logo {
    width: 130px;
    height: auto;
    display: block;
    margin: 0 auto 12px;
    mix-blend-mode: screen;
}

/* ---- APP SHELL ---- */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* ---- SIDEBAR ---- */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg2);
}

.brand-mark {
    width: 38px; height: 38px;
    background: var(--accent);
    color: #000;
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: 1.2rem;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
    flex-shrink: 0;
}

.brand-name {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
    display: block;
    line-height: 1.1;
}

.brand-sub {
    font-size: 0.7rem;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: block;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text2);
    text-decoration: none;
    font-size: 0.87rem;
    font-weight: 400;
    transition: all 0.18s;
}

.nav-item svg {
    width: 16px; height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.nav-item:hover { background: var(--bg3); color: var(--text); }
.nav-item.active { background: rgba(240,165,0,0.12); color: var(--accent); font-weight: 500; }

.nav-divider {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text3);
    padding: 14px 12px 4px;
    font-weight: 600;
}

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 14px;
    border-top: 1px solid var(--border);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.user-avatar {
    width: 32px; height: 32px;
    background: var(--accent);
    color: #000;
    border-radius: 50%;
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.user-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.7rem;
    color: var(--text3);
    display: block;
}

.btn-icon {
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 6px;
    color: var(--text3);
    text-decoration: none;
    transition: all 0.18s;
    flex-shrink: 0;
}

.btn-icon svg {
    width: 15px; height: 15px;
    stroke: currentColor; fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.btn-icon:hover { background: var(--bg3); color: var(--text); }
.btn-logout:hover { background: rgba(240,64,96,0.15); color: var(--red); }

/* ---- MAIN CONTENT ---- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 28px;
    height: 60px;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text2);
    cursor: pointer;
    padding: 4px;
}

.menu-toggle svg {
    width: 20px; height: 20px;
    stroke: currentColor; fill: none;
    stroke-width: 2;
    stroke-linecap: round;
}

.page-title {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
    flex: 1;
}

.topbar-date {
    font-size: 0.8rem;
    color: var(--text3);
}

.page-body {
    padding: 28px;
    flex: 1;
}

/* ---- CARDS MÉTRICAS ---- */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.metric-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: var(--accent);
}

.metric-card.green::before { background: var(--green); }
.metric-card.blue::before  { background: var(--blue); }
.metric-card.purple::before{ background: var(--purple); }
.metric-card.red::before   { background: var(--red); }

.metric-label {
    font-size: 0.75rem;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    margin-bottom: 6px;
}

.metric-value {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 1.6rem;
    color: var(--text);
    line-height: 1.1;
}

.metric-sub {
    font-size: 0.75rem;
    color: var(--text3);
    margin-top: 4px;
}

/* ---- TABELA ---- */
.table-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
}

.table-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
    flex-wrap: wrap;
}

.table-card-title {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text);
}

.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

thead tr {
    background: var(--bg3);
}

th {
    padding: 11px 16px;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text3);
    white-space: nowrap;
}

td {
    padding: 11px 16px;
    border-top: 1px solid var(--border);
    color: var(--text2);
    vertical-align: middle;
}

tbody tr:hover { background: rgba(255,255,255,0.02); }

.td-main { color: var(--text); font-weight: 500; }

/* ---- BADGES ---- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-pendente  { background: rgba(240,165,0,0.15);  color: var(--accent); }
.badge-pago      { background: rgba(34,200,122,0.15); color: var(--green); }
.badge-cancelado { background: rgba(240,64,96,0.15);  color: var(--red); }
.badge-estornado { background: rgba(144,96,240,0.15); color: var(--purple); }
.badge-master    { background: rgba(240,165,0,0.15);  color: var(--accent); }
.badge-corretor  { background: rgba(64,144,240,0.15); color: var(--blue); }
.badge-ativo     { background: rgba(34,200,122,0.15); color: var(--green); }
.badge-inativo   { background: rgba(240,64,96,0.15);  color: var(--red); }

/* ---- BOTÕES ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.83rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.18s;
    font-family: 'DM Sans', sans-serif;
    white-space: nowrap;
}

.btn svg {
    width: 14px; height: 14px;
    stroke: currentColor; fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.btn-primary   { background: var(--accent); color: #000; }
.btn-primary:hover { background: var(--accent2); }
.btn-secondary { background: var(--bg3); color: var(--text2); border: 1px solid var(--border2); }
.btn-secondary:hover { color: var(--text); border-color: var(--text3); }
.btn-danger    { background: rgba(240,64,96,0.1); color: var(--red); border: 1px solid rgba(240,64,96,0.2); }
.btn-danger:hover { background: rgba(240,64,96,0.2); }
.btn-success   { background: rgba(34,200,122,0.1); color: var(--green); border: 1px solid rgba(34,200,122,0.2); }
.btn-success:hover { background: rgba(34,200,122,0.2); }
.btn-sm { padding: 5px 10px; font-size: 0.78rem; }

/* ---- FORMULÁRIOS ---- */
.form-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full { grid-column: 1 / -1; }

label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input, select, textarea {
    background: var(--bg3);
    border: 1px solid var(--border2);
    color: var(--text);
    padding: 9px 13px;
    border-radius: var(--radius-sm);
    font-size: 0.87rem;
    font-family: 'DM Sans', sans-serif;
    transition: border 0.18s;
    width: 100%;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
}

input::placeholder, textarea::placeholder { color: var(--text3); }

select option { background: var(--bg3); }

textarea { resize: vertical; min-height: 80px; }

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* ---- ALERTAS ---- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.87rem;
    font-weight: 500;
}

.alert-success { background: rgba(34,200,122,0.1);  border: 1px solid rgba(34,200,122,0.25); color: var(--green); }
.alert-error   { background: rgba(240,64,96,0.1);   border: 1px solid rgba(240,64,96,0.25);  color: var(--red); }
.alert-info    { background: rgba(64,144,240,0.1);  border: 1px solid rgba(64,144,240,0.25); color: var(--blue); }
.alert-warning { background: rgba(240,165,0,0.1);   border: 1px solid rgba(240,165,0,0.25);  color: var(--accent); }

/* ---- MODAL ---- */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal-backdrop.open { display: flex; }

.modal {
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    padding: 28px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { transform: translateY(-12px); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-title {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text3);
    cursor: pointer;
    padding: 4px;
    transition: color 0.18s;
}

.modal-close:hover { color: var(--red); }
.modal-close svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }

/* ---- UPLOAD ZONE ---- */
.upload-zone {
    border: 2px dashed var(--border2);
    border-radius: var(--radius);
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg3);
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--accent);
    background: rgba(240,165,0,0.05);
}

.upload-zone svg {
    width: 40px; height: 40px;
    stroke: var(--text3); fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    margin-bottom: 12px;
}

.upload-zone p { color: var(--text3); font-size: 0.87rem; }
.upload-zone strong { color: var(--accent); }

/* ---- PROGRESSO ---- */
.progress-bar {
    height: 6px;
    background: var(--bg3);
    border-radius: 3px;
    overflow: hidden;
    margin: 8px 0;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.3s;
}

/* ---- EMPTY STATE ---- */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text3);
}

.empty-state svg {
    width: 48px; height: 48px;
    stroke: currentColor; fill: none;
    stroke-width: 1.2;
    stroke-linecap: round;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p { font-size: 0.9rem; }

/* ---- FILTROS ---- */
.filters-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 20px;
}

.filters-bar .form-group {
    min-width: 160px;
    flex: 1;
}

/* ---- PAGINAÇÃO ---- */
.pagination {
    display: flex;
    gap: 4px;
    justify-content: center;
    padding: 16px;
    border-top: 1px solid var(--border);
}

.page-btn {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 0.83rem;
    color: var(--text2);
    text-decoration: none;
    border: 1px solid var(--border);
    transition: all 0.18s;
}

.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent); color: #000; border-color: var(--accent); font-weight: 700; }

/* ---- LOGIN ---- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    background-image: radial-gradient(ellipse at 20% 50%, rgba(240,165,0,0.06) 0%, transparent 60%),
                      radial-gradient(ellipse at 80% 20%, rgba(64,144,240,0.04) 0%, transparent 50%);
}

.login-box {
    width: 100%;
    max-width: 400px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow);
}

.login-brand {
    text-align: center;
    margin-bottom: 32px;
}

.login-brand .brand-mark {
    width: 56px; height: 56px;
    font-size: 1.8rem;
    margin: 0 auto 12px;
}

.login-brand h1 {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--text);
    margin-bottom: 4px;
}

.login-brand p {
    font-size: 0.8rem;
    color: var(--text3);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: flex;
    }

    .page-body {
        padding: 16px;
    }

    .metrics-grid {
        grid-template-columns: 1fr 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* ---- UTILITÁRIOS ---- */
.text-right  { text-align: right; }
.text-center { text-align: center; }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.text-accent { color: var(--accent); }
.text-muted  { color: var(--text3); }
.fw-bold     { font-weight: 700; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.d-flex { display: flex; }
.gap-8  { gap: 8px; }
.align-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.w-full { width: 100%; }
