/* Etechlogs CRM - Estilo glassmorphism premium */
:root {
    --bg-dark: #050810;
    --bg-card: rgba(20, 25, 40, 0.6);
    --bg-card-solid: #0e1424;
    --text-light: #f8fafc;
    --text-muted: #94a3b8;
    --accent-primary: #ea580c;
    --accent-secondary: #0284c7;
    --accent-success: #22c55e;
    --accent-warning: #eab308;
    --accent-danger: #ef4444;
    --border-glass: rgba(255, 255, 255, 0.08);
    --font-primary: 'Montserrat', sans-serif;
    --font-secondary: 'Inter', sans-serif;
}

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

html, body {
    font-family: var(--font-secondary);
    background: radial-gradient(ellipse at top, #0a1024 0%, var(--bg-dark) 60%);
    color: var(--text-light);
    line-height: 1.6;
    font-weight: 300;
    min-height: 100vh;
}

a { color: var(--accent-secondary); text-decoration: none; }
a:hover { color: #38bdf8; }

/* ---------- LAYOUT ---------- */
.crm-shell {
    display: flex;
    min-height: 100vh;
    align-items: stretch;
}

.crm-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: rgba(10, 14, 28, 0.85);
    border-right: 1px solid var(--border-glass);
    padding: 24px 18px;
    backdrop-filter: blur(14px);
}

.crm-sidebar .brand {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    color: #fff;
    margin-bottom: 8px;
}
.crm-sidebar .brand span { color: var(--accent-primary); }

.crm-sidebar .userbox {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 30px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-glass);
}
.crm-sidebar .userbox strong { color: var(--text-light); font-weight: 500; display: block; }

.crm-nav { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.crm-nav a {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 400;
    transition: 0.2s;
}
.crm-nav a:hover { background: rgba(255,255,255,0.04); color: var(--text-light); }
.crm-nav a.active {
    background: rgba(234, 88, 12, 0.12);
    color: var(--accent-primary);
    font-weight: 500;
}

.crm-main { flex-grow: 1; padding: 32px 40px; min-width: 0; }

.crm-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 28px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-glass);
}
.crm-header h1 {
    font-family: var(--font-primary);
    font-size: 1.6rem;
    font-weight: 600;
}
.crm-header p { color: var(--text-muted); font-size: 0.88rem; margin-top: 4px; }

/* ---------- KPI CARDS ---------- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    padding: 20px;
    backdrop-filter: blur(10px);
}
.kpi-card h3 {
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 500;
    margin-bottom: 8px;
}
.kpi-card .value {
    font-family: var(--font-primary);
    font-size: 2rem;
    font-weight: 700;
}

/* ---------- CARD CONTAINER ---------- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    padding: 20px 24px;
    backdrop-filter: blur(10px);
    margin-bottom: 20px;
}
.card h2 {
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

/* ---------- FILTROS ---------- */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}
.filters input[type=text], .filters select {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-glass);
    color: var(--text-light);
    padding: 8px 12px;
    border-radius: 8px;
    font-family: var(--font-secondary);
    font-size: 0.85rem;
    min-width: 160px;
}
.filters input[type=text]:focus, .filters select:focus {
    outline: none;
    border-color: var(--accent-secondary);
}

/* ---------- TABELA ---------- */
.tbl-wrap { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}
th {
    font-family: var(--font-primary);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-glass);
}
td {
    padding: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    font-size: 0.88rem;
    vertical-align: top;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

.empresa-name { font-weight: 500; color: #fff; display: block; }
.row-link { cursor: pointer; }
.row-link:hover td { background: rgba(234,88,12,0.04); }

/* ---------- BADGES ---------- */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
    border: 1px solid transparent;
    letter-spacing: 0.3px;
}
.badge-info    { background: rgba(2,132,199,0.18);  color: var(--accent-secondary); border-color: rgba(2,132,199,0.3); }
.badge-warn    { background: rgba(234,179,8,0.15);  color: #facc15;                  border-color: rgba(234,179,8,0.3); }
.badge-success { background: rgba(34,197,94,0.15);  color: var(--accent-success);    border-color: rgba(34,197,94,0.3); }
.badge-primary { background: rgba(234,88,12,0.18);  color: var(--accent-primary);    border-color: rgba(234,88,12,0.3); }
.badge-muted   { background: rgba(148,163,184,0.12);color: var(--text-muted);        border-color: rgba(148,163,184,0.25); }

/* ---------- CONFIANÇA GAUGE ---------- */
.gauge { width: 100%; height: 4px; background: rgba(255,255,255,0.08); border-radius: 2px; overflow: hidden; margin-top: 4px; }
.gauge > div { height: 100%; }

/* ---------- FORM / BOTÃO ---------- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 500;
}
.form-group input,
.form-group select,
.form-group textarea {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-glass);
    color: var(--text-light);
    padding: 10px 12px;
    border-radius: 8px;
    font-family: var(--font-secondary);
    font-size: 0.9rem;
    width: 100%;
}
.form-group textarea { resize: vertical; min-height: 90px; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: var(--accent-secondary); }

.btn {
    background: var(--accent-primary);
    color: #fff;
    border: 0;
    padding: 10px 18px;
    border-radius: 8px;
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: 0.2s;
}
.btn:hover { background: #f97316; }
.btn-secondary { background: rgba(255,255,255,0.06); color: var(--text-light); }
.btn-secondary:hover { background: rgba(255,255,255,0.1); }
.btn-danger { background: var(--accent-danger); }
.btn-danger:hover { background: #dc2626; }

/* ---------- TIMELINE INTERAÇÕES ---------- */
.timeline { list-style: none; position: relative; padding-left: 24px; }
.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: var(--border-glass);
}
.timeline li {
    position: relative;
    margin-bottom: 18px;
    padding: 12px 14px;
    background: rgba(255,255,255,0.025);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
}
.timeline li::before {
    content: '';
    position: absolute;
    left: -22px;
    top: 14px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(234,88,12,0.18);
}
.timeline .meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}
.timeline .meta strong { color: var(--text-light); font-weight: 500; text-transform: none; letter-spacing: 0; }
.timeline p { font-size: 0.9rem; }

/* ---------- ALERT / FLASH ---------- */
.flash {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.88rem;
    margin-bottom: 18px;
    border: 1px solid transparent;
}
.flash-success { background: rgba(34,197,94,0.1);  color: #4ade80; border-color: rgba(34,197,94,0.3); }
.flash-error   { background: rgba(239,68,68,0.1);  color: #f87171; border-color: rgba(239,68,68,0.3); }
.flash-info    { background: rgba(2,132,199,0.1);  color: #38bdf8; border-color: rgba(2,132,199,0.3); }

/* ---------- LOGIN ---------- */
.login-shell {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}
.login-card {
    width: 100%;
    max-width: 380px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 18px;
    padding: 40px 32px;
    backdrop-filter: blur(14px);
}
.login-card h1 {
    font-family: var(--font-primary);
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 4px;
}
.login-card p { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 24px; }
.login-card .form-group { margin-bottom: 14px; }
.login-card .btn { width: 100%; padding: 12px; margin-top: 8px; }

@media (max-width: 880px) {
    .crm-shell { flex-direction: column; }
    .crm-sidebar { width: 100%; height: auto; }
    .crm-main { padding: 24px 20px; }
}
