@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
  --nav: #0b1220;
  --nav-muted: #8993a5;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --ink: #172033;
  --muted: #697386;
  --line: #e7eaf0;
  --surface: #ffffff;
  --page: #f5f7fa;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); font-family: 'DM Sans', sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font-family: inherit; }

/* Login */
.auth-page { min-height: 100vh; background: #eef2f8; }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(390px, 46%) 1fr; }
.auth-showcase { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 48px clamp(42px,6vw,90px); color: #fff; background: radial-gradient(circle at 85% 18%,rgba(59,130,246,.32),transparent 31%),radial-gradient(circle at 15% 85%,rgba(37,99,235,.18),transparent 30%),#0b1220; }
.auth-showcase::after { content: ''; position: absolute; width: 430px; height: 430px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; right: -190px; bottom: -150px; box-shadow: 0 0 0 70px rgba(255,255,255,.025),0 0 0 140px rgba(255,255,255,.018); }
.auth-brand, .sidebar-brand { display: flex; align-items: center; gap: 12px; font-size: 1.25rem; font-weight: 700; letter-spacing: -.02em; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg,#3b82f6,#1d4ed8); border-radius: 12px; box-shadow: 0 8px 22px rgba(37,99,235,.28); }
.auth-copy { position: relative; z-index: 1; max-width: 560px; }
.auth-copy h1 { margin: 15px 0 20px; max-width: 520px; font-size: clamp(2.35rem,4.4vw,4.3rem); line-height: 1.06; letter-spacing: -.055em; }
.auth-copy p { max-width: 490px; color: #aeb8c9; font-size: 1.08rem; line-height: 1.7; }
.eyebrow { color: var(--primary); font-size: .69rem; font-weight: 700; letter-spacing: .14em; }
.eyebrow-light { color: #60a5fa; }
.auth-foot { position: relative; z-index: 1; display: flex; align-items: center; gap: 9px; color: #8995a9; font-size: .82rem; }
.auth-form-wrap { display: grid; place-items: center; padding: 40px; background: #fff; }
.auth-card { width: min(100%,430px); }
.auth-card-icon { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 26px; color: var(--primary); background: #eff6ff; border-radius: 14px; font-size: 1.15rem; }
.auth-card h2 { margin: 8px 0 8px; font-size: 2rem; font-weight: 700; letter-spacing: -.035em; }
.form-label { margin-bottom: 7px; color: #344054; font-size: .82rem; font-weight: 600; }
.form-control, .form-select { min-height: 44px; border-color: #dfe3ea; border-radius: 9px; color: var(--ink); font-size: .9rem; box-shadow: none!important; }
.form-control:focus, .form-select:focus { border-color: #7aa7f8; box-shadow: 0 0 0 3px rgba(37,99,235,.09)!important; }
.input-icon { position: relative; }
.input-icon > i { position: absolute; z-index: 2; left: 15px; top: 50%; transform: translateY(-50%); color: #98a2b3; }
.input-icon .form-control { padding-left: 43px; }
.btn { border-radius: 9px; font-weight: 600; }
.btn-primary { background: var(--primary); border-color: var(--primary); box-shadow: 0 5px 14px rgba(37,99,235,.18); }
.btn-primary:hover, .btn-primary:focus { background: var(--primary-dark); border-color: var(--primary-dark); }
.auth-submit { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 52px; font-size: .92rem; }

/* Estrutura */
.app-body { min-height: 100vh; background: var(--page); }
.sidebar { position: fixed; z-index: 1040; inset: 0 auto 0 0; width: 250px; display: flex; flex-direction: column; padding: 26px 18px 20px; color: #fff; background: var(--nav); }
.sidebar-brand { padding: 0 10px 30px; color: #fff; text-decoration: none; }
.sidebar-brand > span:last-child { display: flex; flex-direction: column; line-height: 1.1; }
.sidebar-brand strong { font-size: 1.08rem; }
.sidebar-brand small { margin-top: 5px; color: #718096; font-size: .64rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
.sidebar-nav { display: flex; flex-direction: column; gap: 5px; }
.nav-label { margin: 10px 12px 7px; color: #566276; font-size: .61rem; font-weight: 700; letter-spacing: .14em; }
.nav-label-secondary { margin-top: 25px; }
.sidebar-nav a { display: flex; align-items: center; gap: 12px; min-height: 45px; padding: 0 13px; color: var(--nav-muted); border-radius: 9px; font-size: .86rem; font-weight: 500; text-decoration: none; transition: .18s ease; }
.sidebar-nav a i { width: 19px; font-size: 1.05rem; }
.sidebar-nav a:hover { color: #fff; background: rgba(255,255,255,.05); }
.sidebar-nav a.active { color: #fff; background: #1f5fd4; box-shadow: 0 8px 20px rgba(0,0,0,.16); }
.nav-count { margin-left: auto; min-width: 23px; padding: 2px 6px; text-align: center; color: #7f8a9c; background: rgba(255,255,255,.06); border-radius: 6px; font-size: .68rem; }
.active .nav-count { color: #fff; background: rgba(255,255,255,.16); }
.sidebar-footer { margin-top: auto; }
.system-status { display: flex; align-items: center; gap: 10px; margin: 0 7px 16px; padding: 13px 10px; border: 1px solid rgba(255,255,255,.065); border-radius: 10px; }
.system-status > span { width: 8px; height: 8px; background: #34d399; border-radius: 50%; box-shadow: 0 0 0 4px rgba(52,211,153,.11); }
.system-status div { display: flex; flex-direction: column; }
.system-status strong { font-size: .72rem; font-weight: 600; }
.system-status small { margin-top: 2px; color: #68758a; font-size: .62rem; }
.sidebar-logout { width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 13px; color: #7e8a9d; border: 0; background: transparent; border-radius: 9px; font-size: .8rem; transition: .18s; }
.sidebar-logout:hover { color: #fff; background: rgba(255,255,255,.05); }
.app-shell { min-height: 100vh; margin-left: 250px; }
.topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(22px,3vw,44px); background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); }
.topbar-title { display: flex; flex-direction: column; }
.topbar-title strong { font-size: .88rem; }
.topbar-title span { margin-top: 2px; color: #8a94a6; font-size: .7rem; }
.topbar-actions { display: flex; align-items: center; gap: 17px; }
.today { display: flex; align-items: center; gap: 8px; color: #667085; font-size: .76rem; }
.admin-avatar { width: 35px; height: 35px; display: grid; place-items: center; color: #fff; background: #172033; border-radius: 10px; font-size: .68rem; font-weight: 700; }
.mobile-menu { display: none; padding: 6px; color: var(--ink); border: 0; background: transparent; font-size: 1.5rem; }
.main-content { max-width: 1700px; margin: 0 auto; padding: 35px clamp(22px,3vw,44px) 48px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; margin-bottom: 27px; }
.page-heading h1 { margin: 7px 0 5px; font-size: clamp(1.65rem,2.3vw,2.15rem); font-weight: 700; letter-spacing: -.04em; }
.page-heading p { margin: 0; color: var(--muted); font-size: .86rem; }
.btn-new { min-height: 43px; padding: 0 17px; font-size: .82rem; }
.btn-new i { margin-right: 7px; }

/* Métricas */
.metrics-grid { margin-bottom: 24px; }
.view-tabs { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 14px; padding: 4px; background: #e9edf3; border-radius: 10px; }
.view-tabs a { display: flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 12px; color: #697386; border-radius: 7px; font-size: .72rem; font-weight: 600; text-decoration: none; transition: .15s; }
.view-tabs a:hover { color: var(--ink); }
.view-tabs a.active { color: #1d4ed8; background: #fff; box-shadow: 0 1px 4px rgba(16,24,40,.1); }
.view-tabs a span { min-width: 18px; padding: 2px 5px; text-align: center; color: #7c8798; background: #f1f3f6; border-radius: 5px; font-size: .6rem; }
.view-tabs a.active span { color: #2563eb; background: #eff6ff; }
.metric { height: 100%; padding: 19px 20px 17px; background: var(--surface); border: 1px solid #e9ecf1; border-radius: 12px; box-shadow: 0 2px 6px rgba(16,24,40,.025); }
.metric-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 17px; }
.metric-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; font-size: .98rem; }
.metric-blue .metric-icon { color: #2563eb; background: #eff6ff; }
.metric-green .metric-icon { color: #059669; background: #ecfdf5; }
.metric-violet .metric-icon { color: #7c3aed; background: #f5f3ff; }
.metric-orange .metric-icon { color: #d97706; background: #fffbeb; }
.metric-trend { padding: 4px 7px; color: #667085; background: #f4f6f8; border-radius: 5px; font-size: .61rem; font-weight: 600; }
.metric-trend.positive { color: #047857; background: #ecfdf5; }
.metric-trend.warning { color: #b45309; background: #fffbeb; }
.metric small { display: block; margin-bottom: 5px; color: #7b8495; font-size: .72rem; }
.metric > strong { display: block; font-size: 1.55rem; font-weight: 700; letter-spacing: -.035em; }
.metric-foot { margin-top: 14px; padding-top: 11px; color: #9aa2b1; border-top: 1px solid #f0f1f4; font-size: .65rem; }
.metric-foot i { margin-right: 5px; }

/* Dados */
.data-card { overflow: hidden; background: var(--surface); border: 1px solid #e6e9ef; border-radius: 13px; box-shadow: 0 3px 10px rgba(16,24,40,.025); }
.data-card-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.data-card-header h2 { margin: 0 0 3px; font-size: 1rem; font-weight: 700; }
.data-card-header p { margin: 0; color: #8b94a4; font-size: .69rem; }
.search-box { position: relative; width: min(340px,36vw); }
.search-box > i { position: absolute; z-index: 2; left: 13px; top: 50%; transform: translateY(-50%); color: #8f99a9; font-size: .85rem; }
.search-box .form-control { min-height: 39px; padding: 8px 38px; background: #fafbfc; font-size: .76rem; }
.search-box button { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: none; color: #8f99a9; border: 0; background: transparent; font-size: .7rem; }
.search-box button.visible { display: block; }
.client-table { min-width: 1160px; margin: 0; }
.client-table th { padding: 12px 16px; color: #818b9c; background: #fafbfc; border-bottom: 1px solid var(--line); font-size: .61rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.client-table th:first-child, .client-table td:first-child { padding-left: 22px; }
.client-table th:last-child, .client-table td:last-child { padding-right: 20px; }
.client-table td { padding: 15px 16px; border-color: #eef0f3; color: #485265; font-size: .76rem; vertical-align: middle; }
.client-table tbody tr { transition: background .15s; }
.client-table tbody tr:hover { background: #fafcff; }
.client-cell { display: flex; align-items: center; gap: 11px; min-width: 170px; }
.client-avatar { flex: 0 0 auto; width: 35px; height: 35px; display: grid; place-items: center; color: #1d4ed8; background: #eaf1ff; border: 1px solid #dbe7ff; border-radius: 9px; font-size: .76rem; font-weight: 700; }
.client-cell strong { display: block; max-width: 175px; overflow: hidden; color: #273247; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.client-note { max-width: 175px; margin-top: 2px; overflow: hidden; color: #929baa; font-size: .64rem; text-overflow: ellipsis; white-space: nowrap; }
.services-list { display: flex; flex-wrap: wrap; gap: 5px; min-width: 135px; }
.service { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; color: #536074; background: #f4f6f8; border-radius: 5px; font-size: .61rem; font-weight: 600; }
.service i { color: #718096; }
.contact-info { display: flex; flex-direction: column; gap: 4px; min-width: 155px; }
.contact-info span, .contact-info a { display: flex; align-items: center; gap: 7px; color: #606b7e; text-decoration: none; }
.contact-info i { color: #9aa3b2; font-size: .69rem; }
.contact-info a { max-width: 190px; overflow: hidden; color: #2563eb; text-overflow: ellipsis; white-space: nowrap; }
.bot-plan { display: flex; flex-direction: column; min-width: 130px; }
.bot-plan strong { color: #344054; font-size: .74rem; }
.bot-plan span { margin-top: 4px; color: #8a94a5; font-size: .62rem; }
.bot-plan i { margin-right: 4px; }
.money { color: #273247; white-space: nowrap; }
.due-date { display: flex; flex-direction: column; min-width: 92px; }
.due-date strong { color: #475267; font-size: .75rem; }
.due-date span { margin-top: 3px; color: #929baa; font-size: .62rem; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 6px; font-size: .63rem; font-weight: 600; }
.status-pill i { width: 5px; height: 5px; border-radius: 50%; }
.status-active { color: #047857; background: #ecfdf5; }
.status-active i { background: #10b981; }
.status-inactive { color: #667085; background: #f2f4f7; }
.status-inactive i { background: #98a2b3; }
.license-field { min-width: 215px; display: flex; overflow: hidden; background: #fafbfc; border: 1px solid #e3e6eb; border-radius: 7px; }
.license-field input { width: 145px; min-width: 0; padding: 7px 9px; color: #556176; background: transparent; border: 0; outline: none; font: .68rem ui-monospace,SFMono-Regular,Menlo,monospace; }
.license-field button { width: 34px; padding: 0; color: #8791a2; background: transparent; border: 0; border-left: 1px solid #e6e9ee; transition: .15s; }
.license-field button:hover { color: var(--primary); background: #eff6ff; }
.license-field button.copied { color: #059669; background: #ecfdf5; }
.empty-value { color: #a0a8b5; font-size: .65rem; }
.row-actions { display: flex; gap: 5px; }
.row-actions form { margin: 0; }
.action-btn { width: 31px; height: 31px; display: grid; place-items: center; padding: 0; color: #687386; background: #fff; border: 1px solid #e3e6eb; border-radius: 7px; font-size: .72rem; text-decoration: none; transition: .15s; }
.action-btn:hover { color: var(--primary); border-color: #b8cff8; background: #f7faff; }
.action-danger:hover { color: #dc2626; border-color: #fecaca; background: #fff7f7; }
.empty-state { padding: 60px 20px; text-align: center; }
.empty-state > span { width: 52px; height: 52px; display: grid; place-items: center; margin: 0 auto 14px; color: #718096; background: #f3f5f8; border-radius: 14px; font-size: 1.2rem; }
.empty-state h3 { margin: 0 0 6px; font-size: .95rem; }
.empty-state p { margin: 0 0 17px; color: #8a94a5; font-size: .73rem; }
.empty-state.compact { padding: 38px 20px; }

/* Modal */
.modal-backdrop.show { opacity: .58; }
.modal-content { border: 0; border-radius: 14px; box-shadow: 0 24px 70px rgba(15,23,42,.25); }
.modal-header { padding: 20px 24px; border-color: var(--line); }
.modal-title-wrap { display: flex; align-items: center; gap: 12px; }
.modal-title-wrap > span { width: 38px; height: 38px; display: grid; place-items: center; color: #2563eb; background: #eff6ff; border-radius: 9px; }
.modal-title-wrap h2 { margin: 0; font-size: 1rem; font-weight: 700; }
.modal-title-wrap p { margin: 3px 0 0; color: #8b94a4; font-size: .67rem; }
.modal-body { padding: 23px 24px; }
.modal-footer { padding: 15px 24px; border-color: var(--line); }
.modal-footer .btn { padding: 9px 17px; font-size: .78rem; }
.form-section-title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.form-section-title > span { width: 27px; height: 27px; display: grid; place-items: center; color: #2563eb; background: #eff6ff; border-radius: 7px; font-size: .61rem; font-weight: 700; }
.form-section-title div { display: flex; flex-direction: column; }
.form-section-title strong { font-size: .78rem; }
.form-section-title small { margin-top: 1px; color: #929baa; font-size: .62rem; }
.service-config { padding-top: 2px; }
.bot-license-note { display: flex; align-items: center; gap: 11px; margin: 0 0 15px; padding: 12px 13px; color: #28599f; background: #f4f8ff; border: 1px solid #dce8fb; border-radius: 9px; }
.bot-license-note > i { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto; color: #2563eb; background: #e5efff; border-radius: 8px; }
.bot-license-note div { display: flex; flex-direction: column; }
.bot-license-note strong { font-size: .7rem; }
.bot-license-note span { margin-top: 2px; color: #6e84a5; font-size: .62rem; }
.service-options { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.service-option { position: relative; display: flex; align-items: center; gap: 10px; min-height: 63px; padding: 11px 12px; cursor: pointer; background: #fff; border: 1px solid #e2e6ec; border-radius: 9px; transition: .15s; }
.service-option:hover { border-color: #b9cdf5; }
.service-option input { position: absolute; opacity: 0; pointer-events: none; }
.service-option-icon { width: 34px; height: 34px; display: grid; place-items: center; color: #687386; background: #f4f6f8; border-radius: 8px; }
.service-option strong { color: #4b5669; font-size: .72rem; font-weight: 600; }
.service-check { position: absolute; right: 7px; top: 7px; width: 16px; height: 16px; display: grid; place-items: center; color: transparent; border: 1px solid #d8dde5; border-radius: 50%; font-size: .55rem; }
.service-option:has(input:checked) { border-color: #7fa8f5; background: #f8fbff; box-shadow: 0 0 0 2px rgba(37,99,235,.06); }
.service-option:has(input:checked) .service-option-icon { color: #2563eb; background: #eaf2ff; }
.service-option:has(input:checked) .service-check { color: #fff; background: #2563eb; border-color: #2563eb; }
.font-mono { font-family: ui-monospace,SFMono-Regular,Menlo,monospace; font-size: .78rem; }
.form-text { color: #929baa; font-size: .62rem; }

@media (max-width: 1050px) {
  .sidebar { width: 218px; }
  .app-shell { margin-left: 218px; }
  .metric { padding: 17px; }
}

@media (max-width: 820px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-showcase { min-height: 280px; padding: 30px; }
  .auth-copy h1 { font-size: 2.3rem; }
  .auth-foot { display: none; }
  .auth-form-wrap { padding: 42px 24px; }
  .sidebar { width: 250px; transform: translateX(-101%); box-shadow: 20px 0 50px rgba(15,23,42,.25); transition: transform .25s ease; }
  .menu-open .sidebar { transform: translateX(0); }
  .app-shell { margin-left: 0; }
  .mobile-menu { display: block; }
  .topbar-title { margin-right: auto; margin-left: 10px; }
  .today { display: none; }
  .main-content { padding-top: 27px; }
}

@media (max-width: 576px) {
  .auth-showcase { min-height: 235px; }
  .auth-copy h1 { font-size: 1.8rem; }
  .auth-copy p { margin-bottom: 0; font-size: .9rem; }
  .auth-form-wrap { place-items: start center; }
  .topbar-title span { display: none; }
  .page-heading { align-items: stretch; flex-direction: column; }
  .btn-new { width: 100%; }
  .metric { padding: 14px; }
  .metric-top { margin-bottom: 13px; }
  .metric-icon { width: 32px; height: 32px; }
  .metric > strong { font-size: 1.2rem; }
  .metric-foot { display: none; }
  .data-card-header { align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
  .service-options { grid-template-columns: 1fr; }
  .modal-body, .modal-header, .modal-footer { padding-left: 18px; padding-right: 18px; }
}
