/* Tema "AutoCAD" — experiência focada no computador (sem layout de celular/toque). */
/* Largura mínima de trabalho: acima disso o layout é o do desktop. */
html, body { min-width: 1100px; }
:root {
    --ac-title: #2b3037;
    --ac-ribbon: #3b4453;
    --ac-ribbon-panel: #f0f0f0;
    --ac-canvas: #212830;
    --ac-palette: #2f353d;
    --ac-border: #1a1e24;
    --ac-text: #e6e9ee;
    --ac-muted: #9aa4b2;
    --ac-blue: #0b84d8;
    --header-h: 0px;
    --ribbon-h: 118px;
    --doc-h: 26px;
    --layout-h: 24px;
    --status-h: 26px;
    --sidebar-w: 280px;
    --bg-app: #1c2128;
  }
  body { background: var(--ac-canvas); font: 12px/1.35 "Segoe UI", system-ui, sans-serif; }
  .lcad-shell {
    grid-template-columns: minmax(0, 1fr) var(--sidebar-w);
    grid-template-rows: var(--header-h) var(--ribbon-h) var(--doc-h) minmax(0, 1fr) var(--layout-h) var(--status-h);
    grid-template-areas: 'header header' 'ribbon ribbon' 'tabs tabs' 'canvas sidebar' 'layouts sidebar' 'status status';
  }
  .lcad-shell.sidebar-collapsed { grid-template-columns: minmax(0, 1fr) 0; }
  /* A barra de título foi removida no desktop: marca e abas dividem a mesma linha; os comandos ficam na faixa. */
  .lcad-header { display: none; }
  .ribbon-brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 14px; padding: 0 16px 0 10px; display: flex; align-items: center; letter-spacing: -.2px; }
  .ribbon-brand b { color: #4cc2ff; font-size: 11px; margin-left: 4px; }
  .lcad-header { background: var(--ac-title); border-bottom: 1px solid var(--ac-border); padding: 0 8px; gap: 10px; }
  .brand-logo { font-size: 15px; color: #fff; letter-spacing: 0; }
  .brand-logo b { color: #4cc2ff; }
  .brand-title { display: none; }
  /* Os botões do topo ficam na faixa de opções; aqui só marca e título do desenho (sem duplicar comandos). */
  .header-toolbar { display: none; }
  .header-toolbar-old { margin-left: auto; align-items: center; gap: 2px; }
  .header-toolbar .btn { background: transparent; border: 1px solid transparent; border-radius: 2px; color: var(--ac-text); padding: 3px 8px; font-size: 11.5px; }
  .header-toolbar .btn:hover { background: #ffffff1c; border-color: #ffffff22; }
  .header-toolbar .btn-primary { background: var(--ac-blue); color: #fff; border-color: var(--ac-blue); }
  .header-toolbar .btn-field.active { background: #f59e0b; color: #111; }
  /* Ribbon */
  .ribbon { grid-area: ribbon; display: flex; flex-direction: column; min-height: 0; background: var(--ac-ribbon); border-bottom: 1px solid var(--ac-border); }
  .ribbon-tabs { display: flex; height: 26px; background: var(--ac-title); padding-left: 6px; gap: 1px; flex: none; }
  .ribbon-tab { background: transparent; border: 0; color: #cbd2dc; padding: 0 14px; font-size: 12px; border-radius: 2px 2px 0 0; }
  .ribbon-tab:hover { background: #ffffff14; }
  .ribbon-tab.active { background: var(--ac-ribbon-panel); color: #1b1f24; font-weight: 600; }
  .ribbon-body { flex: 1; min-height: 0; background: var(--ac-ribbon-panel); display: flex; overflow-x: auto; overflow-y: hidden; color: #1b1f24; }
  .ribbon-panel { display: none; height: 100%; }
  .ribbon-panel.active { display: flex; }
  .rb-group { display: flex; flex-direction: column; border-right: 1px solid #c9ccd1; padding: 3px 6px 0; min-width: 0; flex: none; }
  .rb-items { flex: 1; display: grid; grid-auto-flow: column; grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 0 2px; align-content: center; min-height: 0; }
  .rb-items.big { grid-template-rows: 1fr; }
  .rb-label { text-align: center; font-size: 10.5px; color: #4a525c; padding: 2px 0 3px; border-top: 1px solid #dcdfe3; letter-spacing: .2px; }
  .rb-btn { display: flex; align-items: center; gap: 5px; background: transparent; border: 1px solid transparent; border-radius: 2px; padding: 0 6px; height: 22px; color: #1b1f24; font-size: 11.5px; text-align: left; white-space: nowrap; }
  .rb-btn .ic { width: 18px; text-align: center; font: 600 15px/1 var(--font-mono); color: #1f6fb2; flex: none; display: inline-grid; place-items: center; }
  .rb-btn .ic svg { width: 18px; height: 18px; stroke: #1f6fb2; fill: none; stroke-width: 1.6; }
  .rb-btn:hover { background: #dbe9f6; border-color: #9cc3e5; }
  .rb-btn.active { background: #bcd8f1; border-color: #5aa0d8; }
  .rb-btn.big { flex-direction: column; justify-content: center; height: 100%; min-width: 58px; gap: 3px; padding: 4px 6px; }
  .rb-btn.big .ic { font-size: 26px; width: 34px; height: 30px; }
  .rb-btn.big .ic svg { width: 30px; height: 30px; }
  .rb-btn.big span.t { font-size: 11px; }
  /* Abas de documento */
  .doc-tabs { grid-area: tabs; display: flex; align-items: flex-end; background: #1c2128; padding-left: 4px; gap: 2px; border-bottom: 1px solid #000; }
  .doc-tab { background: #2b3037; border: 1px solid #14181d; border-bottom: 0; color: var(--ac-muted); padding: 0 12px; height: 22px; font-size: 11.5px; border-radius: 3px 3px 0 0; display: inline-flex; gap: 8px; align-items: center; }
  .doc-tab.active { background: var(--ac-canvas); color: #fff; height: 24px; }
  .doc-tab i { font-style: normal; opacity: .6; }
  .doc-new { padding: 0 9px; }
  /* Área de desenho */
  .lcad-viewport { background: var(--ac-canvas); cursor: none; border: 1px solid #0d1014; }
  .lcad-toolbar { display: none; }
  .viewport-overlay-top { top: 8px; left: 10px; }
  .hud-chip { background: #1c2128c0; border-color: #ffffff1a; color: var(--ac-muted); border-radius: 2px; }
  .hud-chip strong { color: #fff; }
  /* Barra de navegação à direita do desenho */
  .nav-bar { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; background: #2b3037d9; border: 1px solid #ffffff22; border-radius: 3px; z-index: 6; }
  .nav-bar button { width: 30px; height: 30px; background: transparent; border: 0; border-bottom: 1px solid #ffffff14; color: #dfe5ec; font-size: 15px; }
  .nav-bar button:last-child { border-bottom: 0; }
  .nav-bar button:hover { background: #ffffff22; }
  .nav-bar button.active { background: var(--ac-blue); }
  /* Linha de comando flutuante sobre o desenho */
  .lcad-cmdline { grid-area: canvas; align-self: end; justify-self: start; z-index: 8; width: min(640px, calc(100% - 140px)); margin: 0 0 8px 76px; background: #1c2128e6; border: 1px solid #ffffff2a; border-radius: 2px; pointer-events: auto; }
  .cmd-history { max-height: 72px; font: 11.5px/1.3 Consolas, ui-monospace, monospace; color: #b9c2ce; background: transparent; border: 0; }
  .cmd-row { border-top: 1px solid #ffffff1a; background: #12161b; display: flex; align-items: center; gap: 6px; padding: 2px 6px; }
  .cmd-label { color: #7fb8e8; font: 11px Consolas, monospace; }
  .cmd-input { background: transparent; border: 0; color: #fff; font: 12px Consolas, monospace; min-width: 90px; }
  #commandPrompt { color: #9aa4b2; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* Paleta de propriedades (direita) */
  .lcad-sidebar { background: var(--ac-palette); border-left: 1px solid var(--ac-border); color: var(--ac-text); }
  .palette-title { background: #20252b; padding: 5px 10px; font-size: 10.5px; letter-spacing: 1.4px; color: #cdd5df; border-bottom: 1px solid #000; position: sticky; top: 0; z-index: 2; }
  .sidebar-section { border-bottom: 1px solid #1c2127; }
  .section-header { background: #3a424c; color: #e7ecf2; font-size: 11.5px; padding: 4px 10px; text-transform: none; }
  .ad-slot { margin: 10px; border: 1px solid #ffffff1c; display: flex; flex-direction: column; color: #7b8593; font-size: 11px; background: #262b32; contain: layout paint; }
.ad-label { padding: 2px 8px; font-size: 10px; letter-spacing: .6px; text-transform: uppercase; color: #8a94a3; border-bottom: 1px solid #ffffff14; }
.ad-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px; }
.ad-body iframe { border: 0; max-width: 100%; }
.ad-house { display: grid; gap: 6px; text-align: center; color: #e6e9ee; text-decoration: none; }
.ad-house img { max-width: 100%; height: auto; }
.ad-consent-text { text-align: center; color: #aab3bf; }
  .ad-slot[hidden] { display: none; }
  /* Abas Modelo/Layout */
  .layout-tabs { grid-area: layouts; display: flex; align-items: center; background: #1c2128; border-top: 1px solid #000; padding-left: 4px; }
  .layout-tab { background: transparent; border: 0; color: #aab3bf; padding: 0 14px; height: 100%; font-size: 11.5px; }
  .layout-tab.active { background: var(--ac-canvas); color: #fff; border-top: 2px solid var(--ac-blue); }
  .layout-tab:disabled { opacity: .45; cursor: not-allowed; }
  /* Barra de status */
  .lcad-status { background: var(--ac-title); border-top: 1px solid #000; color: var(--ac-text); font: 11.5px Consolas, ui-monospace, monospace; padding: 0 8px; }
  #statusCoords { min-width: 190px; color: #fff; }
  .status-pill { background: transparent; border: 0; border-radius: 2px; color: #7c8794; font: 600 10.5px "Segoe UI", sans-serif; padding: 3px 7px; letter-spacing: .3px; }
  .status-pill.on { background: #0b84d8; color: #fff; }
  .status-pill:hover { background: #ffffff1f; }

/* Tela inicial (aba Início) */
.start-page { position: absolute; inset: 0; z-index: 30; background: #1c2128; overflow: auto; color: #e6e9ee; }
.start-inner { max-width: 880px; margin: 0 auto; padding: 48px 24px; }
.start-inner h1 { font-size: 30px; font-weight: 600; letter-spacing: -.5px; }
.start-inner h1 b { color: #4cc2ff; font-size: 16px; }
.start-inner h2 { font-size: 13px; font-weight: 600; color: #aab3bf; margin: 34px 0 10px; text-transform: uppercase; letter-spacing: 1px; }
.start-sub { color: #9aa4b2; margin: 6px 0 26px; }
.start-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.start-card { width: 230px; display: grid; gap: 4px; text-align: left; padding: 18px; background: #2b3037; border: 1px solid #3a424c; border-radius: 4px; }
.start-card:hover { border-color: #0b84d8; background: #313843; }
.start-card .sc-ic { font-size: 26px; color: #4cc2ff; }
.start-card strong { font-size: 14px; }
.start-card small { color: #9aa4b2; font-size: 11.5px; }
.start-card[hidden] { display: none; }
.start-recents { display: grid; gap: 6px; }
.start-recent { display: flex; justify-content: space-between; gap: 14px; text-align: left; padding: 10px 14px; background: #262b32; border: 1px solid #333b45; border-radius: 3px; }
.start-recent:hover { border-color: #0b84d8; }
.start-recent small { color: #9aa4b2; }
.doc-tab[hidden] { display: none; }
.doc-tab i { cursor: pointer; padding: 0 3px; border-radius: 2px; }
.doc-tab i:hover { background: #ffffff2a; opacity: 1; }

.start-row { display: flex; gap: 6px; }
.start-row .start-recent { flex: 1; }
.start-del { padding: 0 14px; background: #3a2226; border: 1px solid #5b2f35; color: #ffb4bb; border-radius: 3px; }
.start-del:hover { background: #5b2f35; }

/* Plotar */
.plot-dialog { border: 1px solid #3a424c; background: #2b3037; color: #e6e9ee; padding: 0; width: min(960px, 96vw); border-radius: 4px; }
.plot-dialog::backdrop { background: #000a; }
.plot-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: #20252b; border-bottom: 1px solid #000; }
.plot-body { display: flex; gap: 14px; padding: 12px; }
.plot-cols { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-content: start; }
.plot-cols fieldset { border: 1px solid #3f4752; padding: 6px 10px 8px; display: grid; gap: 6px; }
.plot-cols legend { padding: 0 4px; color: #9fb4cc; font-size: 11px; }
.plot-cols label { display: grid; gap: 2px; font-size: 11.5px; color: #cdd5df; }
.plot-cols input[type=number], .plot-cols select { background: #1c2128; border: 1px solid #434b57; color: #e6e9ee; padding: 3px 5px; border-radius: 2px; }
.plot-cols label:has(> input[type=checkbox]), .plot-cols label:has(> input[type=radio]) { display: flex; gap: 6px; align-items: center; }
.plot-row { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.plot-preview { width: 372px; display: grid; gap: 6px; align-content: start; }
.plot-preview canvas { width: 360px; height: 300px; background: #3a414b; border: 1px solid #00000066; }
.plot-warn { color: #fbbf24; font-size: 11px; padding-left: 16px; }
.plot-foot { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid #000; background: #20252b; }
.plot-foot .spacer { flex: 1; }
.ctx-menu { position: fixed; z-index: 100; background: #2b3037; border: 1px solid #444c57; border-radius: 3px; min-width: 190px; box-shadow: 0 6px 20px #0008; padding: 3px 0; }
.ctx-menu[hidden] { display: none; }
.ctx-menu button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 5px 14px; color: #e6e9ee; font-size: 12px; }
.ctx-menu button:hover { background: #0b84d8; }
.layout-tab.layout-add { font-size: 15px; padding: 0 12px; }

/* Progresso de importação: sobre TUDO (inclusive a tela inicial) */
.import-progress { position: fixed; inset: 0; z-index: 80; background: #000a; display: grid; place-items: center; }
.import-progress[hidden] { display: none; }
.ip-card { width: min(460px, 92vw); background: #2b3037; border: 1px solid #444c57; border-radius: 4px; padding: 18px 20px; display: grid; gap: 10px; box-shadow: 0 10px 40px #000a; }
.ip-card strong { font-size: 14px; overflow-wrap: anywhere; }
.ip-msg { color: #aab3bf; font-size: 12px; min-height: 1.2em; }
.ip-bar { height: 10px; background: #1c2128; border: 1px solid #3a424c; border-radius: 6px; overflow: hidden; }
.ip-bar i { display: block; height: 100%; width: 0; background: #0b84d8; transition: width .15s linear; }
.ip-bar.indeterminate i { width: 35%; animation: ip-slide 1.1s ease-in-out infinite; }
@keyframes ip-slide { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }
.ip-foot { display: flex; justify-content: space-between; align-items: center; }
#importPercent { font: 600 13px Consolas, monospace; color: #fff; }
.msg-dialog { background: #2b3037; color: #e6e9ee; border: 1px solid #5b2f35; border-radius: 4px; padding: 18px 20px; width: min(520px, 92vw); }
.msg-dialog::backdrop { background: #000a; }
.msg-dialog h2 { font-size: 15px; color: #ffb4bb; margin-bottom: 8px; }
.msg-dialog p { margin: 6px 0; overflow-wrap: anywhere; }
