/* ==========================================================
   Worx - Byte Core | Folha de estilo
   Identidade: superficie clara, detalhes alaranjados, texto grafite.
   Tipografia Inter com reserva no sistema. Tema escuro incluido.
   ========================================================== */

:root {
    /* cor */
    --accent: #ff7a18;
    --accent-ink: #c25406;
    --accent-soft: rgba(255, 122, 24, .11);
    --accent-line: rgba(255, 122, 24, .32);
    --bg: #f7f5f2;
    --surface: #ffffff;
    --surface-2: #f2efea;
    --surface-3: #e9e5df;
    --overlay: rgba(24, 22, 20, .38);
    --text: rgba(63, 63, 64, 1);
    --text-strong: #26262a;
    --text-soft: #87837c;
    --line: #e7e2db;
    --line-strong: #d7d1c8;
    --footer: #f6f3ef;
    --ok: #157a4a;
    --ok-soft: #e7f6ee;
    --warn: #9a5a00;
    --warn-soft: #fdf2e3;
    --danger: #b42318;
    --danger-soft: #fdeceb;
    --info: #1f5fa8;

    /* forma */
    --r-sm: 8px;
    --r: 11px;
    --r-lg: 16px;
    --r-xl: 22px;

    /* elevacao */
    --sh-1: 0 1px 2px rgba(23, 20, 16, .05), 0 1px 1px rgba(23, 20, 16, .03);
    --sh-2: 0 4px 14px rgba(23, 20, 16, .07), 0 1px 3px rgba(23, 20, 16, .05);
    --sh-3: 0 14px 38px rgba(23, 20, 16, .12), 0 3px 10px rgba(23, 20, 16, .06);
    --sh-4: 0 30px 70px rgba(16, 14, 12, .22), 0 8px 22px rgba(16, 14, 12, .12);

    /* tipografia */
    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

    --topbar-h: 58px;
    --dock-h: 66px;
}

html[data-theme="dark"] {
    --accent: #ff8a33;
    --accent-ink: #ffa75f;
    --accent-soft: rgba(255, 138, 51, .14);
    --accent-line: rgba(255, 138, 51, .34);
    --bg: #131417;
    --surface: #1b1d21;
    --surface-2: #23262b;
    --surface-3: #2c3036;
    --overlay: rgba(0, 0, 0, .55);
    --text: #e6e4e1;
    --text-strong: #f5f4f2;
    --text-soft: #9b968e;
    --line: #2b2e34;
    --line-strong: #3a3e45;
    --footer: #17181c;
    --ok: #4ec18a;
    --ok-soft: rgba(78, 193, 138, .13);
    --warn: #e2a052;
    --warn-soft: rgba(226, 160, 82, .13);
    --danger: #f08279;
    --danger-soft: rgba(240, 130, 121, .13);
    --sh-1: 0 1px 2px rgba(0, 0, 0, .4);
    --sh-2: 0 4px 14px rgba(0, 0, 0, .45);
    --sh-3: 0 14px 38px rgba(0, 0, 0, .5);
    --sh-4: 0 30px 70px rgba(0, 0, 0, .62);
}

* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0; min-height: 100%; overflow-x: hidden; max-width: 100%;
    font-family: var(--font);
    font-size: 15px;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { color: var(--text-strong); letter-spacing: -.011em; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: var(--accent-soft); }

/* barra de rolagem discreta */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------------- icones ---------------- */
.ico { display: inline-block; vertical-align: -.18em; flex: 0 0 auto; }
.ico-wrap { display: inline-flex; }
.dot-prio { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--accent); }
.dot-prio.high { background: var(--danger); }
.dot-prio.low { background: var(--line-strong); }
.dot-live { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: var(--warn); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------------- componentes ---------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    border: 1px solid var(--line); background: var(--surface); color: var(--text);
    padding: 8px 14px; border-radius: var(--r); font-size: 13.5px; font-weight: 500;
    font-family: var(--font); line-height: 1.2; cursor: pointer; white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s;
    box-shadow: var(--sh-1); text-decoration: none;
}
.btn:hover { border-color: var(--line-strong); background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(255,122,24,.35); }
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn-danger { color: var(--danger); border-color: var(--line); background: var(--surface); }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: var(--r-sm); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.input, .select, .textarea {
    width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--r);
    background: var(--surface); color: var(--text); font-size: 14px; font-family: var(--font);
    transition: border-color .15s, box-shadow .15s;
}
.input::placeholder, .textarea::placeholder { color: var(--text-soft); }
.input:focus, .select:focus, .textarea:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.textarea { min-height: 112px; resize: vertical; line-height: 1.6; }
.select { appearance: none; padding-right: 30px;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-soft) 50%), linear-gradient(135deg, var(--text-soft) 50%, transparent 50%);
    background-position: calc(100% - 16px) 51%, calc(100% - 11px) 51%;
    background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.form { display: flex; flex-direction: column; gap: 13px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--text-soft); font-weight: 500; }
.row { display: flex; gap: 9px; flex-wrap: wrap; }
.row > * { flex: 1 1 170px; }

.panel-title { margin: 0 0 4px; font-size: 16px; font-weight: 600; text-transform: none;
    letter-spacing: -.01em; color: var(--text-strong); display: flex; align-items: center; gap: 8px; }

.brand-mark {
    width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
    background: linear-gradient(145deg, var(--accent), #ffab62);
    color: #fff; font-weight: 700; font-size: 18px; letter-spacing: -.02em;
    box-shadow: 0 4px 12px rgba(255, 122, 24, .32);
}

.tag { font-size: 11.5px; padding: 3px 9px; border-radius: 99px; background: var(--surface-2);
    color: var(--text-soft); font-weight: 600; letter-spacing: .005em; white-space: nowrap; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.danger { background: var(--danger-soft); color: var(--danger); }
.tag.accent { background: var(--accent-soft); color: var(--accent-ink); }

.empty { text-align: center; padding: 40px 20px; color: var(--text-soft); font-size: 13.5px; line-height: 1.6; }
.empty .big { display: block; margin: 0 auto 12px; opacity: .5; width: 34px; }

/* ---------------- login ---------------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.login-hero {
    background:
        radial-gradient(900px 420px at 14% 8%, rgba(255, 122, 24, .14), transparent 62%),
        linear-gradient(155deg, #fff 0%, #fdf7f1 58%, #fbeedf 100%);
    padding: 54px 52px; display: flex; flex-direction: column; justify-content: space-between;
}
html[data-theme="dark"] .login-hero { background:
    radial-gradient(900px 420px at 14% 8%, rgba(255, 138, 51, .13), transparent 62%),
    linear-gradient(155deg, #16181c 0%, #1b1d21 100%); }
.login-hero h1 { font-size: 42px; margin: 20px 0 10px; line-height: 1.06; letter-spacing: -.03em; }
.login-hero p { color: var(--text-soft); font-size: 16px; max-width: 430px; line-height: 1.65; margin: 0; }
.login-features { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 30px; max-width: 470px; }
.login-features div {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
    padding: 14px 15px; font-size: 12.5px; color: var(--text-soft); line-height: 1.55; box-shadow: var(--sh-1);
}
.login-features b { display: flex; align-items: center; gap: 7px; font-size: 13.5px; margin-bottom: 5px; color: var(--text-strong); }
.login-features .ico { color: var(--accent); }
.login-side { display: grid; place-items: center; padding: 40px 32px; background: var(--surface); }
.login-card { width: 100%; max-width: 372px; }
.login-card h2 { font-size: 23px; margin: 0 0 5px; letter-spacing: -.02em; }
.login-card .sub { color: var(--text-soft); font-size: 14px; margin: 0 0 24px; }
.login-msg { font-size: 13px; padding: 10px 13px; border-radius: var(--r); margin-bottom: 14px; display: none; }
.login-msg.err { background: var(--danger-soft); color: var(--danger); display: block; }
.login-msg.ok { background: var(--ok-soft); color: var(--ok); display: block; }
.login-foot { margin-top: 24px; text-align: center; }

/* ---------------- barra superior ---------------- */
.topbar {
    height: var(--topbar-h); display: flex; align-items: center; gap: 12px; padding: 0 16px;
    background: var(--surface); border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 400;
}
.topbar .logo { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 16px; letter-spacing: -.015em; color: var(--text-strong); }
.topbar .logo .brand-mark { width: 31px; height: 31px; border-radius: 9px; font-size: 14px; }
.topbar .spacer { flex: 1; }
.topbar .search {
    display: flex; align-items: center; gap: 9px; background: var(--surface-2);
    border: 1px solid transparent; border-radius: var(--r); padding: 7px 13px;
    min-width: 220px; max-width: 440px; flex: 1; transition: .15s; color: var(--text-soft);
}
.topbar .search:focus-within { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.topbar .search input { border: none; background: transparent; outline: none; color: var(--text); font-size: 13.5px; width: 100%; font-family: var(--font); }
.icon-btn {
    width: 36px; height: 36px; border-radius: var(--r); border: 1px solid transparent; background: transparent;
    cursor: pointer; color: var(--text-soft); display: grid; place-items: center; transition: .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--accent-ink); }
.avatar {
    width: 33px; height: 33px; border-radius: 50%; background: var(--accent); color: #fff;
    display: grid; place-items: center; font-weight: 600; font-size: 13.5px; cursor: pointer;
    border: none; box-shadow: 0 2px 6px rgba(255,122,24,.3);
}
.menu {
    position: absolute; top: 54px; right: 14px; background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--r-lg); box-shadow: var(--sh-3); min-width: 226px; padding: 7px; display: none; z-index: 500;
}
.menu.open { display: block; animation: pop .14s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(-5px); } }
.menu button, .menu a {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 11px; border: none;
    background: transparent; color: var(--text); font-size: 13.5px; border-radius: var(--r-sm); cursor: pointer;
    text-align: left; font-family: var(--font); text-decoration: none;
}
.menu button:hover, .menu a:hover { background: var(--surface-2); text-decoration: none; }
.menu .ico { color: var(--text-soft); }
.menu .sep { height: 1px; background: var(--line); margin: 6px 4px; }
.menu .who { padding: 9px 11px 12px; }
.menu .who b { display: block; font-size: 13.5px; color: var(--text-strong); }
.menu .who span { font-size: 12px; color: var(--text-soft); }

/* ---------------- area de trabalho ---------------- */
.desk {
    position: relative; min-height: calc(100vh - var(--topbar-h) - 108px);
    padding: 24px 24px calc(var(--dock-h) + 48px);
    background:
        radial-gradient(1100px 460px at 10% -8%, rgba(255, 122, 24, .07), transparent 62%),
        var(--bg);
}
.desk-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.desk-head h1 { font-size: 24px; margin: 0; letter-spacing: -.025em; font-weight: 650; }
.desk-head p { margin: 0; color: var(--text-soft); font-size: 13.5px; }

.grid { display: grid; gap: 16px; }
.grid-gadgets { grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); }

.card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl);
    padding: 18px; box-shadow: var(--sh-1);
}
.card h3 { margin: 0 0 13px; font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase;
    color: var(--text-soft); font-weight: 650; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 13px; }
.card-head h3 { margin: 0; }

.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(102px, 1fr)); gap: 10px; }
.app-tile {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
    padding: 15px 9px; text-align: center; cursor: pointer; transition: .16s;
    display: flex; flex-direction: column; align-items: center; gap: 9px; font-family: var(--font);
    color: var(--text); font-size: 12.5px; font-weight: 500; box-shadow: var(--sh-1);
}
.app-tile:hover { transform: translateY(-2px); border-color: var(--accent-line); box-shadow: var(--sh-2); color: var(--accent-ink); }
.app-tile .ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
    background: var(--accent-soft); color: var(--accent-ink); }
.app-tile:hover .ico { background: var(--accent); color: #fff; }

/* gadgets */
.gadget .big-temp { font-size: 40px; font-weight: 300; line-height: 1; letter-spacing: -.03em; color: var(--text-strong); }
.gadget .muted { color: var(--text-soft); font-size: 12.5px; line-height: 1.55; }
.forecast { display: flex; gap: 6px; margin-top: 14px; }
.forecast div { flex: 1; text-align: center; font-size: 11px; color: var(--text-soft); }
.forecast div b { display: block; color: var(--text-strong); font-size: 13px; }
.forecast .ic { font-size: 17px; margin: 2px 0; }

.quote-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.quote-row:last-child { border-bottom: none; }
.quote-row .sym { font-weight: 600; color: var(--text-strong); }
.quote-row .nm { font-size: 11px; color: var(--text-soft); display: block; font-weight: 400; }
.quote-row .val { text-align: right; font-variant-numeric: tabular-nums; }
.up { color: var(--ok); font-size: 12px; font-weight: 600; }
.down { color: var(--danger); font-size: 12px; font-weight: 600; }

.news-item { padding: 11px 0; border-bottom: 1px solid var(--line); }
.news-item:last-child { border-bottom: none; }
.news-item a { font-size: 13.5px; font-weight: 500; color: var(--text-strong); display: block; line-height: 1.45; }
.news-item a:hover { color: var(--accent-ink); text-decoration: none; }
.news-item .meta { font-size: 11px; color: var(--text-soft); margin-top: 4px; display: flex; gap: 7px; align-items: center; }
.news-source { font-size: 10.5px; padding: 2px 7px; border-radius: 99px; background: var(--surface-2); color: var(--text-soft); font-weight: 600; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.chip { font-size: 12px; padding: 5px 11px; border-radius: 99px; border: 1px solid var(--line);
    background: var(--surface); color: var(--text-soft); cursor: pointer; font-family: var(--font); transition: .14s; }
.chip:hover { border-color: var(--line-strong); color: var(--text); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

/* ---------------- janelas ---------------- */
.win {
    position: fixed; background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--r-xl); box-shadow: var(--sh-4); display: flex; flex-direction: column;
    overflow: hidden; min-width: 300px; min-height: 220px; z-index: 300;
}
.win.max { border-radius: 0; }
.win-bar {
    height: 46px; display: flex; align-items: center; gap: 10px; padding: 0 9px 0 15px;
    background: var(--surface); border-bottom: 1px solid var(--line); cursor: move; user-select: none; flex: 0 0 auto;
}
.win-bar .ttl { font-size: 13.5px; font-weight: 600; color: var(--text-strong); display: flex; align-items: center; gap: 9px;
    flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.win-bar .ttl .ico { color: var(--accent); }
.win-bar .ctl { display: flex; gap: 2px; }
.win-bar .ctl button {
    width: 30px; height: 30px; border-radius: var(--r-sm); border: none; background: transparent;
    cursor: pointer; color: var(--text-soft); display: grid; place-items: center;
}
.win-bar .ctl button:hover { background: var(--surface-2); color: var(--text); }
.win-bar .ctl .close:hover { background: var(--danger); color: #fff; }
.win-body { flex: 1; overflow: auto; padding: 18px; }
.win-body.flush { padding: 0; }
.win-foot { border-top: 1px solid var(--line); padding: 9px 14px; display: flex; gap: 8px; align-items: center; background: var(--surface-2); flex: 0 0 auto; }
.win-resize { position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; cursor: nwse-resize; }
.win.min { display: none; }

/* ---------------- dock ---------------- */
.dock {
    position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; z-index: 450;
    display: flex; align-items: center; gap: 4px; padding: 7px 9px;
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--sh-3);
    max-width: calc(100vw - 24px); overflow-x: auto;
}
.dock button {
    width: 44px; height: 44px; border-radius: 13px; border: none; background: transparent;
    cursor: pointer; display: grid; place-items: center; position: relative; transition: .15s;
    color: var(--text-soft); flex: 0 0 auto;
}
.dock button:hover { background: var(--accent-soft); color: var(--accent-ink); transform: translateY(-2px); }
.dock button.active { color: var(--accent-ink); background: var(--accent-soft); }
.dock button.active::after {
    content: ''; position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
    width: 4px; height: 4px; border-radius: 50%; background: var(--accent);
}
.dock .sep { width: 1px; height: 26px; background: var(--line); margin: 0 5px; flex: 0 0 auto; }

/* ---------------- rodape ---------------- */
.foot { background: var(--footer); border-top: 1px solid var(--line);
    padding: 18px 20px calc(var(--dock-h) + 10px); text-align: center; font-size: 12px; color: var(--text-soft); }
.guard-seal {
    display: inline-flex; align-items: center; gap: 8px; background: var(--surface);
    border: 1px solid var(--line); border-radius: 99px; padding: 6px 14px; font-size: 12px; font-weight: 600;
    color: var(--text); box-shadow: var(--sh-1);
}
.guard-seal .ico { color: var(--ok); }
.guard-seal .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.guard-seal.off .dot, .guard-seal.off .ico { background: var(--text-soft); color: var(--text-soft); box-shadow: none; }

/* ---------------- layout interno dos apps ---------------- */
.split { display: grid; grid-template-columns: 232px 1fr; height: 100%; }
.split > .side { border-right: 1px solid var(--line); overflow: auto; padding: 12px; background: var(--surface-2); }
.split > .main { overflow: auto; padding: 18px; }

.list-item {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm);
    cursor: pointer; font-size: 13.5px; transition: background .12s;
}
.list-item:hover { background: var(--surface-3); }
.list-item.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.list-item .ico { color: var(--text-soft); }
.list-item.on .ico { color: var(--accent-ink); }
.list-item .grow { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.list-item .sm { font-size: 11.5px; color: var(--text-soft); font-weight: 400; }

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { text-align: left; padding: 10px 11px; border-bottom: 1px solid var(--line); }
.table th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-soft); font-weight: 650; }
.table tbody tr:hover td { background: var(--surface-2); }

.toolbar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
    padding: 9px 13px; border-bottom: 1px solid var(--line); background: var(--surface); }
.toolbar .gap { flex: 1; min-width: 6px; }
.toolbar .btn { box-shadow: none; }
.toolbar-sep { width: 1px; height: 22px; background: var(--line); margin: 0 3px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 12px; background: var(--surface); overflow-x: auto; }
.tabs button {
    border: none; background: transparent; padding: 12px 13px; font-size: 13.5px; cursor: pointer;
    color: var(--text-soft); border-bottom: 2px solid transparent; font-family: var(--font); white-space: nowrap; font-weight: 500;
}
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--accent-ink); border-bottom-color: var(--accent); font-weight: 600; }

/* editor de documento */
.doc-page {
    background: #fff; color: #2d2d30; max-width: 820px; margin: 22px auto; padding: 58px 66px;
    box-shadow: var(--sh-3); border-radius: 4px; min-height: 60vh; line-height: 1.75; font-size: 15px; outline: none;
}
html[data-theme="dark"] .doc-page { background: #f6f5f3; }
.doc-page:focus { box-shadow: var(--sh-3), 0 0 0 3px var(--accent-soft); }
.doc-page h1, .doc-page h2, .doc-page h3 { line-height: 1.25; color: #1f1f22; }
.doc-page img { max-width: 100%; }
.doc-page table { border-collapse: collapse; }
.doc-page table td, .doc-page table th { border: 1px solid #dcdcd8; padding: 7px 10px; }

/* planilha */
.sheet-wrap { overflow: auto; height: 100%; background: var(--surface); }
.sheet-table { border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.sheet-table th, .sheet-table td { border: 1px solid var(--line); padding: 0; min-width: 96px; height: 29px; }
.sheet-table th {
    background: var(--surface-2); color: var(--text-soft); font-size: 11px; font-weight: 650;
    text-align: center; position: sticky; top: 0; z-index: 2; min-width: 44px;
}
.sheet-table td.rh {
    background: var(--surface-2); color: var(--text-soft); font-size: 11px; text-align: center;
    position: sticky; left: 0; z-index: 1; min-width: 44px; font-weight: 650;
}
.sheet-table input {
    width: 100%; height: 100%; border: none; background: transparent; padding: 3px 8px;
    font-size: 13px; color: var(--text); font-family: var(--font); outline: none;
}
.sheet-table input:focus { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }

/* pdf */
.pdf-stage { background: #35373d; padding: 20px; display: flex; flex-direction: column; align-items: center; gap: 16px; min-height: 100%; }
.pdf-stage canvas { max-width: 100%; background: #fff; border-radius: 3px; }

/* chat de IA */
.chat-wrap { display: flex; flex-direction: column; height: 100%; }
.chat-log { flex: 1; overflow: auto; padding: 20px; display: flex; flex-direction: column; gap: 13px; }
.bubble { max-width: 82%; padding: 11px 14px; border-radius: 15px; font-size: 14px; line-height: 1.62; white-space: pre-wrap; word-wrap: break-word; }
.bubble.me { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 5px; }
.bubble.ai { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 5px; }
.bubble.sys { align-self: center; background: transparent; color: var(--text-soft); font-size: 12.5px; text-align: center; max-width: 94%; }
.chat-box { border-top: 1px solid var(--line); padding: 12px 14px; display: flex; flex-direction: column; gap: 9px; background: var(--surface); }
.chat-box .ta { width: 100%; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 11px 14px; font-size: 14px;
    resize: none; min-height: 46px; max-height: 170px; font-family: var(--font); background: var(--surface); color: var(--text); }
.chat-box .ta:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.chat-icons { display: flex; gap: 6px; align-items: center; }

/* kanban */
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.kanban-col { background: var(--surface-2); border-radius: var(--r-lg); padding: 12px; min-height: 230px; }
.kanban-col h4 { margin: 0 0 10px; font-size: 11px; text-transform: uppercase; color: var(--text-soft); letter-spacing: .06em; font-weight: 650; }
.kanban-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
    padding: 11px 12px; margin-bottom: 9px; font-size: 13.5px; cursor: grab; box-shadow: var(--sh-1);
}
.kanban-card:hover { border-color: var(--line-strong); }
.kanban-card .meta { font-size: 11px; color: var(--text-soft); margin-top: 7px; display: flex; gap: 8px; align-items: center; }
.kanban-col.over { outline: 2px dashed var(--accent); outline-offset: -4px; }

/* notas */
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(208px, 1fr)); gap: 13px; }
.note-card { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; background: var(--surface);
    cursor: pointer; min-height: 122px; box-shadow: var(--sh-1); transition: .15s; }
.note-card:hover { box-shadow: var(--sh-2); transform: translateY(-2px); }
.note-card b { font-size: 14px; display: block; margin-bottom: 6px; color: var(--text-strong); }
.note-card p { margin: 0; font-size: 12.5px; color: var(--text-soft); line-height: 1.55; max-height: 76px; overflow: hidden; }
.note-card[data-color="amarelo"] { background: #fffaea; border-color: #f2e4bb; }
.note-card[data-color="verde"] { background: #effbf3; border-color: #cbead7; }
.note-card[data-color="azul"] { background: #eff4ff; border-color: #cedcf6; }
.note-card[data-color="rosa"] { background: #fff1f4; border-color: #f6d4db; }
html[data-theme="dark"] .note-card[data-color]:not([data-color="default"]) { color: #2b2b2b; }
html[data-theme="dark"] .note-card[data-color]:not([data-color="default"]) b { color: #1f1f1f; }
html[data-theme="dark"] .note-card[data-color]:not([data-color="default"]) p { color: #555; }

/* calendario */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-grid .dow { text-align: center; font-size: 10.5px; color: var(--text-soft); font-weight: 650; padding: 6px 0; text-transform: uppercase; letter-spacing: .05em; }
.cal-day { border: 1px solid var(--line); border-radius: var(--r-sm); min-height: 78px; padding: 5px 6px; font-size: 11px; background: var(--surface); }
.cal-day.out { opacity: .38; }
.cal-day.today { border-color: var(--accent); background: var(--accent-soft); }
.cal-day b { font-size: 12px; color: var(--text-strong); }
.cal-ev { background: var(--accent); color: #fff; border-radius: 5px; padding: 2px 6px; margin-top: 3px;
    font-size: 10.5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; }

/* avisos */
.toasts { position: fixed; right: 18px; bottom: calc(var(--dock-h) + 22px); z-index: 900; display: flex; flex-direction: column; gap: 9px; }
.toast {
    background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent);
    border-radius: var(--r); padding: 11px 15px; font-size: 13.5px; box-shadow: var(--sh-3); max-width: 340px;
    animation: toast-in .2s ease-out;
}
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

.overlay { position: fixed; inset: 0; background: var(--overlay); z-index: 800; display: grid; place-items: center; padding: 20px;
    backdrop-filter: blur(2px); }
.dialog { background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--sh-4); width: 100%; max-width: 448px;
    padding: 22px; border: 1px solid var(--line); animation: pop .16s ease-out; max-height: 88vh; overflow: auto; }
.dialog h3 { margin: 0 0 14px; font-size: 17px; text-transform: none; letter-spacing: -.015em; color: var(--text-strong); }
.dialog .acts { display: flex; gap: 9px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }

.spin { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--accent-soft);
    border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.stat { display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 21px; font-weight: 650; color: var(--text-strong); letter-spacing: -.02em; }
.stat span { font-size: 11.5px; color: var(--text-soft); }
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 14px; }

.drop-zone { border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg); padding: 30px;
    text-align: center; color: var(--text-soft); font-size: 13.5px; line-height: 1.6; }
.drop-zone.over, .main.over .drop-zone { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }

.mono { font-family: var(--mono); font-size: 12.5px; }
.scroll-y { overflow-y: auto; }
.hide { display: none !important; }
.only-mobile { display: none !important; }

/* ---------- editor visual de PDF ---------- */
.pdf-shell { display: grid; grid-template-columns: 152px 1fr; height: 100%; }
.pdf-thumbs { background: var(--surface-2); border-right: 1px solid var(--line); overflow: auto; padding: 11px; }
.pdf-thumb { position: relative; margin-bottom: 11px; border: 2px solid transparent; border-radius: var(--r-sm);
    overflow: hidden; cursor: pointer; background: #fff; box-shadow: var(--sh-1); }
.pdf-thumb:hover { border-color: var(--accent-line); }
.pdf-thumb.on { border-color: var(--accent); }
.pdf-thumb canvas { display: block; width: 100%; }
.pdf-thumb .num { position: absolute; bottom: 4px; left: 5px; background: rgba(0,0,0,.62); color: #fff;
    font-size: 10px; padding: 1px 7px; border-radius: 99px; font-weight: 600; }
.pdf-thumb .acts { position: absolute; top: 4px; right: 4px; display: flex; gap: 3px; opacity: 0; transition: .15s; }
.pdf-thumb:hover .acts { opacity: 1; }
.pdf-thumb .acts button { width: 24px; height: 24px; border: none; border-radius: 7px; background: rgba(0,0,0,.65);
    color: #fff; cursor: pointer; display: grid; place-items: center; }
.pdf-thumb .acts button:hover { background: var(--accent); }

.pdf-page { position: relative; margin: 0 auto; box-shadow: var(--sh-3); border-radius: 3px; background: #fff; }
.pdf-page canvas { display: block; border-radius: 3px; }
.pdf-layer { position: absolute; inset: 0; }
.pdf-layer.drawing { cursor: crosshair; }
.pdf-layer.picking { cursor: copy; }
.pdf-layer svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

.pdf-ann { position: absolute; cursor: move; border: 1px dashed transparent; }
.pdf-ann:hover { border-color: var(--accent-line); }
.pdf-ann.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.pdf-ann.text { padding: 1px 2px; white-space: pre; line-height: 1.25; color: #1a1a1a; min-width: 14px; outline: none; }
.pdf-ann.white { background: #fff; }
.pdf-ann.mark { background: rgba(255, 229, 0, .42); }
.pdf-ann.image img { display: block; width: 100%; height: 100%; pointer-events: none; }
.pdf-ann .grip { position: absolute; right: -6px; bottom: -6px; width: 13px; height: 13px; border-radius: 50%;
    background: var(--accent); border: 2px solid #fff; cursor: nwse-resize; display: none; }
.pdf-ann.sel .grip { display: block; }
.pdf-ann .kill { position: absolute; right: -10px; top: -10px; width: 20px; height: 20px; border-radius: 50%;
    background: var(--danger); color: #fff; border: 2px solid #fff; cursor: pointer; display: none;
    padding: 0; place-items: center; }
.pdf-ann.sel .kill { display: grid; }

.pdf-toolgroup { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.pdf-dirty { font-size: 12px; color: var(--warn); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.sign-pad { border: 1.5px dashed var(--line-strong); border-radius: var(--r); background: #fff; touch-action: none; width: 100%; height: 190px; }

/* ---------------- responsivo ---------------- */
@media (max-width: 1024px) {
    .split { grid-template-columns: 196px 1fr; }
    .pdf-shell { grid-template-columns: 124px 1fr; }
}

@media (max-width: 820px) {
    body { font-size: 14.5px; }
    .login-wrap { grid-template-columns: 1fr; }
    .login-hero { padding: 34px 22px; }
    .login-hero h1 { font-size: 31px; }
    .login-features { grid-template-columns: 1fr; }
    .login-side { padding: 28px 20px 48px; }

    .topbar { padding: 0 11px; gap: 6px; }
    .topbar .logo span:last-child { display: none; }
    .topbar .search { min-width: 0; }
    .only-mobile { display: grid !important; }

    .desk { padding: 16px 14px calc(var(--dock-h) + 42px); }
    .desk-head h1 { font-size: 20px; }
    .grid-gadgets { grid-template-columns: 1fr; }
    .grid-gadgets > * { grid-column: auto !important; }
    .card { padding: 15px; border-radius: var(--r-lg); }
    .app-grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
    .app-tile { padding: 12px 6px; font-size: 11.5px; }
    .app-tile .ico { width: 36px; height: 36px; }

    /* janelas viram telas cheias no celular */
    .win {
        inset: var(--topbar-h) 0 0 0 !important;
        width: 100% !important; height: calc(100% - var(--topbar-h)) !important;
        border-radius: 0; border-left: none; border-right: none; border-bottom: none;
    }
    .win-bar { cursor: default; }
    .win-resize { display: none; }
    .win-body { padding: 14px; }

    .split { grid-template-columns: 1fr; }
    .split > .side { display: none; }
    .pdf-shell { grid-template-columns: 1fr; }
    .pdf-thumbs { display: none; }
    .kanban { grid-template-columns: 1fr; }
    .notes-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .doc-page { padding: 26px 20px; margin: 12px; border-radius: 3px; }
    .toolbar { padding: 8px 10px; gap: 5px; }
    .toolbar .btn { padding: 7px 9px; font-size: 12.5px; }
    .dialog { max-width: 100%; }
    .toasts { right: 10px; left: 10px; bottom: calc(var(--dock-h) + 14px); }
    .toast { max-width: 100%; }
    .cal-day { min-height: 56px; }
    .foot { padding-bottom: calc(var(--dock-h) + 16px); }
}

@media (max-width: 560px) {
    .topbar .search { display: none; }
    .topbar .spacer { display: none; }

    .dock {
        bottom: 10px; gap: 2px; padding: 6px; border-radius: 16px;
        left: 10px; right: 10px; transform: none; max-width: none;
        justify-content: flex-start; scrollbar-width: none;
    }
    .dock::-webkit-scrollbar { display: none; }
    .dock button { width: 40px; height: 40px; border-radius: 11px; }
    .desk-head { gap: 6px; }
    .desk-head p { width: 100%; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .table th:nth-child(n+4), .table td:nth-child(n+4) { display: none; }
}

@media (hover: none) {
    .pdf-thumb .acts { opacity: 1; }
}

@media print {
    .topbar, .dock, .foot, .toasts, .win-bar, .toolbar { display: none !important; }
    .win { position: static; box-shadow: none; border: none; }
}
