/* ===== Planea — Plane-inspired internal portal ===== */
:root {
  /* Accent */
  --accent: #3b5bdb;
  --accent-hover: #364fc7;
  --accent-soft: #edf0fd;
  --accent-soft-2: #e0e6fb;

  /* Neutrals (warm-cool neutral grays, Plane-like) */
  --bg: #ffffff;
  --surface: #ffffff;
  --bg-sidebar: #fbfbfb;
  --bg-subtle: #f7f7f8;
  --bg-hover: #f1f1f3;
  --bg-active: #ececef;
  --track: #efeff1;

  --border: #e9e9ec;
  --border-strong: #dcdce1;

  --text: #1c1c1f;
  --text-2: #5c5c66;
  --text-3: #8a8a94;
  --text-4: #b4b4bd;

  /* Status / priority colors */
  --green: #15a565;
  --green-soft: #e6f6ee;
  --orange: #e8870c;
  --orange-soft: #fcefd9;
  --red: #e03131;
  --red-soft: #fbe6e6;
  --blue: #3b5bdb;
  --purple: #7048e8;
  --gray: #b4b4bd;

  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(20,20,30,.05), 0 1px 3px rgba(20,20,30,.04);
  --shadow-md: 0 4px 16px rgba(20,20,30,.08), 0 1px 4px rgba(20,20,30,.05);
  --shadow-lg: 0 12px 40px rgba(20,20,30,.14), 0 2px 8px rgba(20,20,30,.06);

  --sidebar-w: 264px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

/* ===== Dark theme ===== */
[data-theme="dark"] {
  --bg: #0f0f12;
  --surface: #1a1a1e;
  --bg-sidebar: #141417;
  --bg-subtle: #202024;
  --bg-hover: #26262b;
  --bg-active: #2d2d33;
  --track: #2d2d33;

  --border: #2a2a30;
  --border-strong: #3a3a42;

  --text: #ededf0;
  --text-2: #b2b2bc;
  --text-3: #8a8a94;
  --text-4: #62626b;

  --accent-soft: rgba(99,128,237,.16);
  --accent-soft-2: rgba(99,128,237,.30);

  --green-soft: rgba(21,165,101,.16);
  --orange-soft: rgba(232,135,12,.16);
  --red-soft: rgba(224,49,49,.16);

  --shadow-sm: 0 1px 2px rgba(0,0,0,.45);
  --shadow-md: 0 4px 16px rgba(0,0,0,.5), 0 1px 4px rgba(0,0,0,.4);
  --shadow-lg: 0 14px 44px rgba(0,0,0,.6), 0 2px 10px rgba(0,0,0,.5);
}
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #3a3a42; background-clip: padding-box; }
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #4a4a54; background-clip: padding-box; }
[data-theme="dark"] .doc-body mark { color: #1c1c1f; }
[data-theme="dark"] img.avatar-photo { filter: none; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv02","cv03","cv04","cv11";
  font-size: 14px;
  line-height: 1.45;
}
#root { height: 100%; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
::selection { background: var(--accent-soft-2); }

/* scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #dadade; border-radius: 8px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #c4c4ca; background-clip: padding-box; border: 3px solid transparent; }
::-webkit-scrollbar-track { background: transparent; }

/* ===== generic ===== */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 13px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--bg); color: var(--text); font-size: 13px; font-weight: 500;
  transition: background .12s, border-color .12s, box-shadow .12s;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-hover); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--bg-hover); }
.btn.sm { height: 28px; padding: 0 9px; font-size: 12.5px; }
.btn.icon { width: 30px; padding: 0; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.input {
  width: 100%; height: 40px; padding: 0 13px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--bg); font-size: 14px; color: var(--text);
  transition: border-color .12s, box-shadow .12s;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder { color: var(--text-4); }

.label { font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 6px; display: block; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 9px; border-radius: 6px;
  font-size: 12px; font-weight: 500; background: var(--bg-subtle); color: var(--text-2);
  border: 1px solid var(--border); white-space: nowrap; max-width: 100%; overflow: hidden;
}
.chip > span:not(.dot) { overflow: hidden; text-overflow: ellipsis; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

.fade-in { animation: fadeIn .22s ease; }
@keyframes fadeIn { from { transform: translateY(5px);} to {transform:none;} }
.scale-in { animation: scaleIn .16s cubic-bezier(.2,.7,.3,1); }
@keyframes scaleIn { from { transform: scale(.975);} to {transform:none;} }
/* slide-in for secondary menus / dropdowns */
.dv-pop { animation: dvPop .19s cubic-bezier(.22,.68,.32,1); transform-origin: top; }
@keyframes dvPop { from { opacity:0; transform: translateY(-7px) scale(.985); } to { opacity:1; transform:none; } }
.dv-fly { animation: dvFly .17s cubic-bezier(.22,.68,.32,1); }
@keyframes dvFly { from { opacity:0; transform: translateX(-8px); } to { opacity:1; transform:none; } }

/* avatar */
.avatar { display:inline-flex; align-items:center; justify-content:center; border-radius:50%; color:#fff; font-weight:600; flex:none; }

.area-card:hover, .client-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }

.hover-row { border-radius: 7px; transition: background .1s; }
.hover-row:hover { background: var(--bg-subtle); }

.ai-dot { width:6px; height:6px; border-radius:50%; background:var(--text-4); display:inline-block; animation: aiPulse 1s infinite ease-in-out; }
@keyframes aiPulse { 0%,60%,100% { opacity:.3; transform:translateY(0);} 30% { opacity:1; transform:translateY(-3px);} }

/* drawer */
.drawer-bg { position:fixed; inset:0; background:rgba(20,20,30,.28); z-index:150; animation: fadeIn .18s ease; }
.drawer-bg.closing { animation: bgFadeOut .26s ease forwards; }
.drawer { position:fixed; top:0; right:0; bottom:0; width:480px; max-width:92vw; background:var(--surface); z-index:151; box-shadow:var(--shadow-lg); display:flex; flex-direction:column; animation: slideIn .26s cubic-bezier(.4,0,.2,1); }
.drawer.closing { animation: slideOut .26s cubic-bezier(.4,0,.2,1) forwards; }
@keyframes slideIn { from { transform:translateX(100%);} to { transform:none;} }
@keyframes slideOut { from { transform:none;} to { transform:translateX(100%);} }
@keyframes bgFadeOut { from { opacity:1;} to { opacity:0;} }

/* table rows */
.task-row:hover { background: var(--bg-subtle); }
.cell-edit { height: 100%; display:flex; align-items:center; }
.cell-edit:hover { background: var(--bg-hover); box-shadow: inset 0 0 0 1px var(--border); border-radius: 6px; }

.shimmer { background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.sel-compact { display:inline-flex; align-items:center; gap:6px; height:30px; padding:0 8px; border:1px solid transparent; background:transparent; border-radius:6px; font-size:13px; font-weight:450; color:var(--text); max-width:100%; cursor:pointer; transition:background .1s; }
.sel-compact:hover { background: var(--bg-hover); }
.sel-compact .muted-ph { color: var(--text-4); }
.date-subtle { height:30px; font-size:13px; border:1px solid transparent; background:transparent; border-radius:6px; padding:0 6px; color:var(--text); transition:background .1s; }
.date-subtle:hover { background: var(--bg-hover); }
.date-subtle:focus { background:var(--surface); border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); }

.kanban-add { opacity: 0; transition: opacity .12s, background .1s; }
.kanban-col:hover .kanban-add { opacity: 1; }
.kanban-add:hover, .kanban-empty:hover { background: var(--bg-hover) !important; color: var(--text-2) !important; }

/* document editor body */
.doc-body h1 { font-size: 27px; font-weight: 700; letter-spacing: -.02em; margin: 22px 0 8px; }
.doc-body h2 { font-size: 21px; font-weight: 650; letter-spacing: -.01em; margin: 20px 0 6px; }
.doc-body h3 { font-size: 17px; font-weight: 600; margin: 16px 0 4px; }
.doc-body p { margin: 8px 0; }
.doc-body ul, .doc-body ol { margin: 8px 0; padding-left: 26px; }
.doc-body li { margin: 3px 0; }
.doc-body blockquote { margin: 12px 0; padding: 4px 0 4px 16px; border-left: 3px solid var(--accent); color: var(--text-2); }
.doc-body hr { border: none; border-top: 1px solid var(--border-strong); margin: 22px 0; }
.doc-body pre { background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13.5px; overflow-x: auto; margin: 12px 0; }
.doc-body mark { background: #fff3bf; padding: 1px 2px; border-radius: 3px; }
.doc-body:empty::before { content: "Empieza a escribir, o pulsa / para insertar bloques..."; color: var(--text-4); }

/* tooltip-ish muted */
.muted { color: var(--text-3); }
.tnum { font-variant-numeric: tabular-nums; }

/* ===== Drive ===== */
.dv-card { transition: box-shadow .12s, border-color .12s, background .1s; }
.dv-card:hover { box-shadow: var(--shadow-sm); }
.dv-card .dv-check { transition: opacity .1s; display: inline-flex; }
.dv-card:hover .dv-check { opacity: 1 !important; }
.dv-folder { transition: background .1s, border-color .1s; }
.dv-folder:not(.sel):hover { background: var(--bg-hover) !important; }
.dv-fico-folder { display: flex; }
.dv-fico-circle { display: none; }
.dv-fico:hover .dv-fico-folder { display: none; }
.dv-fico:hover .dv-fico-circle { display: flex; }
.dv-scroll input[type="range"] { height: 4px; }
