:root {
    --green-700: #138a36;
    --green-600: #16a34a;
    --green-500: #22c55e;
    --green-100: #dcfce7;
    --bg: #f4f8f4;
    --surface: #ffffff;
    --surface-soft: #f8fbf8;
    --text: #0f172a;
    --muted: #64748b;
    --border: #dbe7dd;
}

* { box-sizing: border-box; }

body {
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    margin: 0;
    background: radial-gradient(circle at top right, #e7fbe9 0%, var(--bg) 42%);
    color: var(--text);
}

.fadeInUp { animation: fadeInUp 420ms ease both; }
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

a { color: var(--green-700); text-decoration: none; }
a:hover { text-decoration: underline; }

.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 255px;
    background: linear-gradient(180deg, #f6fff8 0%, #ecfdf1 100%);
    padding: 22px 16px;
    border-right: 1px solid #d2ebd9;
    box-shadow: 4px 0 18px rgba(15, 23, 42, 0.08);
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
    z-index: 40;
}

.burger {
    width: auto;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #d8eadb;
    background: #ffffff;
    color: #0f172a;
    font-weight: 800;
    display: none;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}
.burger:hover { background: #f6fff8; }
.burger .lines { display: inline-grid; gap: 4px; }
.burger .lines span { width: 18px; height: 2px; background: #0f172a; border-radius: 999px; display:block; }

.sidebar h2 {
    color: #0f7a34;
    margin-top: 4px;
    margin-bottom: 8px;
    font-size: 20px;
}

.sidebar a {
    display: block;
    color: #175c32;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 7px;
    font-size: 14px;
    border: 1px solid transparent;
    transition: all 0.18s ease;
}

.sidebar a:hover,
.sidebar a.active {
    background: rgba(34, 197, 94, 0.16);
    color: #0f7a34;
    border-color: rgba(34, 197, 94, 0.28);
    text-decoration: none;
}

.main {
    flex: 1;
    padding: 26px;
}

.main h1 {
    margin: 0;
    font-size: 28px;
    letter-spacing: -0.4px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding: 14px 16px;
    border: 1px solid #d8eadb;
    border-radius: 14px;
    background: linear-gradient(135deg, #ffffff 0%, #eefcf1 100%);
    box-shadow: 0 8px 20px rgba(13, 67, 32, 0.06);
}

.admin-badge {
    background: #0f172a;
    color: #86efac;
    border: 1px solid #1f3a2b;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.card h3 {
    margin-top: 0;
    margin-bottom: 12px;
    color: #0b6d2f;
}

.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

.kpi {
    padding: 15px;
    border-radius: 12px;
    background: linear-gradient(140deg, #ffffff 0%, #ecfdf0 65%, #e4fbe9 100%);
    border: 1px solid #d6f1dc;
    position: relative;
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.kpi:hover { transform: translateY(-2px); box-shadow: 0 14px 26px rgba(15, 23, 42, 0.10); }

.kpi::after {
    content: "";
    position: absolute;
    right: -20px;
    top: -20px;
    width: 80px;
    height: 80px;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.12);
}

input, select, textarea, button {
    width: 100%;
    padding: 11px 12px;
    margin-top: 5px;
    margin-bottom: 10px;
    border-radius: 10px;
    border: 1px solid #cbdccf;
    background: #ffffff;
    color: #0f172a;
    font-size: 14px;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--green-500);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

button {
    background: linear-gradient(180deg, var(--green-600) 0%, #149a44 100%);
    border: none;
    color: #ffffff;
    cursor: pointer;
    font-weight: 700;
    letter-spacing: 0.2px;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 16px rgba(22, 163, 74, 0.22);
}

table { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; border-radius: 10px; overflow: hidden; }
th {
    background: #f0fdf4;
    color: #0f5132;
    font-weight: 700;
    border-bottom: 1px solid #d7ebda;
}
th, td { border-bottom: 1px solid #e8f0ea; padding: 10px; text-align: left; }
tr:hover td { background: #f9fcf9; }

.tableWrap {
    width: 100%;
    overflow-x: auto;
    border-radius: 10px;
}
.tableWrap table { min-width: 720px; }

.kanban { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }

.col {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px;
    min-height: 200px;
}

.col h4 {
    margin-top: 0;
    color: #0b6d2f;
}

.lead {
    background: #ffffff;
    border: 1px solid #d7e5da;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.muted { color: var(--muted); font-size: 12px; }
.row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.login-box {
    max-width: 500px;
    margin: 65px auto;
    background: #ffffff;
    border: 1px solid #dceada;
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.logo { height: 46px; margin-bottom: 8px; }

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    align-items: stretch;
}
.auth-left {
    padding: 44px 36px;
    background:
        radial-gradient(circle at 20% 20%, rgba(34,197,94,.20) 0%, transparent 50%),
        radial-gradient(circle at 80% 30%, rgba(34,197,94,.16) 0%, transparent 55%),
        radial-gradient(circle at 60% 80%, rgba(15,122,52,.10) 0%, transparent 55%),
        linear-gradient(180deg, #f6fff8 0%, #eefcf1 100%);
    border-right: 1px solid #d2ebd9;
}
.auth-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}
.auth-brand img { height: 44px; }
.auth-brand h1 { margin: 0; font-size: 22px; letter-spacing: -0.3px; }
.auth-hero {
    margin-top: 26px;
    max-width: 560px;
}
.auth-hero h2 { margin: 0 0 10px; font-size: 30px; letter-spacing: -0.6px; }
.auth-hero p { margin: 0 0 14px; color: #4b5563; }
.auth-bullets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.auth-pill {
    border: 1px solid #d6f1dc;
    background: rgba(255,255,255,.7);
    border-radius: 14px;
    padding: 12px;
}
.auth-right {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 18px;
}
.auth-card {
    width: 100%;
    max-width: 460px;
    background: #ffffff;
    border: 1px solid #dceada;
    border-radius: 18px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.12);
    padding: 22px;
}
.auth-card h3 { margin: 0 0 6px; color: #0b6d2f; }
.auth-card .muted { margin-bottom: 14px; }

.chips { display:flex; gap:8px; flex-wrap: wrap; }
.chipBtn {
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid #d7ebda;
    background: #ffffff;
    color: #14532d;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all .14s ease;
}
.chipBtn:hover { background:#f2fff4; border-color: rgba(34,197,94,.35); }
.chipBtn.active { background: rgba(34,197,94,.16); border-color: rgba(34,197,94,.38); color:#0f7a34; }

.sidebar .logo {
    height: 54px;
    background: transparent;
    border-radius: 10px;
    padding: 0;
}

.actions-cell { min-width: 280px; }
.actions-cell form { margin-top: 6px; }
.actions-cell select { width: auto; min-width: 140px; display: inline-block; }

.action-btn {
    display: inline-block;
    padding: 7px 10px;
    border: 1px solid #d4e7d8;
    border-radius: 8px;
    margin-right: 6px;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #14532d;
    background: #ffffff;
    text-decoration: none;
}

.action-btn:hover { background: #f2fff4; text-decoration: none; }
.action-btn.wa { border-color: #86efac; color: #166534; background: #f0fff4; }
.action-btn.mail { border-color: #bfdbfe; color: #1d4ed8; background: #f4f8ff; }

.danger-btn {
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%) !important;
    color: #fff !important;
    border: none !important;
}

.danger-btn:hover {
    box-shadow: 0 10px 16px rgba(220, 38, 38, 0.22) !important;
}

.pipeline {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.pipeline span {
    display: block;
    font-size: 12px;
    border: 1px dashed #7ad597;
    background: #f2fff4;
    color: #14532d;
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    font-weight: 600;
}

.svcGrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.svcCard {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px;
    border: 1px solid #e6efe8;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbf8 100%);
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.svcCard:hover { transform: translateY(-1px); box-shadow: 0 10px 16px rgba(13, 67, 32, 0.08); border-color: rgba(34, 197, 94, 0.35); }
.svcToggle {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    border: 2px solid #b9d8c4;
    margin-top: 2px;
    flex: 0 0 auto;
    position: relative;
    background: #ffffff;
}
.svcCard.isOn .svcToggle { border-color: #22c55e; background: rgba(34, 197, 94, 0.10); }
.svcCard.isOn .svcToggle::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 6px;
    height: 10px;
    border: solid #16a34a;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.svcMeta { min-width: 0; }
.svcTitle { font-weight: 800; color: #0f172a; }
.svcSub { color: #6b7280; font-size: 12px; margin-top: 2px; }

@media (max-width: 1200px) {
    .kanban { grid-template-columns: repeat(3, 1fr); }
    .grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
    .layout { flex-direction: column; }
    .burger { display: inline-flex; }
    .sidebar-overlay { display:block; }
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px;
        max-width: 88vw;
        z-index: 50;
        transform: translateX(-110%);
        transition: transform 220ms ease;
    }
    body.sidebar-open .sidebar { transform: translateX(0); }
    body.sidebar-open .sidebar-overlay { opacity: 1; pointer-events: auto; }
    .row { grid-template-columns: 1fr; }
    .kanban { grid-template-columns: repeat(2, 1fr); }
    .actions-cell { min-width: 240px; }
    .svcGrid { grid-template-columns: 1fr; }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-left { display:none; }
    .main { padding-top: 18px; }
}

@media (max-width: 640px) {
    .main { padding: 14px; }
    .grid, .kanban { grid-template-columns: 1fr; }
    .topbar { flex-direction: column; align-items: flex-start; gap: 10px; }
    .actions-cell { min-width: 220px; }
}
