@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #07030d;
  --bg-soft: #130822;
  --panel: rgba(25, 10, 43, .90);
  --panel-strong: #190a2b;
  --line: rgba(139, 92, 246, .20);
  --line-strong: rgba(139, 92, 246, .52);
  --text: #fbf8ff;
  --muted: rgba(239, 232, 255, .70);
  --orange: #7c3aed;
  --gold: #a78bfa;
  --red: #5b21b6;
  --red-dark: #1e0b3b;
  --ok: #42d795;
  --err: #c779ff;
  --radius: 18px;
  --shadow: 0 20px 60px rgba(0, 0, 0, .34);
  --font: "Outfit", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--text);
  font-family: var(--font);
  background:
    linear-gradient(rgba(7, 3, 13, .92), rgba(7, 3, 13, .96)),
    url("bg-main.jpg") center / cover fixed,
    #07030d;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background: radial-gradient(circle at 80% 5%, rgba(124, 58, 237, .18), transparent 28%),
              radial-gradient(circle at 18% 95%, rgba(76, 29, 149, .24), transparent 34%);
}
a { color: #c4b5fd; text-decoration: none; }
a:hover { color: #fff; }
code, .mono { font-family: ui-monospace, Consolas, monospace; color: #ddd6fe; }
.muted { color: var(--muted); }

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 278px; height: 100vh; flex: 0 0 278px; position: sticky; top: 0; z-index: 30;
  display: flex; flex-direction: column; padding: 1.2rem .95rem 1rem;
  background: linear-gradient(180deg, rgba(28, 9, 49, .98), rgba(6, 2, 11, .99));
  border-right: 1px solid var(--line); box-shadow: 18px 0 60px rgba(0,0,0,.28);
}
.brand { display: flex; align-items: center; gap: .8rem; padding: .3rem .45rem 1.15rem; border-bottom: 1px solid var(--line); }
.brand-logo { width: 48px; height: 48px; object-fit: contain; border-radius: 13px; box-shadow: 0 10px 30px rgba(124,58,237,.16); }
.brand strong { display: block; font-size: 1.08rem; letter-spacing: .01em; }
.brand small { display: block; color: var(--muted); margin-top: .08rem; font-size: .77rem; }
.sidebar-close { display: none; margin-left: auto; width: 36px; height: 36px; padding: 0; font-size: 1.5rem; }
.nav-label { color: rgba(239,232,255,.42); font-size: .67rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; padding: 1.1rem .8rem .45rem; }
.sidebar nav { display: flex; flex: 1; flex-direction: column; gap: .24rem; overflow-y: auto; scrollbar-width: thin; }
.sidebar nav a {
  display: flex; align-items: center; gap: .72rem; min-height: 44px; padding: .65rem .75rem;
  border-radius: 13px; color: var(--muted); font-size: .91rem; font-weight: 600;
  border: 1px solid transparent; transition: .16s ease;
}
.sidebar nav a:hover { color: #fff; background: rgba(124,58,237,.10); border-color: var(--line); transform: translateX(2px); }
.sidebar nav a.active { color: #fff; background: linear-gradient(110deg, rgba(91,33,182,.78), rgba(24,10,48,.92)); border-color: rgba(167,139,250,.42); box-shadow: 0 10px 26px rgba(76,29,149,.30); }
.nav-icon { width: 20px; height: 20px; display: grid; place-items: center; flex: 0 0 20px; color: #c4b5fd; }
.nav-icon svg, .menu-btn svg { width: 100%; height: 100%; fill: currentColor; }
.sidebar nav a.active .nav-icon { color: var(--gold); }
.sidebar nav a.nav-exit { margin-top: auto; color: #d8a4ff; }
.sidebar-foot { border-top: 1px solid var(--line); padding: .85rem .7rem .05rem; color: var(--muted); font-size: .75rem; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: .4rem; background: var(--ok); box-shadow: 0 0 14px rgba(66,215,149,.8); }

.main { flex: 1; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20; min-height: 76px; padding: .85rem 1.6rem;
  display: flex; align-items: center; gap: .85rem;
  background: linear-gradient(90deg, rgba(18,8,34,.92), rgba(5,3,12,.78));
  backdrop-filter: blur(16px); border-bottom: 1px solid var(--line);
}
.topbar h1 { margin: 0; font-size: 1.35rem; line-height: 1.1; }
.eyebrow { display: block; color: #c77dff; font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; margin-bottom: .18rem; }
.topbar-status { margin-left: auto; color: var(--muted); font-size: .82rem; padding: .44rem .65rem; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.03); }
.menu-btn { display: none; width: 43px; height: 43px; padding: 11px; color: var(--gold); }
.sidebar-backdrop { display: none; }
.page { padding: 1.4rem 1.6rem 3rem; max-width: 1600px; margin: 0 auto; }

.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.15rem; }
.card, .panel {
  background: linear-gradient(150deg, rgba(28,16,52,.92), rgba(5,4,12,.96));
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.card { padding: 1.15rem 1.2rem; position: relative; overflow: hidden; }
.card::after { content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 3px; background: linear-gradient(90deg, var(--orange), var(--red), transparent 75%); }
.card h3 { margin: 0; color: var(--muted); font-size: .74rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.card strong { display: block; margin-top: .5rem; font-size: 1.85rem; font-weight: 800; }
.card .hint { color: var(--muted); font-size: .83rem; margin-top: .3rem; }
.panel { padding: 1.25rem 1.3rem; margin-bottom: 1.1rem; }
.panel h2 { margin: 0 0 1rem; font-size: 1.1rem; }
.panel p.lead { color: var(--muted); margin: -.35rem 0 1rem; max-width: 760px; line-height: 1.55; }
.panel-hero { overflow: hidden; position: relative; padding: 1.55rem 1.5rem; }
.panel-hero::after { content: ""; position: absolute; width: 260px; height: 260px; right: -80px; top: -130px; border: 1px solid rgba(167,139,250,.18); border-radius: 50%; box-shadow: 0 0 70px rgba(124,58,237,.12); }
.panel-hero h2 { font-size: 1.4rem; margin: .2rem 0 .45rem; }
.section-kicker { color: #c77dff; font-size: .67rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.panel-heading h2 { margin: .2rem 0 0; }
.count-pill { color: var(--muted); white-space: nowrap; font-size: .78rem; padding: .35rem .6rem; border: 1px solid var(--line); background: rgba(255,255,255,.035); border-radius: 999px; }

.grid-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .95rem 1.05rem; }
.grid-form .full { grid-column: 1 / -1; }
.grid-form .actions { display: flex; gap: .65rem; align-items: end; flex-wrap: wrap; }
label { display: grid; gap: .38rem; color: var(--muted); font-size: .85rem; font-weight: 600; }
.label-hint { display: inline; color: rgba(255,239,224,.38); font-size: .72rem; font-weight: 500; }
input, select, textarea, button, .btn {
  min-width: 0; font: inherit; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(5,3,12,.82); color: var(--text); padding: .72rem .82rem;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(124, 58, 237, .16); }
input::placeholder, textarea::placeholder { color: rgba(255,239,224,.28); }
textarea { resize: vertical; min-height: 90px; }
button, .btn {
  display: inline-flex; justify-content: center; align-items: center; border: 0; cursor: pointer;
  color: #160724; font-weight: 800; background: linear-gradient(135deg, var(--gold), var(--orange));
  box-shadow: 0 9px 24px rgba(124,58,237,.22); transition: transform .12s ease, filter .12s ease;
}
button:hover, .btn:hover { filter: brightness(1.07); transform: translateY(-1px); }
button.secondary, .btn.secondary, button.ghost, .btn.ghost { color: #fff; background: transparent; border: 1px solid var(--line-strong); box-shadow: none; }
button.ok, .btn.ok { color: #042617; background: linear-gradient(135deg, #72f0b2, #38c883); box-shadow: none; }
button.danger, .btn.danger { color: #fff; background: linear-gradient(135deg, #df3743, #81101a); }
.inline-form, .inline { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.inline { margin-bottom: .9rem; }
.inline input[type="search"] { flex: 1; min-width: 190px; }
button.link { padding: 0; color: #d49cff; background: none; border: 0; box-shadow: none; font-size: .82rem; font-weight: 700; }
button.link.danger { color: #ff8c94; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: rgba(0,0,0,.16); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: .82rem .78rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { color: var(--muted); background: rgba(124,58,237,.08); font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: rgba(124,58,237,.045); }
.row-actions { display: flex; gap: .7rem; align-items: center; white-space: nowrap; }
.row-actions form { margin: 0; }
.server-cell { max-width: 280px; word-break: break-all; }
.empty-state { padding: 2.3rem 1rem; text-align: center; color: var(--muted); }
.badge { display: inline-flex; padding: .22rem .62rem; border-radius: 999px; font-size: .72rem; font-weight: 800; background: rgba(255,255,255,.08); }
.badge.active { color: #83ffc5; background: rgba(66,215,149,.14); }
.badge.pending { color: #ffd783; background: rgba(255,183,64,.15); }
.badge.blocked, .badge.inactive { color: #ffadb3; background: rgba(255,112,120,.14); }

.alert { padding: .85rem 1rem; margin-bottom: 1rem; border-radius: 13px; border: 1px solid var(--line); }
.alert.ok { color: #b6ffda; background: rgba(66,215,149,.12); border-color: rgba(66,215,149,.3); }
.alert.error { color: #ffc0c4; background: rgba(255,112,120,.12); border-color: rgba(255,112,120,.32); }
.info-box { padding: .95rem 1.05rem; margin-bottom: 1rem; color: var(--muted); background: rgba(255,152,16,.07); border: 1px solid var(--line); border-radius: 14px; }
.info-box strong { color: #fff; }
.info-box code { display: none; }
label.check { display: flex; align-items: center; flex-direction: row; gap: .55rem; }
label.check input { width: auto; }

.auth-body {
  min-height: 100vh; display: grid; place-items: center; padding: 1.2rem;
  background: linear-gradient(90deg, rgba(5,3,12,.90), rgba(24,10,48,.78)), url("bg-main.jpg") center / cover fixed, #05030c;
}
.auth-card {
  width: min(450px, 100%); padding: 1.75rem; border-radius: 24px;
  background: linear-gradient(155deg, rgba(28,16,52,.96), rgba(5,3,12,.98));
  border: 1px solid var(--line-strong); box-shadow: 0 28px 90px rgba(0,0,0,.55), 0 0 60px rgba(76,29,149,.16); backdrop-filter: blur(18px);
}
.auth-brand { display: flex; align-items: center; gap: .85rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
.auth-brand img { width: 60px; height: 60px; border-radius: 16px; }
.auth-brand h1 { margin: 0; font-size: 1.25rem; }
.auth-brand p { margin: .1rem 0 0; color: var(--muted); font-size: .8rem; }
.auth-copy { padding: 1.35rem 0 1rem; }
.auth-copy h2 { margin: .55rem 0 .3rem; font-size: 1.5rem; }
.auth-copy p { margin: 0; color: var(--muted); line-height: 1.5; }
.auth-badge { display: inline-flex; padding: .28rem .58rem; border-radius: 999px; color: #e7c0ff; background: rgba(124,58,237,.12); border: 1px solid var(--line); font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.auth-card form { display: grid; gap: .9rem; }
.auth-card button { width: 100%; padding: .88rem; margin-top: .2rem; }
.auth-foot { margin-top: 1.25rem; padding-top: 1rem; text-align: center; border-top: 1px solid var(--line); color: var(--muted); font-size: .76rem; }

.brand-editor { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 1.1rem; align-items: start; }
.brand-form-panel, .preview-panel { margin-bottom: 0; }
.preview-panel { position: sticky; top: 94px; }
.preview-live { color: var(--muted); font-size: .75rem; }
.upload-field input[type="file"] { padding: .52rem; }
.upload-field input[type="file"]::file-selector-button { border: 0; border-radius: 9px; margin-right: .7rem; padding: .48rem .68rem; font: inherit; font-weight: 700; color: #160724; background: linear-gradient(135deg, var(--gold), var(--orange)); cursor: pointer; }
.app-preview { min-height: 430px; display: grid; place-items: center; padding: 2rem 1.2rem; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 18px; background: linear-gradient(rgba(5,3,12,.40),rgba(24,10,48,.76)), url("bg-main.jpg") center / cover; }
.app-preview-content { width: min(260px, 100%); display: grid; justify-items: center; gap: .72rem; }
.preview-logo-box { width: 72px; height: 72px; display: grid; place-items: center; overflow: hidden; border-radius: 17px; background: rgba(255,255,255,.96); box-shadow: 0 16px 40px rgba(0,0,0,.32); }
.preview-logo-box img { width: 100%; height: 100%; object-fit: contain; }
.app-preview-content > strong { font-size: 1.1rem; margin-bottom: .25rem; text-shadow: 0 2px 10px #000; }
.preview-field { width: 100%; padding: .68rem .8rem; border-radius: 10px; color: rgba(255,255,255,.72); background: rgba(8,5,20,.82); border: 1px solid rgba(255,255,255,.12); font-size: .78rem; }
.preview-button { width: 100%; padding: .7rem; border-radius: 10px; text-align: center; color: #160724; background: linear-gradient(135deg,var(--gold),var(--orange)); font-size: .8rem; font-weight: 800; }
.app-preview-content small { color: rgba(255,255,255,.7); font-size: .68rem; }
.preview-note { margin: .8rem .15rem 0; color: var(--muted); font-size: .72rem; line-height: 1.45; }

@media (max-width: 1100px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-105%); transition: transform .22s ease; width: min(300px, 86vw); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close, .menu-btn { display: inline-flex; }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 25; padding: 0; border-radius: 0; background: rgba(0,0,0,.62); box-shadow: none; opacity: 0; pointer-events: none; display: block; transition: opacity .2s ease; }
  body.menu-open { overflow: hidden; }
  body.menu-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  .topbar { min-height: 70px; padding: .75rem 1rem; }
  .topbar-status { display: none; }
  .page { padding: 1rem 1rem 2rem; }
  .grid-form { grid-template-columns: 1fr; }
  .grid-form .full { grid-column: auto; }
  .brand-editor { grid-template-columns: 1fr; }
  .preview-panel { position: static; }
}
@media (max-width: 620px) {
  .cards { grid-template-columns: 1fr; }
  .card, .panel { border-radius: 15px; }
  .panel { padding: 1rem; }
  .topbar h1 { font-size: 1.15rem; }
  .panel-heading { align-items: flex-start; }
  .table-wrap { border: 0; overflow: visible; background: transparent; }
  table, tbody, tr, td { display: block; width: 100%; }
  thead { display: none; }
  tr { margin-bottom: .75rem; padding: .45rem .75rem; border: 1px solid var(--line); border-radius: 13px; background: rgba(0,0,0,.18); }
  td { display: grid; grid-template-columns: minmax(88px, .38fr) minmax(0, .62fr); gap: .55rem; padding: .53rem .2rem; border-bottom: 1px solid var(--line); word-break: break-word; }
  td::before { content: attr(data-label); color: var(--muted); font-size: .7rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
  td:last-child { border-bottom: 0; }
  td.row-actions { display: flex; flex-wrap: wrap; padding-top: .7rem; }
  td.row-actions::before { width: 100%; }
  .empty-state { display: block; }
  .empty-state::before { display: none; }
  .auth-card { padding: 1.25rem; border-radius: 20px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }

/* ===== Tema Roxo + Preto (2026-08-26) ===== */
:root {
  --bg: #07030d;
  --bg-soft: #130822;
  --panel: rgba(25, 10, 43, .90);
  --panel-strong: #190a2b;
  --line: rgba(181, 105, 255, .20);
  --line-strong: rgba(190, 115, 255, .48);
  --text: #fbf8ff;
  --muted: rgba(235, 222, 255, .70);
  --orange: #7c3aed;
  --gold: #a78bfa;
  --red: #5b21b6;
  --red-dark: #1e0b3b;
}
body {
  background:
    radial-gradient(circle at 82% 7%, rgba(151, 49, 255, .24), transparent 30%),
    radial-gradient(circle at 12% 92%, rgba(88, 28, 168, .28), transparent 36%),
    linear-gradient(145deg, #050208 0%, #11061d 48%, #24083e 100%);
}
body::before { background: radial-gradient(circle at 78% 4%, rgba(185, 93, 255, .18), transparent 28%), radial-gradient(circle at 18% 95%, rgba(100, 35, 190, .22), transparent 34%); }
a { color: #d9a7ff; }
code, .mono { color: #e8c8ff; }
.sidebar { background: linear-gradient(180deg, rgba(28, 9, 49, .99), rgba(6, 2, 11, .99)); }
.brand-logo { box-shadow: 0 10px 30px rgba(155,61,255,.22); }
.sidebar nav a:hover { background: rgba(155,61,255,.11); }
.sidebar nav a.active { background: linear-gradient(110deg, rgba(139,45,235,.88), rgba(74,18,130,.90)); border-color: rgba(206,139,255,.35); box-shadow: 0 10px 28px rgba(105,30,185,.30); }
.nav-icon, .menu-btn { color: #c982ff; }
.sidebar nav a.active .nav-icon { color: #efcaff; }
.topbar { background: linear-gradient(90deg, rgba(25,7,43,.94), rgba(7,2,13,.82)); }
.eyebrow, .section-kicker { color: #c77dff; }
.card, .panel { background: linear-gradient(150deg, rgba(35,13,60,.93), rgba(12,4,21,.96)); }
.card::after { background: linear-gradient(90deg, #d28cff, #8f35f2, transparent 75%); }
.panel-hero::after { border-color: rgba(202,132,255,.22); box-shadow: 0 0 70px rgba(146,55,232,.13); }
input, select, textarea, button, .btn { background-color: rgba(10,3,18,.80); }
input:focus, select:focus, textarea:focus { border-color: #b45cff; box-shadow: 0 0 0 3px rgba(166,73,255,.16); }
button, .btn { color: #fff; background: linear-gradient(135deg, #c66cff, #7624db); box-shadow: 0 9px 24px rgba(132,43,221,.24); }
button.secondary, .btn.secondary, button.ghost, .btn.ghost { background: rgba(103,35,171,.08); }
button.link { color: #d49cff; }
th { background: rgba(145,55,225,.09); }
tr:hover td { background: rgba(145,55,225,.045); }
.info-box { background: rgba(137,49,219,.09); }
.auth-body {
  background:
    radial-gradient(circle at 18% 20%, rgba(174,72,255,.28), transparent 28%),
    radial-gradient(circle at 84% 82%, rgba(96,27,174,.30), transparent 32%),
    linear-gradient(135deg, #030106 0%, #10051b 42%, #2a0848 100%);
}
.auth-card {
  background: linear-gradient(155deg, rgba(47,16,78,.94), rgba(8,3,14,.98));
  border-color: rgba(194,119,255,.42);
  box-shadow: 0 28px 90px rgba(0,0,0,.62), 0 0 70px rgba(151,52,238,.20);
}
.auth-brand img { box-shadow: 0 0 28px rgba(177,76,255,.28); }
.auth-badge { color: #e7c0ff; background: rgba(153,61,232,.14); border-color: rgba(195,121,255,.28); }

/* Compact professional inline editing */
.mini-edit{display:inline-block;position:relative}.mini-edit>summary,.mini-edit-label{cursor:pointer;font-size:.78rem;font-weight:700;padding:.32rem .55rem;border:1px solid rgba(168,85,247,.45);border-radius:7px;color:#d8b4fe;background:rgba(88,28,135,.18);list-style:none}.mini-edit>summary::-webkit-details-marker{display:none}.mini-edit-form{position:absolute;z-index:30;right:0;top:calc(100% + 6px);min-width:290px;padding:10px;display:grid;gap:8px;background:#120d19;border:1px solid rgba(168,85,247,.45);border-radius:10px;box-shadow:0 14px 35px rgba(0,0,0,.45)}.mini-edit-form input{min-width:0}

/* Correção de legibilidade para opções de select */
select option {
  background-color: #0a0312;
  color: #fbf8ff;
}
select option:checked {
  background-color: #5b21b6;
  color: #ffffff;
}


/* ===== Painel responsivo para celular e PC ===== */
html, body { max-width: 100%; overflow-x: hidden; }
@media (max-width: 860px) {
  .app-shell, .main, .page { width: 100%; min-width: 0; }
  .sidebar { width: min(320px, calc(100vw - 24px)); max-width: calc(100vw - 24px); height: 100dvh; overflow-y: auto; overscroll-behavior: contain; }
  .sidebar nav a { min-height: 46px; }
  .page { overflow: visible; }
}
@media (max-width: 620px) {
  .topbar { width: 100%; gap: .6rem; }
  .topbar > div:nth-child(2) { min-width: 0; flex: 1; }
  .topbar h1 { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .panel-heading, .clients-mac-summary, .clients-actions, .row-actions { flex-wrap: wrap; }
  .clients-mac-summary { min-width: 0; }
  .clients-actions { width: 100%; margin-left: 0; }
  .table-wrap { width: 100%; max-width: 100%; }
  .mini-edit { position: static; }
  .mini-edit-form { position: fixed; left: 12px; right: 12px; top: calc(70px + env(safe-area-inset-top)); width: auto; min-width: 0; max-height: calc(100dvh - 90px); overflow-y: auto; z-index: 100; }
  .mini-edit-form input, .mini-edit-form select, .mini-edit-form textarea, .mini-edit-form button { width: 100%; max-width: 100%; }
  .client-account-details, .client-account-body { max-width: 100%; overflow: visible; }
  form, input, select, textarea, button, .btn { max-width: 100%; }
}
