/* ===== Tokens ===== */
:root {
  --blue: #2563EB; --blue-dark: #1D4ED8; --cyan: #06B6D4;
  --ink: #0F172A; --slate: #475569; --slate-light: #64748B;
  --bg: #F1F5F9; --card: #FFFFFF; --line: #E2E8F0;
  --grad: linear-gradient(135deg, var(--blue), var(--cyan));
  --shadow-sm: 0 1px 3px rgba(15,23,42,.08);
  --shadow: 0 12px 32px rgba(15,23,42,.10);
  --radius: 14px;
  /* status */
  --s-novo: #2563EB; --s-analise: #D97706; --s-orcado: #7C3AED;
  --s-fechado: #16A34A; --s-cancelado: #64748B;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
h1,h2,h3 { font-family: 'Plus Jakarta Sans', sans-serif; letter-spacing: -.02em; }
a { color: inherit; }
input, select, textarea, button { font: inherit; }

/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 12px 20px; border-radius: 10px; font-weight: 700; font-size: .95rem; cursor: pointer; border: 1.5px solid transparent; transition: transform .12s, box-shadow .2s, background .2s, border-color .2s; }
.btn--primary { background: var(--grad); color: #fff; box-shadow: 0 6px 16px rgba(37,99,235,.3); }
.btn--primary:hover { transform: translateY(-1px); }
.btn--ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--blue); color: var(--blue); }
.btn--block { width: 100%; }
.btn--sm { padding: 8px 14px; font-size: .88rem; border-radius: 8px; }
.btn:disabled { opacity: .6; cursor: default; }

/* ===== Login ===== */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(60% 60% at 80% 0%, rgba(6,182,212,.16), transparent 60%),
              radial-gradient(50% 50% at 0% 100%, rgba(37,99,235,.16), transparent 60%), var(--bg); }
.login__card { width: min(400px, 100%); background: var(--card); border-radius: 20px; padding: 36px 32px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.login__logo { height: 40px; align-self: flex-start; margin-bottom: 20px; }
.login__card h1 { font-size: 1.4rem; font-weight: 800; }
.login__sub { color: var(--slate); font-size: .95rem; margin: 6px 0 18px; }
.login__card label { font-weight: 600; font-size: .9rem; margin: 12px 0 6px; }
.login__card input { padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; }
.login__card input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(37,99,235,.12); }
.login__card .btn { margin-top: 18px; }
.login__error { color: #DC2626; font-size: .88rem; margin-top: 12px; }
.login__back { margin-top: 18px; text-align: center; color: var(--slate); font-size: .9rem; text-decoration: none; }
.login__back:hover { color: var(--blue); }
.demo-banner { background: #FEF9C3; border: 1px solid #FDE68A; color: #854D0E; border-radius: 10px; padding: 10px 12px; font-size: .85rem; margin-bottom: 6px; }

/* ===== Topbar ===== */
.topbar { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 12px 24px; }
.topbar__brand { display: flex; align-items: center; gap: 12px; }
.topbar__brand img { height: 34px; }
.topbar__tag { font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #FEF9C3; color: #854D0E; }
.topbar__tag.is-live { background: #DCFCE7; color: #166534; }
.topbar__right { display: flex; align-items: center; gap: 14px; }
.topbar__user { color: var(--slate); font-size: .9rem; }

/* ===== Main ===== */
.main { max-width: 1100px; margin: 0 auto; padding: 24px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 22px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat__num { font-family: 'Plus Jakarta Sans'; font-size: 1.7rem; font-weight: 800; }
.stat__label { color: var(--slate-light); font-size: .82rem; margin-top: 2px; }
.stat__dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: middle; }

/* Toolbar */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar__filters { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 7px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; font-size: .86rem; font-weight: 600; color: var(--slate); }
.chip.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.toolbar__search { flex: 1; min-width: 220px; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; }
.toolbar__search:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(37,99,235,.12); }

/* List */
.list { display: flex; flex-direction: column; gap: 10px; }
.row { display: grid; grid-template-columns: 110px 1fr 160px 130px 90px; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; cursor: pointer; transition: box-shadow .15s, border-color .15s, transform .1s; }
.row:hover { box-shadow: var(--shadow); border-color: #C7D2FE; }
.row__date { color: var(--slate-light); font-size: .82rem; }
.row__name { font-weight: 700; }
.row__contact { color: var(--slate-light); font-size: .82rem; }
.row__serv { font-size: .88rem; color: var(--slate); }
.row__imgs { font-size: .8rem; color: var(--slate-light); }
.row__action { text-align: right; color: var(--blue); font-weight: 700; font-size: .85rem; }

/* Status badge */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge--novo { color: var(--s-novo); background: #EFF6FF; }
.badge--analise { color: var(--s-analise); background: #FEF3C7; }
.badge--orcado { color: var(--s-orcado); background: #F3E8FF; }
.badge--fechado { color: var(--s-fechado); background: #DCFCE7; }
.badge--cancelado { color: var(--s-cancelado); background: #F1F5F9; }

.empty { text-align: center; color: var(--slate-light); padding: 40px; }

/* ===== Drawer ===== */
.drawer { position: fixed; inset: 0; z-index: 50; }
.drawer__backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.5); backdrop-filter: blur(3px); }
.drawer__panel { position: absolute; top: 0; right: 0; height: 100%; width: min(520px, 100%); background: #fff; box-shadow: -20px 0 50px rgba(15,23,42,.2); display: flex; flex-direction: column; animation: slideIn .25s ease; }
@keyframes slideIn { from { transform: translateX(30px); opacity: .6; } to { transform: translateX(0); opacity: 1; } }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.drawer__head h2 { font-size: 1.15rem; }
.drawer__close { border: none; background: var(--bg); width: 34px; height: 34px; border-radius: 8px; cursor: pointer; font-size: 1rem; color: var(--slate); }
.drawer__close:hover { background: #E2E8F0; }
.drawer__body { padding: 22px; overflow-y: auto; }

.d-field { margin-bottom: 16px; }
.d-field__label { font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; color: var(--slate-light); font-weight: 700; margin-bottom: 4px; }
.d-field__value { font-size: .98rem; }
.d-msg { background: var(--bg); border-radius: 10px; padding: 12px 14px; white-space: pre-wrap; line-height: 1.55; }
.d-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.d-imgs { display: flex; flex-wrap: wrap; gap: 8px; }
.d-imgs a { display: block; width: 78px; height: 78px; border-radius: 9px; overflow: hidden; border: 1px solid var(--line); }
.d-imgs img { width: 100%; height: 100%; object-fit: cover; }
.d-imgs .noimg { color: var(--slate-light); font-size: .86rem; }

.d-control { display: grid; gap: 6px; }
.d-control select, .d-control input, .d-control textarea { padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; width: 100%; }
.d-control select:focus, .d-control input:focus, .d-control textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(37,99,235,.12); }
.d-control textarea { resize: vertical; }

.d-section { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 18px; }
.d-section h3 { font-size: .95rem; margin-bottom: 12px; }

/* Caixa do prompt para o Claude */
.prompt-box { background: #0F172A; color: #E2E8F0; border-radius: 12px; padding: 14px; font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: .82rem; line-height: 1.5; white-space: pre-wrap; max-height: 230px; overflow-y: auto; margin-top: 10px; }
.prompt-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

.d-actions { display: flex; gap: 10px; margin-top: 22px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 10px; font-size: .9rem; opacity: 0; pointer-events: none; transition: .25s; z-index: 80; }
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== Responsive ===== */
@media (max-width: 820px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .row { grid-template-columns: 1fr auto; grid-template-areas: "name status" "serv action" "contact action"; gap: 6px 14px; }
  .row__date { display: none; }
  .row__name { grid-area: name; } .row__contact { grid-area: contact; }
  .row__serv { grid-area: serv; } .row__status { grid-area: status; justify-self: end; }
  .row__imgs { display: none; } .row__action { grid-area: action; align-self: center; }
}
