:root {
    --bg: #f4efe8;
    --panel: rgba(255, 252, 247, 0.88);
    --ink: #1d2433;
    --muted: #766d61;
    --primary: #8c6a3e;
    --secondary: #324a76;
    --danger: #b24d3c;
    --border: rgba(111, 88, 58, 0.16);
    --shadow: 0 22px 60px rgba(39, 31, 22, 0.10);
    --panel-shadow: 0 18px 44px rgba(55, 41, 25, 0.08);
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "Georgia", "Times New Roman", serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(184, 142, 92, 0.16), transparent 34%),
        radial-gradient(circle at bottom right, rgba(84, 108, 150, 0.14), transparent 32%),
        linear-gradient(180deg, #f8f4ee 0%, #f1ebe2 45%, #ece5da 100%);
}
body,
input,
select,
textarea,
button {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 260px;
    padding: 28px 20px;
    background:
        radial-gradient(circle at top, rgba(214, 180, 126, 0.18), transparent 24%),
        linear-gradient(180deg, #171823, #232232 58%, #2b2b3a);
    color: #fff;
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid rgba(226, 214, 194, 0.08);
}
.brand { display: flex; align-items: center; gap: 14px; font-size: 1.6rem; font-weight: 700; margin-bottom: 24px; }
.brand small { display: block; margin-top: 4px; font-size: 0.78rem; font-weight: 500; color: #b8b0a7; line-height: 1.45; }
.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #d7b07b, #8c6a3e);
    color: #ffffff;
    box-shadow: 0 18px 32px rgba(146, 110, 61, 0.32);
    font-size: 1.2rem;
    font-weight: 800;
    flex-shrink: 0;
}
.sidebar nav { display: grid; gap: 10px; }
.sidebar a { color: #ece7dd; text-decoration: none; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); display: flex; align-items: center; gap: 12px; transition: background 0.18s ease, transform 0.18s ease, color 0.18s ease, box-shadow 0.18s ease; }
.sidebar a:hover { background: rgba(255, 255, 255, 0.08); transform: translateX(2px); box-shadow: inset 0 0 0 1px rgba(214, 180, 126, 0.08); }
.sidebar a.is-active { background: linear-gradient(135deg, rgba(215, 176, 123, 0.22), rgba(146, 110, 61, 0.18)); color: #ffffff; box-shadow: inset 0 0 0 1px rgba(255, 242, 225, 0.10), 0 12px 24px rgba(0, 0, 0, 0.16); }
.nav-icon { width: 38px; height: 38px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.08); color: currentColor; flex-shrink: 0; }
.nav-icon svg { width: 18px; height: 18px; }
.sidebar a.is-active .nav-icon { background: rgba(255, 248, 240, 0.14); }
.content { flex: 1; padding: 24px; background: transparent; min-height: 100vh; position: relative; z-index: 1; }
.content > * { position: relative; z-index: 1; }
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    background: linear-gradient(180deg, rgba(255, 252, 247, 0.92), rgba(255, 248, 240, 0.84));
    backdrop-filter: blur(14px);
    padding: 18px 22px;
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow);
    gap: 16px;
}
.topbar-company { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar-company-mark { width: 48px; height: 48px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #d7b07b, #8c6a3e); color: #fff; font-weight: 800; font-size: 1.1rem; box-shadow: 0 16px 28px rgba(140, 106, 62, 0.24); flex-shrink: 0; }
.topbar-company-copy { min-width: 0; display: grid; gap: 4px; }
.topbar-company-copy strong { font-size: 1.08rem; letter-spacing: 0.01em; }
.topbar-company-copy span { color: var(--muted); line-height: 1.45; }
.topbar-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.topbar-shortcut { display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; text-decoration: none; color: var(--ink); background: linear-gradient(135deg, rgba(255, 249, 241, 0.98), rgba(243, 234, 220, 0.96)); border: 1px solid rgba(165, 128, 82, 0.18); font-weight: 700; box-shadow: 0 10px 24px rgba(100, 76, 49, 0.08); }
.topbar-shortcut-icon { width: 34px; height: 34px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #f2dfc4, #ead0aa); color: #7c5a30; }
.topbar-shortcut-icon svg { width: 18px; height: 18px; }
.locale-switcher { display: flex; align-items: center; gap: 10px; background: rgba(255, 249, 241, 0.92); border: 1px solid rgba(165, 128, 82, 0.14); border-radius: 14px; padding: 8px 10px; width: auto; box-shadow: 0 10px 24px rgba(100, 76, 49, 0.05); }
.locale-label { font-size: 0.85rem; font-weight: 700; color: var(--muted); }
.locale-switcher select { width: auto; min-width: 72px; padding: 8px 12px; background: rgba(255, 255, 255, 0.92); border-radius: 12px; }
.live-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 999px;
    background: rgba(236, 245, 238, 0.95);
    border: 1px solid rgba(86, 119, 98, 0.14);
    color: #4f765f;
    font-size: 0.84rem;
    font-weight: 700;
}
.live-pill::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #5e9f74;
    box-shadow: 0 0 0 6px rgba(94, 159, 116, 0.14);
}
.live-pill.is-refreshing::before {
    animation: livePulse 0.9s ease;
}
@keyframes livePulse {
    0% { box-shadow: 0 0 0 0 rgba(94, 159, 116, 0.34); }
    100% { box-shadow: 0 0 0 12px rgba(94, 159, 116, 0); }
}
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.flow-panel { margin-bottom: 18px; }
.flow-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.flow-step {
    position: relative;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 18px;
    border-radius: 18px;
    text-decoration: none;
    color: var(--ink);
    background: linear-gradient(180deg, rgba(255, 252, 247, 0.86), rgba(248, 241, 232, 0.78));
    border: 1px solid rgba(111, 88, 58, 0.10);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.flow-step:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 30px rgba(90, 66, 38, 0.10);
    border-color: rgba(140, 106, 62, 0.20);
}
.flow-step-number {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(135deg, #d7b07b, #8c6a3e);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 12px 24px rgba(140, 106, 62, 0.20);
}
.flow-step-copy {
    display: grid;
    gap: 6px;
}
.flow-step-copy strong {
    font-size: 1rem;
}
.flow-step-copy span {
    color: var(--muted);
    line-height: 1.5;
}
.card, .panel {
    background: var(--panel);
    backdrop-filter: blur(14px);
    border-radius: 22px;
    padding: 22px;
    box-shadow: var(--panel-shadow);
    border: 1px solid var(--border);
}
.card .value { font-size: 2.15rem; font-weight: 700; margin-top: 10px; letter-spacing: -0.02em; }
.metric-card { position: relative; overflow: hidden; }
.metric-card::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,0.16), transparent 40%); pointer-events: none; }
.metric-card::after { content: ""; position: absolute; width: 130px; height: 130px; border-radius: 999px; top: -44px; right: -34px; background: var(--metric-glow, rgba(15, 157, 122, 0.12)); pointer-events: none; filter: blur(4px); }
.metric-head { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.metric-label { font-size: 1rem; font-weight: 700; color: var(--ink); letter-spacing: 0.01em; }
.metric-icon { width: 52px; height: 52px; border-radius: 18px; display: inline-flex; align-items: center; justify-content: center; background: var(--metric-bg, #eef4ff); color: var(--metric-ink, #1f5eff); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 14px 28px rgba(97, 74, 40, 0.12); }
.metric-icon svg { width: 24px; height: 24px; }
.metric-card .value,
.metric-card small { position: relative; z-index: 1; }
.metric-card small { display: block; color: var(--muted); line-height: 1.5; max-width: 28ch; }
.metric-contacts { --metric-bg: linear-gradient(135deg, #f7ecdf, #eed8b8); --metric-ink: #815c31; --metric-glow: rgba(163, 122, 66, 0.16); }
.metric-campaigns { --metric-bg: linear-gradient(135deg, #ede7f7, #d8d0ef); --metric-ink: #5b4b89; --metric-glow: rgba(91, 75, 137, 0.14); }
.metric-queued { --metric-bg: linear-gradient(135deg, #fbf0d8, #f2deb0); --metric-ink: #8b6700; --metric-glow: rgba(139, 103, 0, 0.15); }
.metric-sent { --metric-bg: linear-gradient(135deg, #e8edf6, #d9e1ee); --metric-ink: #425c86; --metric-glow: rgba(66, 92, 134, 0.14); }
.metric-delivered { --metric-bg: linear-gradient(135deg, #e3f2eb, #cfe6db); --metric-ink: #4f7b67; --metric-glow: rgba(79, 123, 103, 0.14); }
.metric-lists { --metric-bg: linear-gradient(135deg, #efe7e3, #e6d7d0); --metric-ink: #8a5f53; --metric-glow: rgba(138, 95, 83, 0.14); }
.metric-imports { --metric-bg: linear-gradient(135deg, #edf4ef, #dfe9e1); --metric-ink: #58725d; --metric-glow: rgba(88, 114, 93, 0.14); }
.metric-templates { --metric-bg: linear-gradient(135deg, #f8ece4, #efd8cb); --metric-ink: #9b6140; --metric-glow: rgba(155, 97, 64, 0.15); }
.metric-approved { --metric-bg: linear-gradient(135deg, #e4f0e8, #d2e3d9); --metric-ink: #567762; --metric-glow: rgba(86, 119, 98, 0.14); }
.metric-pending { --metric-bg: linear-gradient(135deg, #f7eedb, #ecddba); --metric-ink: #8a6932; --metric-glow: rgba(138, 105, 50, 0.14); }
.metric-rejected { --metric-bg: linear-gradient(135deg, #f7e7e3, #eed2cb); --metric-ink: #9d584c; --metric-glow: rgba(157, 88, 76, 0.14); }
.metric-failed { --metric-bg: linear-gradient(135deg, #f7e7e3, #eed2cb); --metric-ink: #9d584c; --metric-glow: rgba(157, 88, 76, 0.14); }
.metric-replies { --metric-bg: linear-gradient(135deg, #e8edf4, #d8e0ea); --metric-ink: #52637f; --metric-glow: rgba(82, 99, 127, 0.14); }
.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; margin-top: 18px; }
.table-wrap {
    overflow: auto;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 253, 250, 0.78), rgba(250, 244, 236, 0.70));
    border: 1px solid rgba(111, 88, 58, 0.08);
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 12px; border-bottom: 1px solid rgba(111, 88, 58, 0.10); text-align: left; vertical-align: top; }
th { font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: #84715a; font-weight: 700; background: rgba(122, 96, 61, 0.04); }
td { color: #2d3545; }
tbody tr { transition: background 0.18s ease; }
tbody tr:hover { background: rgba(164, 130, 86, 0.06); }
form.inline, .actions { display: flex; gap: 10px; flex-wrap: wrap; }
input, select, textarea, button { width: 100%; padding: 11px 12px; border-radius: 14px; border: 1px solid rgba(111, 88, 58, 0.14); font: inherit; background: rgba(255, 252, 247, 0.96); color: var(--ink); transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, transform 0.18s ease; }
input::placeholder, textarea::placeholder { color: #9a8f80; }
.password-field { position: relative; }
.password-field input { padding-right: 96px; }
.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: auto;
    min-width: 74px;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid rgba(111, 88, 58, 0.14);
    background: rgba(255, 249, 241, 0.96);
    color: #7c5a30;
    box-shadow: none;
}
.password-toggle:hover { transform: translateY(-50%); box-shadow: 0 10px 20px rgba(140, 106, 62, 0.12); }
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(140, 106, 62, 0.38);
    box-shadow: 0 0 0 4px rgba(184, 142, 92, 0.12);
    background: rgba(255, 253, 249, 0.98);
}
button, .btn { display: inline-block; width: auto; text-decoration: none; cursor: pointer; background: linear-gradient(135deg, var(--primary), #b88e5c); color: #fff; border: none; padding: 11px 14px; box-shadow: 0 14px 28px rgba(140, 106, 62, 0.18); font-weight: 700; letter-spacing: 0.01em; }
button:hover, .btn:hover { transform: translateY(-1px); box-shadow: 0 18px 32px rgba(140, 106, 62, 0.22); }
.btn-secondary { background: linear-gradient(135deg, var(--secondary), #576c95); }
.btn-danger { background: linear-gradient(135deg, var(--danger), #c97162); }
.alert { padding: 14px 16px; border-radius: 14px; margin-bottom: 16px; }
.alert-success { background: #ebf3ee; color: #476d59; border: 1px solid rgba(86, 119, 98, 0.16); }
.alert-error { background: #f8ece8; color: #9a4d41; border: 1px solid rgba(157, 88, 76, 0.16); }
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 16px; }
.page-head h1,
.page-head h2 { margin: 0; font-weight: 700; letter-spacing: -0.02em; font-family: "Georgia", "Times New Roman", serif; }
.page-head h1 { font-size: clamp(1.8rem, 2.2vw, 2.35rem); }
.page-head h2 { font-size: clamp(1.15rem, 1.5vw, 1.45rem); }
.page-head p { margin: 6px 0 0; color: var(--muted); line-height: 1.5; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 86px; padding: 6px 10px; border-radius: 999px; font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.badge-draft { background: #f0ebe3; color: #7a6c5c; }
.badge-pending { background: #f7ecd4; color: #8b6700; }
.badge-approved { background: #e6f1ea; color: #4f765f; }
.badge-rejected { background: #f7e7e3; color: #9c5548; }
.filters-bar { display: grid; grid-template-columns: minmax(240px, 1.6fr) repeat(2, minmax(180px, 1fr)) auto; gap: 14px; align-items: end; }
.filters-field { display: grid; gap: 8px; }
.filters-field-wide { min-width: 0; }
.filters-field label { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: #8a7458; }
.form-label { display: block; margin: 10px 0 6px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: #8a7458; }
.filters-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.empty-state { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 10px 4px; }
.empty-state h2 { margin: 0 0 6px; }
.empty-state p { margin: 0; color: var(--muted); line-height: 1.55; max-width: 58ch; }
.table-title-cell { display: grid; gap: 6px; min-width: 180px; }
.table-title-cell strong { font-size: 0.98rem; }
.table-title-cell span { color: var(--muted); line-height: 1.45; }
.table-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.table-action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 11px;
    border-radius: 999px;
    text-decoration: none;
    color: #5d4830;
    background: rgba(247, 239, 227, 0.96);
    border: 1px solid rgba(124, 90, 48, 0.12);
    font-size: 0.84rem;
    font-weight: 700;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.table-action-link:hover {
    transform: translateY(-1px);
    background: #f1e5d3;
    box-shadow: 0 10px 20px rgba(140, 106, 62, 0.10);
}
.table-action-button {
    width: auto;
    padding: 7px 11px;
    border-radius: 999px;
    border: 1px solid rgba(124, 90, 48, 0.12);
    background: rgba(247, 239, 227, 0.96);
    color: #5d4830;
    box-shadow: none;
    font-size: 0.84rem;
    line-height: 1.1;
}
.table-action-button:hover {
    transform: translateY(-1px);
    background: #f1e5d3;
    box-shadow: 0 10px 20px rgba(140, 106, 62, 0.10);
}
.table-action-danger {
    color: #9a4d41;
    background: rgba(248, 236, 232, 0.95);
    border-color: rgba(157, 88, 76, 0.16);
}
.table-action-danger:hover {
    background: #f4ddd8;
}
.table-note {
    margin-top: 8px;
    font-size: 0.84rem;
    line-height: 1.45;
}
.text-danger-soft {
    color: #9a4d41;
}
.variable-picker { display: grid; gap: 10px; margin-top: 6px; }
.variable-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.variable-chip { width: auto; padding: 8px 12px; border-radius: 999px; border: 1px solid rgba(124, 90, 48, 0.18); background: #f7efe3; color: #7c5a30; cursor: pointer; font-weight: 600; }
.variable-chip:hover { background: #f0e2cf; }
.variable-help { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 0.88rem; line-height: 1.45; }
.variable-help span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: rgba(255, 250, 244, 0.82); border: 1px solid rgba(111, 88, 58, 0.10); }
.variable-help code { font-size: 0.84rem; }
.wa-preview { display: flex; justify-content: flex-end; margin-bottom: 20px; padding: 18px; background: linear-gradient(180deg, #ece2d8, #dbe8de); border-radius: 24px; }
.wa-bubble { width: min(100%, 420px); background: #efe5d6; border-radius: 18px 18px 4px 18px; padding: 12px; box-shadow: 0 10px 28px rgba(58, 43, 23, 0.10); }
.wa-media { width: 100%; border-radius: 14px; margin-bottom: 10px; background: #fff; border: 1px solid rgba(0, 0, 0, 0.06); }
.wa-media-image { display: block; max-height: 280px; object-fit: cover; }
.wa-media-video { display: block; max-height: 280px; }
.wa-media-document { padding: 14px; display: grid; gap: 6px; }
.wa-media-document a { color: #0f6cbf; text-decoration: none; word-break: break-all; }
.wa-text { line-height: 1.5; color: #3b3022; white-space: normal; word-break: break-word; }
.modal-backdrop[hidden] { display: none !important; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(14, 23, 40, 0.58); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 30; }
.modal-card { width: min(100%, 720px); max-height: 90vh; overflow: auto; background: rgba(255, 251, 245, 0.96); border-radius: 24px; padding: 24px; box-shadow: 0 24px 70px rgba(35, 27, 18, 0.24); border: 1px solid rgba(111, 88, 58, 0.14); }
.modal-card .wa-preview { margin-bottom: 0; }
.stats { display: grid; gap: 10px; padding: 0; }
.stats li { list-style: none; background: rgba(255, 250, 244, 0.88); padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(111, 88, 58, 0.10); }
.panel h2,
.card h2 {
    font-family: "Georgia", "Times New Roman", serif;
    letter-spacing: -0.01em;
}
.panel > h2,
.panel .page-head {
    position: relative;
}
.panel > h2::after {
    content: "";
    display: block;
    width: 54px;
    height: 2px;
    margin-top: 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, #d7b07b, rgba(215, 176, 123, 0));
}
.sidebar, .topbar, .card, .panel { opacity: 1; filter: none; }
@media (max-width: 960px) { .layout { flex-direction: column; } .sidebar { width: 100%; height: auto; position: relative; } .grid-2 { grid-template-columns: 1fr; } .topbar { flex-direction: column; align-items: stretch; } .topbar-tools { justify-content: flex-start; } .filters-bar { grid-template-columns: 1fr; } .filters-actions { justify-content: flex-start; } .empty-state { flex-direction: column; align-items: flex-start; } }
