/* ===========================
   THEME + TOKENS
=========================== */
:root{
  --radius: 16px;
  --radius-sm: 12px;
  --radius-lg: 22px;

  --shadow: 0 20px 60px rgba(0,0,0,0.35);
  --shadow-soft: 0 10px 30px rgba(0,0,0,0.25);

  --blur: 0px;

  --accent: #FF8A2A;
  --accent-2: #FFA24D;
  --ok: #4ADE80;
  --warn: #FFB020;
  --bad: #FF5A5F;

  --font: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --bg: #141519;
  --bg2: #0f1113;
  --panel: rgba(255,255,255,0.06);
  --panel2: rgba(255,255,255,0.04);
  --border: rgba(255,255,255,0.10);
  --border2: rgba(255,255,255,0.14);
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.62);
  --muted2: rgba(255,255,255,0.46);

  --field: rgba(255,255,255,0.06);
  --field2: rgba(255,255,255,0.04);
  --fieldBorder: rgba(255,255,255,0.14);

  --link: rgba(255,255,255,0.85);

  --overlay: rgba(0,0,0,0.55);
}

html[data-theme="light"]{
  --bg: #F5F6F7;
  --bg2: #ECEEF1;

  --panel: rgba(47,47,51,0.06);
  --panel2: rgba(47,47,51,0.035);
  --border: rgba(47,47,51,0.14);
  --border2: rgba(47,47,51,0.20);

  --text: rgba(47,47,51,0.95);
  --muted: rgba(47,47,51,0.60);
  --muted2: rgba(47,47,51,0.42);

  --field: rgba(255,255,255,0.58);
  --field2: rgba(255,255,255,0.76);
  --fieldBorder: rgba(47,47,51,0.20);

  --overlay: rgba(47,47,51,0.36);
  --shadow: 0 20px 60px rgba(47,47,51,0.14);
  --shadow-soft: 0 10px 30px rgba(47,47,51,0.10);
}

/* System theme */
@media (prefers-color-scheme: light){
  html[data-theme="system"]{
    --bg: #F5F6F7;
    --bg2: #ECEEF1;

    --panel: rgba(47,47,51,0.06);
    --panel2: rgba(47,47,51,0.035);
    --border: rgba(47,47,51,0.14);
    --border2: rgba(47,47,51,0.20);

    --text: rgba(47,47,51,0.95);
    --muted: rgba(47,47,51,0.60);
    --muted2: rgba(47,47,51,0.42);

    --field: rgba(255,255,255,0.58);
    --field2: rgba(255,255,255,0.76);
    --fieldBorder: rgba(47,47,51,0.20);

    --overlay: rgba(47,47,51,0.36);
    --shadow: 0 20px 60px rgba(47,47,51,0.14);
    --shadow-soft: 0 10px 30px rgba(47,47,51,0.10);
  }
}

*{ box-sizing: border-box; }
html, body{ height:100%; }

*{
  scrollbar-width: thin;
  scrollbar-color: rgba(180,180,180,0.45) transparent;
}
*::-webkit-scrollbar{ width: 8px; height: 8px; }
*::-webkit-scrollbar-track{ background: transparent; }
*::-webkit-scrollbar-thumb{
  background: rgba(180,180,180,0.45);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

body{
  margin:0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  overflow-x:hidden;
  overflow-y:hidden;
}

.watermark{
  display: none;
  position: fixed;
  right: 14px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg2) 72%, transparent);
  color: var(--muted2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  z-index: 38;
  pointer-events: none;
  user-select: none;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

body.is-settings-route .watermark{
  display: inline-flex;
  align-items: center;
}

/* Respect iPhone safe area (notch) */
body{
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

/* Prevent flash while booting */
body.booting #view-login,
body.booting #view-app{
  display:none !important;
}

a{ color: var(--link); text-decoration:none; }
.hidden{ display:none !important; }

.center{
  min-height: calc((var(--vh, 1vh) * 100) - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  padding: max(20px, env(safe-area-inset-top)) 20px calc(20px + env(safe-area-inset-bottom));
}

.card{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
}

.card-lg{
  width: min(520px, 92vw);
  padding: 22px;
  border-radius: var(--radius-lg);
}

.title{
  margin:0;
  font-size: 28px;
  letter-spacing: -0.02em;
}
.muted{ color: var(--muted); }
.muted2{ color: var(--muted2); }

.empty-state{
  min-height: clamp(180px, 30vh, 250px);
  border: 1px dashed color-mix(in srgb, var(--border) 86%, transparent);
  border-radius: 20px;
  background:
    radial-gradient(circle at top, color-mix(in srgb, var(--accent) 8%, transparent), transparent 56%),
    color-mix(in srgb, var(--panel) 82%, transparent);
  display: grid;
  place-items: center;
  padding: 24px 18px;
  text-align: center;
}

.empty-state-inner{
  display: grid;
  justify-items: center;
  gap: 10px;
  max-width: 320px;
}

.empty-state-ico{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: color-mix(in srgb, var(--accent) 72%, var(--text));
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
}

.empty-state-title{
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}


.row{ display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
.spacer{ flex:1; }

.form{ display:grid; gap:12px; margin-top:14px; }

.turnstile-box{
  min-height: 65px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.label{ display:grid; gap:8px; font-size: 13px; color: var(--muted); }

.input, .textarea, .select, .file{
  width:100%;
  background: var(--field);
  border: 1px solid var(--fieldBorder);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text);
  outline: none;
  transition: border-color .18s ease, transform .18s ease, background .18s ease;
}

.select{
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  color-scheme: dark;
  padding-right: 36px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted2) 50%),
    linear-gradient(135deg, var(--muted2) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 1px),
    calc(100% - 12px) calc(50% - 1px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.select[multiple]{
  appearance: auto;
  -webkit-appearance: auto;
  -moz-appearance: auto;
  background-image: none;
  padding-right: 12px;
  background: var(--field2);
}

.native-date-select{
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border-color: rgba(255,138,42,0.45);
  font-weight: 700;
}

.native-date-select:focus{
  border-color: rgba(255,138,42,0.6);
  background: var(--field2);
  box-shadow: 0 0 0 4px rgba(255,138,42,0.16);
}

.native-date-select option{
  background: #1f222a;
  color: #f7f8fb;
}

html[data-theme="light"] .native-date-select option{
  background: #ffffff;
  color: #121417;
}

.select:disabled{
  opacity: .72;
  cursor: not-allowed;
}

.select option,
.select optgroup{
  background: #f3f4f6;
  color: #121417;
}

html[data-theme="light"] .select{ color-scheme: light; }

.input:focus, .textarea:focus, .select:focus{
  border-color: rgba(255,138,42,0.55);
  background: var(--field2);
  box-shadow: 0 0 0 4px rgba(255,138,42,0.15);
}

.textarea{ min-height: 90px; resize: vertical; }
.file{ padding: 9px 12px; }

.file-hidden{
  position: absolute !important;
  width: 0 !important;
  height: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.upload-box{
  width: 100%;
  border: 1px dashed rgba(255,138,42,0.45);
  background: rgba(255,255,255,0.03);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  transition: border-color .18s ease, background .18s ease, transform .12s ease;
}

.upload-box:hover{
  border-color: rgba(255,138,42,0.65);
  background: rgba(255,138,42,0.08);
  transform: translateY(-1px);
}

.upload-box.dragover{
  border-color: rgba(255,138,42,0.78);
  background: rgba(255,138,42,0.14);
  box-shadow: 0 0 0 3px rgba(255,138,42,0.14);
}

.upload-box.upload-box-compact{
  padding: 10px 11px;
  border-radius: 12px;
}

.brand-preview-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.brand-preview-box{
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  min-height: 72px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.brand-preview-box.has-image{
  border-color: rgba(255,138,42,0.35);
}

.brand-preview-logo img{
  width: 100%;
  height: 72px;
  object-fit: cover;
}

.brand-preview-favicon img{
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 8px;
}

.upload-ico{
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255,138,42,0.16);
}
.upload-ico svg{
  width: 16px;
  height: 16px;
  display: block;
}

.upload-copy{ display: grid; gap: 2px; min-width: 0; }
.upload-copy strong{ font-size: 14px; }
.upload-copy .muted2{ font-size: 12px; }

.upload-list{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  font-size: 12px;
}

.upload-item{
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.upload-item-remove{
  border: 0;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255,90,95,0.16);
  color: rgba(255,255,255,0.9);
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.upload-item-remove:hover{
  background: rgba(255,90,95,0.28);
}

.btn{
  border: 1px solid var(--border2);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  cursor:pointer;
  transition: transform .12s ease, background .18s ease, border-color .18s ease;
  font-weight: 650;
  letter-spacing: -0.01em;
  user-select:none;
}
.btn:hover{ transform: translateY(-1px); border-color: rgba(255,255,255,0.22); }
.btn:active{ transform: translateY(0); }

.btn-primary{
  border-color: #D88B3A;
  background: rgba(216, 140, 58, 0.556);
  color: var(--text);
  box-shadow: none;
}
.btn-primary:hover{ border-color: #E3A154; background: rgba(216,139,58,0.18); }

#btn-generate-top,
#btn-review-top{
  color: inherit;
  box-shadow: none;
}

.btn-ghost{ background: transparent; }

#dash-date-btn,
#notif-date-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#dash-date-btn span,
#notif-date-btn span{
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

#dash-date-btn svg,
#notif-date-btn svg{
  display: block;
}

.btn-danger{
  border-color: rgba(255,90,95,0.45);
  background: rgba(255,90,95,0.12);
}
.btn-danger:hover{ border-color: rgba(255,90,95,0.65); }

.error{
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,90,95,0.12);
  border: 1px solid rgba(255,90,95,0.35);
  color: rgba(255,255,255,0.9);
}
html[data-theme="light"] .error{ color: rgba(10,12,16,0.92); }

/* ===========================
   APP LAYOUT
=========================== */
.app{
  height: calc((var(--vh, 1vh) * 100) - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  display:grid;
  grid-template-columns: 300px 1fr;
  padding-left: 6px;
  overflow:hidden;
}

.sidebar{
  position: sticky;
  top: calc(env(safe-area-inset-top) + 12px);
  height: calc((var(--vh, 1vh) * 100) - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px);
  padding: 16px;
  border-right: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  display:flex;
  flex-direction: column;
  gap:14px;
  overflow: hidden;
  border-radius: 20px;
}

.sidebar-main{
  flex: 1;
  min-height: 0;
  display: grid;
  gap: 10px;
  align-content: start;
  overflow-y: auto;
  padding-top: 2px;
  padding-bottom: 2px;
  padding-right: 4px;
}

.brand{
  display:flex;
  gap: 12px;
  align-items:center;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
}
.brand-dot{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.18), transparent 55%),
    linear-gradient(180deg, rgba(255,138,42,0.95), rgba(255,138,42,0.6));
  box-shadow: none;
}
.brand-dot.has-image{
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: none;
}
.brand-title{ font-weight: 850; letter-spacing:-0.03em; }
.brand-sub{ font-size: 12px; color: var(--muted); margin-top:2px; }

.nav{ display:grid; gap:8px; }
.nav-item{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid transparent;
  color: var(--text);
  background: transparent;
  transition: background .18s ease, border-color .18s ease, transform .12s ease;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.nav-item:hover{
  background: rgba(255,255,255,0.04);
  border-color: var(--border);
  transform: translateY(-1px);
}
.nav-item.active{
  background: rgba(255,138,42,0.14);
  border-color: rgba(255,138,42,0.32);
}
.nav svg{ width: 18px; height: 18px; opacity: 0.9; }

.nav-sep{
  margin: 6px 0 2px 0;
  padding: 8px 12px 0 12px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted2);
}

.nav-item.area-item{
  font-weight: 600;
  font-size: 13px;
  padding-left: 18px;
}

.nav-item.setting-item{
  padding-left: 18px;
  font-size: 12.5px;
}

.nav-settings-group{
  gap: 4px;
}
.nav-area-ico{
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.nav-area-ico svg{ width: 14px; height: 14px; }

.nav-area-group{
  margin: 0 0 0 10px;
  padding-left: 10px;
  border-left: 1px solid var(--border);
  display: grid;
  gap: 6px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height .2s ease, opacity .18s ease;
}
.nav-area-group.open{
  margin: 4px 0 6px 10px;
  max-height: 430px;
  padding-top: 2px;
  padding-bottom: 2px;
  overflow: visible;
  opacity: 1;
}

.sidebar-footer{
  display:grid;
  gap:12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  overflow: visible;
}

.profile{
  display:flex;
  gap: 12px;
  align-items:center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
}
.avatar{
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display:grid;
  place-items:center;
  font-weight: 900;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.25), transparent 60%),
    rgba(255,138,42,0.22);
  border: 1px solid rgba(255,138,42,0.28);
}
.avatar.has-image{
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-color: rgba(255,255,255,0.2);
}
.profile-name{ font-weight: 800; line-height: 1.1; }
.profile-sub{ font-size: 12px; color: var(--muted); margin-top: 2px; }

.logout-icon{
  margin-left: auto;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  display:grid;
  place-items:center;
  cursor:pointer;
  transition: transform .12s ease, border-color .18s ease, color .18s ease, background .18s ease;
}
.logout-icon:hover{
  transform: translateY(-1px);
  border-color: rgba(255,90,95,0.55);
  color: rgba(255,90,95,0.95);
  background: rgba(255,90,95,0.10);
}

.content{
  padding: 16px;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  height: calc((var(--vh, 1vh) * 100) - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  position: sticky;
  top: env(safe-area-inset-top);
  z-index: 5;
  transition: transform .2s ease, opacity .2s ease;
}
.topbar.topbar-hidden{
  transform: translateY(-120%);
  opacity: 0;
  pointer-events:none;
}
.crumbs{ color: var(--muted); font-size: 14px; }
.crumbs strong{ color: var(--text); font-size: 17px; font-weight: 900; letter-spacing: -0.01em; }
.topbar-right{ display:flex; gap:10px; align-items:center; flex-wrap: wrap; justify-content:flex-end; }

.search-wrap{ position: relative; }
.search{
  width: min(520px, 40vw);
  padding-left: 36px;
}
.review-search-wrap .search{
  min-height: 42px;
}
.search-icon{
  position:absolute; left: 12px; top: 50%; transform: translateY(-50%);
  opacity: 0.75;
  pointer-events:none;
}
.search-icon svg{
  display:block;
}
.select{ min-width: 180px; }

.native-select-hidden{
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

.custom-select{
  position: relative;
  width: 100%;
  min-width: 180px;
  z-index: 1;
}

.custom-select-trigger{
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--field);
  border: 1px solid var(--fieldBorder);
  color: var(--text);
  border-radius: 12px;
  padding: 9px 11px;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}

.custom-select.open .custom-select-trigger,
.custom-select-trigger:focus{
  border-color: rgba(255,138,42,0.55);
  background: var(--field2);
  box-shadow: 0 0 0 4px rgba(255,138,42,0.15);
}

.custom-select-caret{ color: var(--muted2); font-size: 12px; }
.custom-select-value{ color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.custom-select-entry{
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  max-width: 100%;
}

.custom-select-entry-label{
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-dot{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
  flex: 0 0 auto;
}

.custom-select-dot.dot-all{
  background: color-mix(in srgb, var(--muted2) 72%, var(--accent));
}

.custom-select-dot.dot-total{
  background: rgba(123, 0, 255, 0.95);
}

.custom-select-dot.dot-expired{
  background: rgba(255, 22, 22, 0.95);
}

.custom-select-dot.dot-pending{
  background: rgba(255,176,32,0.92);
}

.custom-select-dot.dot-retrabajo{
  background: rgba(255,138,42,0.94);
}

.custom-select-dot.dot-approved{
  background: rgba(74,222,128,0.95);
}

.custom-select-dot.dot-rejected{
  background: rgba(255,90,95,0.95);
}

.custom-select-menu{
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 25;
  display: none;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(20,22,28,0.96);
  box-shadow: var(--shadow);
  padding: 6px;
}

.content .custom-select-menu,
.modal .custom-select-menu{
  background: rgba(53, 54, 56, 0.926);
}

.custom-select.open-up .custom-select-menu{
  top: auto;
  bottom: calc(100% + 6px);
}

html[data-theme="light"] .custom-select-menu{
  background: rgba(255,255,255,0.96);
}

html[data-theme="light"] .content .custom-select-menu,
html[data-theme="light"] .modal .custom-select-menu{
  background: rgba(255,255,255,0.98);
}

.custom-select.open .custom-select-menu{ display: grid; gap: 4px; }
.custom-select.open{ z-index: 40; }

.custom-select-option{
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  text-align: left;
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 14px;
  cursor: pointer;
}

.custom-select-option:hover{
  background: rgba(255,255,255,0.06);
  border-color: var(--border);
}

.custom-select-option.active{
  border-color: rgba(255,138,42,0.45);
  background: rgba(255,138,42,0.14);
}

.custom-select.disabled .custom-select-trigger{
  opacity: .72;
  cursor: not-allowed;
}

.hamburger{
  display:none;
  border-radius: 14px;
  padding: 10px 12px;
}

.menu-ico{ display:inline-grid; place-items:center; }
.menu-label{ display:inline; }

.gen-plus{ display:none; }
.gen-label{ display:inline; }
.review-ico{ display:none; }
.review-label{ display:inline; }

.page{
  margin-top: 16px;
  display:grid;
  gap: 14px;
  min-width: 0;
}

.card-pad{ padding: 16px; }

.dashboard-card{
  display: flex;
  flex-direction: column;
  min-height: calc((var(--vh, 1vh) * 100) - 150px);
}

.dashboard-list{
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  position: relative;
}

.dashboard-card .requests-scroll{
  flex: 1;
  max-height: min(50vh, 1000px);
  padding-bottom: 16px;
}


.grid2{
  display:grid;
  grid-template-columns: 1.1fr 1.4fr;
  gap: 14px;
}
.grid3{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.stats-row{
  display:grid;
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  gap: 12px;
}

.stat-card{
  padding: 14px;
  border-radius: 18px;
  cursor: pointer;
  transition: transform .12s ease, border-color .18s ease, background .18s ease;
}
.stat-card:hover{ transform: translateY(-1px); border-color: rgba(255,255,255,0.2); }
.stat-card.active{ border-color: rgba(255,138,42,0.45); background: rgba(255,138,42,0.10); }

.stat-label{
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.stat-dot{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}

.stat-dot-all{ background: rgba(123, 0, 255, 0.95); }
.stat-dot-process{ background: rgba(255,176,32,0.9); }
.stat-dot-approved{ background: rgba(74,222,128,0.95); }
.stat-dot-retrabajo{ background: rgba(255,138,42,0.95); }
.stat-dot-returned{ background: rgba(255,90,95,0.9); }
.stat-dot-expired{ background: rgba(255, 22, 22, 0.95); }

.area-picker-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.area-pick-card{
  width: 100%;
  text-align: left;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
  border-radius: 14px;
}

.area-pick-ico{
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  display:grid;
  place-items:center;
}

.h2{
  margin:0 0 6px 0;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.page .h2{ display:none; }
.sub{
  margin:0;
  color: var(--muted);
  font-size: 13px;
}

.sub-title{
  margin:0;
  color: var(--text);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.settings-section-title{
  font-size: 12px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted2);
  font-weight: 800;
}

.users-table-wrap{
  overflow-x: auto;
}

.users-table{
  border-spacing: 0 8px;
}

.users-table tbody tr td{
  padding-top: 10px;
  padding-bottom: 10px;
}

.users-table .btn{
  white-space: nowrap;
}

.checklist{
  display: grid;
  gap: 8px;
  max-height: 210px;
  overflow: auto;
  padding: 2px;
}

.check-item{
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  padding: 9px 10px;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}

.check-item:hover{
  border-color: rgba(255,138,42,0.45);
  background: rgba(255,138,42,0.08);
}

.check-item input{
  width: 15px;
  height: 15px;
  accent-color: rgb(255,138,42);
}

.check-item .txt{
  font-size: 13px;
  color: var(--text);
}

.checklist.disabled{
  opacity: .62;
  pointer-events: none;
}

.chips{ display:flex; flex-wrap:wrap; gap:8px; margin-top: 10px; }
.chip{
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  font-size: 12px;
  color: var(--muted);
}
button.chip{ cursor:pointer; }
.chip.active{
  color: var(--text);
  border-color: rgba(255,138,42,0.45);
  background: rgba(255,138,42,0.14);
}

#review-filter-chips{
  align-items: stretch;
  margin-top: 0;
}

#review-filter-chips .chip{
  min-height: 42px;
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.chip-with-ico .chip-area-content{
  display: inline-grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.chip-area-ico{
  width: 14px;
  height: 14px;
  display: grid;
  place-items: center;
  color: currentColor;
  flex: 0 0 auto;
}

.chip-area-ico svg{
  width: 14px;
  height: 14px;
  display: block;
}

.chip-area-label{
  min-width: 0;
}

.review-filter-toolbar{
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.review-filter-main{
  min-width: 0;
}

.review-filter-toolbar .review-search-wrap{
  min-width: 0;
}

.review-filter-toolbar .review-search-wrap .search{
  width: 100%;
}

.review-filter-date-mobile{
  display: none;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.review-status-filter{
  width: clamp(196px, 20vw, 250px);
}

.review-status-filter .select{
  width: 100%;
}

.review-status-filter .custom-select{
  min-width: 0;
  width: 100%;
}

.review-status-filter .custom-select-trigger{
  min-height: 42px;
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.03);
  border-color: var(--border);
  font-weight: 650;
}

.review-status-filter .custom-select-value{
  font-weight: 650;
}

.review-status-filter .custom-select-menu{
  min-width: 100%;
}

.priority-chip{ font-weight: 700; }
.priority-chip.priority-low.active{
  border-color: color-mix(in srgb, var(--ok) 55%, transparent);
  background: color-mix(in srgb, var(--ok) 20%, transparent);
}
.priority-chip.priority-normal.active{
  border-color: color-mix(in srgb, var(--warn) 55%, transparent);
  background: color-mix(in srgb, var(--warn) 20%, transparent);
}
.priority-chip.priority-urgent.active{
  border-color: color-mix(in srgb, var(--bad) 60%, transparent);
  background: color-mix(in srgb, var(--bad) 22%, transparent);
}

.badge{
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.badge.status-en_proceso{ border-color: rgba(255,176,32,0.42); background: rgba(255,176,32,0.12); }
.badge.status-aprobado{ border-color: rgba(74,222,128,0.35); background: rgba(74,222,128,0.12); }
.badge.status-retrabajo{ border-color: rgba(255,138,42,0.45); background: rgba(255,138,42,0.14); }
.badge.status-rechazado{ border-color: rgba(255,90,95,0.65); background: rgba(255,90,95,0.18); }

.badge.sla-new{ border-color: rgba(64,156,255,0.45); background: rgba(64,156,255,0.14); }
.badge.sla-ok{ border-color: rgba(255,176,32,0.35); background: rgba(255,176,32,0.10); }
.badge.sla-warn{ border-color: rgba(255,138,42,0.55); background: rgba(255,138,42,0.14); }
.badge.sla-bad{ border-color: rgba(255,90,95,0.55); background: rgba(255,90,95,0.14); }
.badge.priority-low{ border-color: rgba(74,222,128,0.55); background: rgba(74,222,128,0.18); }
.badge.priority-normal{ border-color: rgba(255,176,32,0.55); background: rgba(255,176,32,0.18); }
.badge.priority-urgent{ border-color: rgba(255,90,95,0.75); background: rgba(255,90,95,0.24); color: var(--text); }

.item h4,
.card-mini .pn,
.item .right .badge,
.item .right .chip,
.card-mini .top .badge,
.card-mini .top .chip,
.annual-valid,
.annual-expiry{
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table{
  width:100%;
  border-collapse: separate;
  border-spacing: 0 10px;
}
.table thead th{
  text-align:left;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  padding: 0 10px 6px 10px;
}
.table tbody tr td{
  padding: 12px 10px;
  vertical-align: middle;
}
.table tbody tr{
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor:pointer;
  transition: transform .12s ease, border-color .18s ease, background .18s ease;
  background: rgba(255,255,255,0.03);
}
.table tbody tr:hover{
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.04);
}
.mono{ font-family: var(--mono); font-size: 12px; color: var(--muted); }

.list{ display:grid; grid-template-columns: minmax(0, 1fr); gap: 10px; min-width: 0; }
.item{
  display:flex;
  gap: 12px;
  align-items:flex-start;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  cursor:pointer;
  transition: transform .12s ease, border-color .18s ease, background .18s ease;
  min-width: 0;
  overflow: visible;
}
.item:hover{ transform: translateY(-1px); border-color: rgba(255,255,255,0.18); background: rgba(255,255,255,0.04); }
.item > div:first-child{ min-width: 0; flex: 1 1 auto; }
.item h4{ margin:0; font-size: 14px; }
.item p{ margin:6px 0 0 0; font-size: 13px; color: var(--muted); }
.request-decision-meta{
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted2);
}
.request-decision-meta::before{
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.9;
  flex: 0 0 auto;
}
.request-decision-meta.status-aprobado{
  color: color-mix(in srgb, var(--ok) 78%, var(--muted));
}
.request-decision-meta.status-retrabajo{
  color: color-mix(in srgb, rgba(255,138,42,0.92) 78%, var(--muted));
}
.request-decision-meta.status-rechazado{
  color: color-mix(in srgb, var(--bad) 82%, var(--muted));
}
.item .right{ margin-left:auto; min-width:0; flex: 0 0 auto; display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.item .right.quick-review-panel{
  width: 460px;
  flex: 0 0 460px;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

.quick-review-status{
  width: auto;
  align-self: flex-end;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.quick-review-actions{
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: auto;
}

.quick-review-actions .review-action{
  padding: 6px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
}

.quick-review-actions.disabled .review-action{
  opacity: .6;
  pointer-events: none;
}

@media (max-width: 980px){
  .item .right.quick-review-panel{
    width: 100%;
    flex-basis: 100%;
  }
}

.requests-scroll{
  max-height: min(42vh, 460px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
  padding-right: 4px;
  -webkit-mask-image: none;
  mask-image: none;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

.page-fill-card{
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.page-fill-panel{
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.page-fill-scroll{
  min-height: 0;
}

@media (min-width: 981px){
  .page-fill-card .page-fill-scroll{
    flex: 1;
    max-height: none;
  }
}

.requests-scroll.has-bottom-fade{
  -webkit-mask-image: linear-gradient(
    180deg,
    #000 0,
    #000 calc(100% - 34px),
    rgba(0,0,0,0.18) calc(100% - 12px),
    transparent 100%
  );
  mask-image: linear-gradient(
    180deg,
    #000 0,
    #000 calc(100% - 34px),
    rgba(0,0,0,0.18) calc(100% - 12px),
    transparent 100%
  );
}

.requests-scroll.has-top-fade:not(.has-bottom-fade){
  -webkit-mask-image: linear-gradient(
    180deg,
    transparent 0,
    rgba(0,0,0,0.18) 12px,
    #000 34px,
    #000 100%
  );
  mask-image: linear-gradient(
    180deg,
    transparent 0,
    rgba(0,0,0,0.18) 12px,
    #000 34px,
    #000 100%
  );
}

.requests-scroll.has-top-fade.has-bottom-fade{
  -webkit-mask-image: linear-gradient(
    180deg,
    transparent 0,
    rgba(0,0,0,0.18) 12px,
    #000 34px,
    #000 calc(100% - 34px),
    rgba(0,0,0,0.18) calc(100% - 12px),
    transparent 100%
  );
  mask-image: linear-gradient(
    180deg,
    transparent 0,
    rgba(0,0,0,0.18) 12px,
    #000 34px,
    #000 calc(100% - 34px),
    rgba(0,0,0,0.18) calc(100% - 12px),
    transparent 100%
  );
}

.requests-slider{
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 300px);
  gap: 12px;
  overflow-x: auto;
  max-width: 100%;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
}

.requests-scroll{ min-width: 0; }
.notifications-scroll{ max-height: min(62vh, 700px); }

.notifications-scroll .item h4,
.notifications-scroll .item .notif-head-date,
.notifications-scroll .item .notif-meta .chip,
.notifications-scroll .item .notif-footer span{
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notifications-scroll .item{
  align-items: stretch;
}

.notifications-scroll .item .right{
  align-items: flex-start;
}

.notifications-scroll .item .right .badge{
  align-self: flex-start;
}

.notifications-scroll .notif-head{
  display: flex;
  gap: 10px;
  align-items: baseline;
  justify-content: space-between;
}

.notifications-scroll .notif-head-date{
  font-size: 12px;
  color: var(--muted2);
  flex: 0 0 auto;
}

.notifications-scroll .notif-meta{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.notifications-scroll .notif-meta .chip{
  max-width: 100%;
  font-size: 11px;
  padding: 3px 8px;
}

.notifications-scroll .notif-desc{
  min-width: 0;
  overflow: hidden;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
  overflow-wrap: anywhere;
  margin-top: 8px;
}

.notifications-scroll .notif-footer{
  margin-top: 8px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted2);
  font-size: 12px;
}

.request-slide{
  scroll-snap-align: start;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  padding: 12px;
  transition: transform .12s ease, border-color .18s ease, background .18s ease;
  cursor: pointer;
}
.request-slide:hover{
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.04);
}

/* ===========================
   KANBAN
=========================== */
.kanban{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items:start;
}

.kanban.kanban-calendar{
  grid-template-columns: repeat(3, minmax(0, 1fr));
  will-change: transform, opacity;
  transform: translateZ(0);
}

.calendar-stage{
  position: relative;
  display: grid;
  overflow: hidden;
  isolation: isolate;
  background: var(--bg2);
  border-radius: calc(var(--radius-lg) + 2px);
}

.calendar-stage .calendar-layer{
  grid-area: 1 / 1;
  position: relative;
  width: 100%;
}

.calendar-stage .calendar-layer::before{
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bg2);
  border-radius: inherit;
  z-index: 0;
}

.calendar-stage .calendar-layer > *{
  position: relative;
  z-index: 1;
}

.calendar-stage .calendar-layer-current{
  position: relative;
  z-index: 2;
}

.calendar-stage .calendar-layer-prev{
  pointer-events: none;
  z-index: 1;
}

.calendar-stage.calendar-stage-prev .calendar-layer-prev{
  animation: calendarPageOutPrev .24s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.calendar-stage.calendar-stage-prev .calendar-layer-current{
  animation: calendarPageInPrev .24s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.calendar-stage.calendar-stage-next .calendar-layer-prev{
  animation: calendarPageOutNext .24s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.calendar-stage.calendar-stage-next .calendar-layer-current{
  animation: calendarPageInNext .24s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes calendarPageInPrev{
  from{ transform: translate3d(-16%, 0, 0); opacity: 1; }
  to{ transform: translate3d(0, 0, 0); opacity: 1; }
}

@keyframes calendarPageOutPrev{
  from{ transform: translate3d(0, 0, 0); opacity: 1; }
  to{ transform: translate3d(16%, 0, 0); opacity: 1; }
}

@keyframes calendarPageInNext{
  from{ transform: translate3d(16%, 0, 0); opacity: 1; }
  to{ transform: translate3d(0, 0, 0); opacity: 1; }
}

@keyframes calendarPageOutNext{
  from{ transform: translate3d(0, 0, 0); opacity: 1; }
  to{ transform: translate3d(-16%, 0, 0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce){
  .kanban.kanban-calendar{
    will-change: auto;
    transform: none;
  }
  .calendar-stage.calendar-stage-prev .calendar-layer-prev,
  .calendar-stage.calendar-stage-prev .calendar-layer-current,
  .calendar-stage.calendar-stage-next .calendar-layer-prev,
  .calendar-stage.calendar-stage-next .calendar-layer-current{
    animation: none;
  }
}
.col{
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  border-radius: 18px;
  padding: 10px;
  min-height: 420px;
  height: auto;
  display:flex;
  flex-direction:column;
  position: relative;
}
.col.is-drop-target{
  border-color: rgba(255,138,42,0.46);
  background: rgba(255,138,42,0.07);
  box-shadow:
    inset 0 0 0 2px rgba(255,138,42,0.24),
    0 10px 28px rgba(255,138,42,0.12);
}

html[data-theme="light"] .col.is-drop-target{
  border-color: color-mix(in srgb, var(--accent) 52%, var(--border));
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--accent) 12%, var(--surface-col)),
    color-mix(in srgb, var(--accent) 7%, var(--surface-col))
  );
  box-shadow:
    inset 0 0 0 2px color-mix(in srgb, var(--accent) 28%, transparent),
    0 0 0 2px color-mix(in srgb, var(--accent) 12%, transparent),
    0 14px 30px color-mix(in srgb, var(--accent) 16%, transparent);
}

html[data-theme="light"] .col.is-drop-target .col-head{
  border-bottom-color: color-mix(in srgb, var(--accent) 34%, var(--border));
}
.col-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding: 8px 8px 10px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}
.col-title{ font-weight: 850; }
.col-date{ font-size: 12px; color: var(--muted); }
.col-body{ display:grid; gap:10px; }
.col-main{ min-height: 120px; overflow: visible; display:grid; gap:10px; padding-right: 2px; align-content:start; grid-auto-rows:max-content; }
.col-sep{ margin: 12px 0; border-top: 1px dashed var(--border); }
.col-closed-stack{ display:grid; gap:12px; max-height: none; overflow: visible; }
.col-closed{ display:grid; gap:8px; margin-top: 4px; border:1px solid var(--border); border-radius:12px; padding:10px; background: rgba(255,255,255,0.02); }
.col-closed-title{ font-size: 12px; color: var(--muted2); text-transform: uppercase; letter-spacing: .03em; }
.col-closed-list{ display:grid; gap:10px; align-content:start; grid-auto-rows:max-content; max-height: none; overflow: visible; padding-right:2px; }
.col-group-rechazado{ border-color: rgba(255,90,95,0.35); }
.col-group-aprobado{ border-color: rgba(74,222,128,0.35); }
.col-group-retrabajo{ border-color: rgba(255,138,42,0.35); }

.card-mini{
  height: 118px;
  padding: 10px 10px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  cursor:pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .12s ease, border-color .18s ease, background .18s ease;
}
.card-mini.can-drag{
  cursor: grab;
}
.card-mini.can-drag:active{
  cursor: grabbing;
}
.card-mini.is-dragging{
  opacity: .54;
  transform: scale(.985);
}
.card-mini.is-drop-before{
  box-shadow: inset 0 3px 0 rgba(255,138,42,0.72);
}
.card-mini.is-drop-after{
  box-shadow: inset 0 -3px 0 rgba(255,138,42,0.72);
}
.card-mini:hover{ transform: translateY(-1px); border-color: rgba(255,255,255,0.18); background: rgba(255,255,255,0.04); }
.card-mini .top{ display:flex; gap:8px; align-items:center; justify-content:space-between; }
.card-mini .pn{ font-weight: 900; }
.card-mini .meta{ margin-top: 6px; color: var(--muted); font-size: 12px; }
.card-mini .desc{
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toolbar{
  display:flex;
  gap: 10px;
  align-items:center;
  flex-wrap:wrap;
  justify-content: space-between;
  margin-top: 8px;
}
.toolbar .left, .toolbar .right{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.seg{
  display:flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow:hidden;
  background: rgba(255,255,255,0.02);
}
.seg button{
  border:0;
  background: transparent;
  color: var(--muted);
  padding: 8px 10px;
  cursor:pointer;
  font-weight: 750;
}
.seg button.active{
  background: rgba(255,138,42,0.18);
  color: var(--text);
}

.calendar-nav{
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.calendar-nav-right{
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.review-toolbar,
.page-filter-toolbar{
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.review-toolbar-balancer,
.page-filter-toolbar-balancer{
  visibility: hidden;
  pointer-events: none;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
}

.review-toolbar-right,
.page-filter-toolbar-right{
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.review-toolbar > .area-chips-responsive,
.page-filter-toolbar > .area-chips-responsive{
  min-width: 0;
  width: 100%;
}

.calendar-today{
  white-space: nowrap;
  min-width: 60px;
}

.calendar-area-chips{
  justify-content: center;
  margin-top: 0;
}

.area-chips-responsive{
  justify-content: center;
}

#review-area-chips,
#myreq-area-chips{
  margin-top: 0;
}

.area-chips-rail{
  display: grid;
  grid-template-columns: 0 minmax(0, 1fr) 0;
  align-items: center;
}

.area-chips-bound{
  pointer-events: none;
}

.calendar-arrow{
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  font-size: 18px;
  line-height: 1;
  display: grid;
  place-items: center;
}

.calendar-arrow.drag-advance{
  border-color: rgba(255,138,42,0.46);
  background: rgba(255,138,42,0.14);
  box-shadow: 0 0 0 3px rgba(255,138,42,0.10);
}

.calendar-arrow:disabled{
  opacity: .45;
  cursor: not-allowed;
}

.calendar-stage.is-drag-advance-edge::after{
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 30px;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(255,138,42,0), rgba(255,138,42,0.14));
  z-index: 5;
}

.review-actions{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.review-action{
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  border-radius: 12px;
  padding: 9px 10px;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.2;
  font-weight: 800;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .12s ease;
}

.review-action:hover{
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.22);
}

.review-action.review-aprobado{
  border-color: rgba(74,222,128,0.24);
  background: rgba(74,222,128,0.05);
}

.review-action.review-retrabajo{
  border-color: rgba(255,138,42,0.24);
  background: rgba(255,138,42,0.05);
}

.review-action.review-rechazado{
  border-color: rgba(255,90,95,0.28);
  background: rgba(255,90,95,0.06);
}

.review-action.review-aprobado.active{
  border-color: rgba(74,222,128,0.44);
  background: rgba(74,222,128,0.14);
}

.review-action.review-retrabajo.active{
  border-color: rgba(255,138,42,0.44);
  background: rgba(255,138,42,0.14);
}

.review-action.review-rechazado.active{
  border-color: rgba(255,90,95,0.50);
  background: rgba(255,90,95,0.16);
}

.review-actions.disabled .review-action{
  opacity: .62;
  pointer-events: none;
}

.report-donut{
  width: 220px;
  height: 220px;
  border-radius: 999px;
  margin: 0 auto;
  border: 1px solid var(--border);
  box-shadow: inset 0 0 0 34px rgba(10,12,16,0.55);
}

.report-grid{
  display: grid;
  grid-template-columns: 300px 1fr;
  align-items: start;
  gap: 14px;
}

.report-bars{
  display:flex;
  align-items:flex-end;
  gap:8px;
  min-height: 220px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  overflow-x: auto;
}

.report-bar-wrap{
  min-width: 44px;
  display:grid;
  gap:6px;
  justify-items:center;
}

.report-bar{
  width: 24px;
  border-radius: 8px 8px 4px 4px;
  border: 1px solid rgba(255,138,42,0.5);
  background: linear-gradient(180deg, rgba(255,138,42,0.95), rgba(255,138,42,0.45));
}

.report-bar-label{ font-size: 11px; color: var(--muted2); }
.report-bar-value{ font-size: 11px; color: var(--muted); font-weight: 700; }

.report-kpi-grid{
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
}

.report-kpi-card{
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
}

.report-kpi-value{
  font-size: 24px;
  font-weight: 900;
  margin-top: 6px;
  line-height: 1.1;
}

.report-top-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.report-top-card{
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
}

.report-top-row{
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}

.report-top-row:last-child{
  border-bottom: 0;
}

.report-compact-list .item{
  padding: 10px 12px;
}

.annual-right{ min-width: 180px; display:grid; gap:8px; justify-items:end; align-content:start; }
.annual-valid{ min-width: 94px; text-align:center; }
.annual-expiry{ min-width: 144px; text-align:center; }

/* ===========================
   DRAWER (MOBILE SIDEBAR)
=========================== */
.drawer-overlay{
  position: fixed;
  inset: 0;
  background: var(--overlay);
  opacity: 0;
  pointer-events:none;
  transition: opacity .18s ease;
  z-index: 50;
}
.drawer{
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: min(320px, 88vw);
  transform: translateX(-110%);
  transition: transform .22s ease;
  z-index: 60;
  padding: 16px;
  background: rgba(15,16,20,0.65);
  border-right: 1px solid var(--border);
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  display: flex;
  flex-direction: column;
  gap: 12px;
}
html[data-theme="light"] .drawer{
  background: #ffffff; /* solid white to avoid dark bleed-through on iOS */
  color: var(--text);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.drawer.open{ transform: translateX(0); }
.drawer-overlay.open{ opacity: 1; pointer-events: auto; }

/* Ensure drawer close button X is visible in dark mode */
#drawer .xbtn,
#drawer #drawer-close{
  color: var(--text);
  background: rgba(255,255,255,0.03);
  border-color: var(--border);
}

.drawer-main{
  flex: 1;
  min-height: 0;
  display: grid;
  gap: 12px;
  align-content: start;
  overflow-y: auto;
  overflow-x: visible;
  padding-right: 4px;
}

/* ===========================
   MODAL
=========================== */
.modal-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  opacity:0;
  pointer-events:none;
  transition: opacity .18s ease;
  z-index: 80;
  display:grid;
  place-items:center;
  padding: 18px;
}
.modal-overlay.open{ opacity:1; pointer-events:auto; }
.modal{
  width: min(760px, 96vw);
  max-height: min(88vh, 820px);
  overflow:auto;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  box-shadow: var(--shadow);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  padding: 16px;
}
.modal.modal-loose-overflow{ overflow: visible; }
html[data-theme="light"] .modal{ background: rgba(255,255,255,0.78); }
.modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.modal-title{
  font-weight: 900;
  font-size: 16px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.xbtn{
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  border-radius: 14px;
  padding: 10px 12px;
  font-weight: 700;
  line-height: 1;
  cursor:pointer;
}

.date-range-row{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.date-trigger{
  border: 1px solid var(--fieldBorder);
  background: var(--field);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  font-weight: 650;
  transition: border-color .18s ease, background .18s ease;
}

.date-trigger.is-empty{ color: var(--muted2); }

.date-trigger.active{
  border-color: rgba(255,138,42,0.55);
  background: var(--field2);
  box-shadow: 0 0 0 3px rgba(255,138,42,0.14);
}

.date-picker-card{
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.date-field-pop{ position: relative; }

.date-picker-popover{
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: min(360px, calc(100vw - 72px));
  z-index: 25;
  box-shadow: var(--shadow-soft);
}

.date-picker-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}

.date-picker-head .btn{ padding: 6px 9px; }

.date-nav-group{
  display:flex;
  gap:6px;
}

.date-jump-row{
  display:grid;
  grid-template-columns: 1fr 1fr auto;
  gap:8px;
  align-items:center;
}

.date-jump-select{
  min-width: 0;
  border: 1px solid var(--fieldBorder);
  background: var(--field);
  color: var(--text);
  border-radius: 10px;
  padding: 7px 9px;
}

.date-week-head{
  display:grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.date-week-head span{
  text-align:center;
  font-size: 11px;
  color: var(--muted2);
  font-weight: 700;
}

.date-grid{
  display:grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.date-cell{
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  color: var(--text);
  border-radius: 10px;
  height: 34px;
  cursor: pointer;
  font-size: 12px;
}

.date-cell.muted{ opacity: .45; }
.date-cell.disabled{
  opacity: .28;
  cursor: not-allowed;
}
.date-cell.today{ border-color: rgba(255,176,32,0.55); }
.date-cell.in-range{ background: rgba(255,138,42,0.12); }
.date-cell.selected{
  border-color: rgba(255,138,42,0.7);
  background: rgba(255,138,42,0.2);
  font-weight: 800;
}

.chat-root{
  position: fixed;
  right: 18px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 45;
  pointer-events: none;
}

.chat-dock{
  display: grid;
  justify-items: end;
  gap: 12px;
}

.chat-panel,
.chat-launcher{
  pointer-events: auto;
}

.chat-panel{
  width: min(760px, calc(100vw - 40px));
  height: min(68vh, 560px);
  display: grid;
  grid-template-columns: 296px minmax(0, 1fr);
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg2) 88%, rgba(255,255,255,0.06));
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  transform: translateY(12px) scale(.985);
  transform-origin: right bottom;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.chat-panel.open{
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.chat-sidebar-pane,
.chat-thread-pane{
  min-height: 0;
}

.chat-sidebar-pane{
  display: grid;
  grid-template-rows: auto auto 1fr;
  border-right: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}

.chat-thread-pane{
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
}

.chat-pane-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
}

.chat-pane-head strong{
  display: block;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.chat-pane-kicker{
  font-size: 11px;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted2);
  margin-bottom: 4px;
}

.chat-close{
  width: 32px;
  height: 32px;
  padding: 0;
  display: grid;
  place-items: center;
  line-height: 1;
}

.chat-search-wrap{
  position: relative;
  display: block;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border);
}

.chat-search-icon{
  position: absolute;
  left: 26px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  display: grid;
  place-items: center;
}

.chat-search-icon svg{
  width: 16px;
  height: 16px;
}

.chat-search-input{
  padding-left: 40px;
}

.chat-user-list{
  overflow: auto;
  padding: 10px 10px 12px;
  display: grid;
  gap: 8px;
  align-content: start;
}

.chat-user-item{
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 18px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, transform .12s ease;
}

.chat-user-item:hover{
  background: rgba(255,255,255,0.04);
  border-color: var(--border);
  transform: translateY(-1px);
}

.chat-user-item.active{
  background: rgba(255,138,42,0.14);
  border-color: rgba(255,138,42,0.32);
}

.chat-avatar{
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  font-size: 15px;
}

.chat-user-copy{
  min-width: 0;
}

.chat-user-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chat-user-row strong{
  min-width: 0;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-user-time{
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--muted2);
}

.chat-user-meta,
.chat-user-preview{
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.chat-user-meta{
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted2);
}

.chat-user-preview{
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.chat-unread{
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.chat-empty-list{
  padding: 18px 12px;
  border: 1px dashed var(--border);
  border-radius: 18px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.chat-thread-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.chat-thread-user{
  min-width: 0;
  display: grid;
  gap: 2px;
}

.chat-thread-user strong{
  min-width: 0;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-thread-user span{
  min-width: 0;
  font-size: 12px;
  color: var(--muted2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-back{
  display: none;
  height: 34px;
  width: 34px;
  padding: 0;
  border-radius: 11px;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.chat-back svg{
  width: 16px;
  height: 16px;
  display: block;
}

.chat-thread-messages{
  overflow: auto;
  padding: 16px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.chat-message{
  display: grid;
  gap: 5px;
}

.chat-message.mine{
  justify-items: end;
}

.chat-bubble{
  max-width: min(80%, 420px);
  padding: 11px 13px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.05);
}

.chat-message.mine .chat-bubble{
  background: rgba(255,138,42,0.16);
  border-color: rgba(255,138,42,0.34);
}

.chat-message.other .chat-bubble{
  background: rgba(255,255,255,0.04);
}

.chat-bubble-text{
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  overflow-wrap: anywhere;
}

.chat-bubble .chat-request-card{
  margin-bottom: 10px;
}

.chat-bubble .chat-request-card:last-child{
  margin-bottom: 0;
}

.chat-message-meta{
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: var(--muted2);
}

.chat-thread-empty{
  min-height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  text-align: center;
  color: var(--muted);
  padding: 18px 24px;
}

.chat-thread-empty strong{
  color: var(--text);
}

.chat-thread-empty-full{
  height: 100%;
}

.chat-compose{
  padding: 14px 16px 16px;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 10px;
  background: rgba(255,255,255,0.02);
}

.chat-compose-quote{
  display: grid;
}

.chat-compose-input{
  resize: none;
  min-height: 80px;
  max-height: 120px;
}

.chat-compose-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chat-compose-tools{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.chat-request-card{
  width: 100%;
  display: grid;
  gap: 6px;
  text-align: left;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(10,14,20,0.22);
  color: var(--text);
}

.chat-request-card.clickable{
  cursor: pointer;
  transition: transform .12s ease, border-color .18s ease, background .18s ease;
}

.chat-request-card.clickable:hover{
  transform: translateY(-1px);
  border-color: rgba(255,138,42,0.32);
  background: rgba(255,138,42,0.10);
}

.chat-request-card.removable{
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.chat-request-card-body{
  min-width: 0;
  display: grid;
  gap: 6px;
}

.chat-request-card-top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chat-request-card-top strong{
  min-width: 0;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-request-status{
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1;
}

.chat-request-status.status-en_proceso{
  border-color: rgba(255,176,32,0.42);
  color: rgba(255,219,131,0.98);
  background: rgba(255,176,32,0.10);
}

.chat-request-status.status-aprobado{
  border-color: rgba(74,222,128,0.40);
  color: rgba(170,255,199,0.98);
  background: rgba(74,222,128,0.10);
}

.chat-request-status.status-retrabajo{
  border-color: rgba(255,138,42,0.40);
  color: rgba(255,211,170,0.98);
  background: rgba(255,138,42,0.10);
}

.chat-request-status.status-rechazado{
  border-color: rgba(255,90,95,0.40);
  color: rgba(255,186,188,0.98);
  background: rgba(255,90,95,0.10);
}

.chat-request-card-meta{
  font-size: 11.5px;
  color: var(--muted2);
  line-height: 1.25;
}

.chat-request-card-desc{
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.chat-request-card-clear{
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color .18s ease, color .18s ease, background .18s ease;
}

.chat-request-card-clear:hover{
  border-color: rgba(255,90,95,0.42);
  color: rgba(255,184,188,0.98);
  background: rgba(255,90,95,0.10);
}

.chat-request-picker-list{
  display: grid;
  gap: 10px;
  max-height: min(48vh, 420px);
  overflow: auto;
}

.chat-request-picker-item{
  width: 100%;
  display: grid;
  gap: 6px;
  text-align: left;
  padding: 12px 13px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  cursor: pointer;
  transition: transform .12s ease, border-color .18s ease, background .18s ease;
}

.chat-request-picker-item:hover{
  transform: translateY(-1px);
  border-color: rgba(255,138,42,0.34);
  background: rgba(255,138,42,0.08);
}

.chat-request-picker-top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chat-request-picker-top strong{
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-request-picker-meta{
  font-size: 12px;
  color: var(--muted2);
  line-height: 1.25;
}

.chat-request-picker-desc{
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.chat-request-picker-empty{
  padding: 18px 12px;
  border: 1px dashed var(--border);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.chat-launcher{
  min-width: 114px;
  height: 58px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 16px 0 10px;
  border-radius: 20px;
  border: 1px solid rgba(255,138,42,0.26);
  background: linear-gradient(180deg, rgba(30,22,15,0.96), rgba(21,18,15,0.96));
  color: var(--text);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: transform .14s ease, border-color .18s ease, background .18s ease;
}

.chat-launcher:hover{
  transform: translateY(-1px);
  border-color: rgba(255,138,42,0.42);
}

.chat-launcher.active{
  background: linear-gradient(180deg, rgba(51,32,18,0.98), rgba(27,20,16,0.98));
}

.chat-launcher-ico{
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255,138,42,0.18);
  color: rgba(255,223,197,0.96);
}

.chat-launcher-ico svg{
  width: 20px;
  height: 20px;
}

.chat-launcher-label{
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1;
}

.chat-launcher-dot{
  position: absolute;
  top: 8px;
  right: 8px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #ff5a5f;
  border: 2px solid rgba(21,18,15,0.98);
  box-shadow: 0 0 0 2px rgba(255,90,95,0.14);
}

.conn-toast{
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 100;
  min-width: 250px;
  max-width: min(92vw, 360px);
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(30,32,38,0.94);
  color: rgba(255,255,255,0.96);
  opacity: 0;
  transform: translateY(12px) scale(.98);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-soft);
}
.conn-toast.show{
  opacity: 1;
  transform: translateY(0) scale(1);
}

.conn-toast-icon{
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.conn-toast-icon svg{ width: 18px; height: 18px; }

.conn-toast-copy{
  display: grid;
  gap: 2px;
  min-width: 0;
}
.conn-toast-copy strong{
  font-size: 13px;
  line-height: 1.15;
}
.conn-toast-copy small{
  color: var(--muted2);
  font-size: 11px;
  line-height: 1.2;
}

.conn-toast.offline{
  border-color: rgba(255,90,95,0.45);
  background: linear-gradient(180deg, rgba(55,34,37,0.95), rgba(32,26,28,0.95));
}
.conn-toast.offline .conn-toast-icon{
  background: rgba(255,90,95,0.18);
  color: rgba(255,145,150,0.98);
}

.conn-toast.online{
  border-color: rgba(74,222,128,0.45);
  background: linear-gradient(180deg, rgba(33,51,40,0.95), rgba(26,35,30,0.95));
}
.conn-toast.online .conn-toast-icon{
  background: rgba(74,222,128,0.2);
  color: rgba(154,255,193,0.98);
}

/* Responsive */
@media (max-width: 1080px){
  .grid2{ grid-template-columns: 1fr; }
  .search{ width: min(520px, 46vw); }
  .stats-row{ grid-template-columns: repeat(3, minmax(140px, 1fr)); }
}
@media (max-width: 980px){
  :root{
    --chip-rail-fade: 10px;
  }

  .app{
    grid-template-columns: 1fr;
    width: 100%;
    padding-left: 0;
  }
  .sidebar{ display:none; }
  .chat-root{
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
  }
  .hamburger{
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-grid;
    place-items: center;
    border-radius: 12px;
    line-height: 1;
  }
  .hamburger .menu-label{ display:none; }
  .hamburger .menu-ico svg{ width: 18px; height: 18px; display:block; }

  #btn-generate-top{
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-grid;
    place-items: center;
    border-radius: 12px;
    line-height: 1;
    box-shadow: none !important;
    text-shadow: none;
    color: inherit !important;
  }
  #btn-generate-top .gen-label{ display:none !important; }
  #btn-generate-top .gen-plus{
    display: grid;
    width: 20px;
    height: 20px;
    place-items: center;
    font-size: 24px;
    line-height: 20px;
    font-weight: 700;
    color: currentColor;
  }

  #btn-review-top{
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-grid;
    place-items: center;
    border-radius: 12px;
    line-height: 1;
    box-shadow: none !important;
    text-shadow: none;
    color: inherit !important;
  }
  #btn-review-top .review-label{ display:none !important; }
#btn-review-top .review-ico{
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: currentColor;
}
#btn-review-top .review-ico svg{
  display: block;
  width: 18px;
  height: 18px;
}

  .search{ width: 100%; }
  .calendar-nav{ 
    grid-template-columns: 40px minmax(0, 1fr) auto; 
    gap: 8px; 
  }
  .calendar-area-chips{
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    min-width: 0;
    width: 100%;
    padding-inline: 14px;
    box-sizing: border-box;
    scroll-padding-inline: 14px;
    scrollbar-width: none;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .calendar-area-chips::-webkit-scrollbar{ display:none; }
  .area-chips-responsive{
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    scrollbar-width: none;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .area-chips-responsive::-webkit-scrollbar{ display:none; }
  #review-filter-chips{
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    width: 100%;
    padding-inline: 14px;
    box-sizing: border-box;
    scroll-padding-inline: 14px;
    scrollbar-width: none;
    -webkit-mask-image: none;
    mask-image: none;
  }
  #review-filter-chips::-webkit-scrollbar{ display:none; }
  .calendar-area-chips.has-right-fade:not(.has-left-fade),
  .area-chips-responsive.has-right-fade:not(.has-left-fade),
  #review-filter-chips.has-right-fade:not(.has-left-fade){
    -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - var(--chip-rail-fade)), transparent 100%);
    mask-image: linear-gradient(to right, #000 0, #000 calc(100% - var(--chip-rail-fade)), transparent 100%);
  }
  .calendar-area-chips.has-left-fade:not(.has-right-fade),
  .area-chips-responsive.has-left-fade:not(.has-right-fade),
  #review-filter-chips.has-left-fade:not(.has-right-fade){
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--chip-rail-fade), #000 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 var(--chip-rail-fade), #000 100%);
  }
  .calendar-area-chips.has-left-fade.has-right-fade,
  .area-chips-responsive.has-left-fade.has-right-fade,
  #review-filter-chips.has-left-fade.has-right-fade{
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--chip-rail-fade), #000 calc(100% - var(--chip-rail-fade)), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 var(--chip-rail-fade), #000 calc(100% - var(--chip-rail-fade)), transparent 100%);
  }
  #review-filter-chips .chip{
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .calendar-area-chips .chip,
  .area-chips-responsive .chip,
  #review-filter-chips .chip{
    min-width: 112px;
    min-height: 42px;
    max-width: 132px;
    padding: 10px 14px;
    display: inline-grid;
    place-items: center;
    text-align: center;
    white-space: normal;
    line-height: 1.15;
    text-wrap: balance;
  }
  .area-chips-rail{
    grid-template-columns: 0px minmax(0, 1fr) 0px;
    gap: 8px;
  }
  .modal-overlay{
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  }
  .modal{
    width: min(620px, 94vw);
    max-height: min(88dvh, calc(100dvh - 24px));
    margin: 0 auto;
  }
  .topbar{ top: calc(8px + env(safe-area-inset-top)); border-radius: 14px; border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
  .content{
    max-width: none;
    margin: 0;
    width: 100%;
    padding: 0 12px 16px 12px;
  }
  .page{ margin-top: 16px; }
  .kanban{ grid-template-columns: 1fr; }
  .kanban.kanban-calendar{ grid-template-columns: 1fr; }
  .col{ min-height: auto; height: auto; }
  .col-main, .col-closed, .col-closed-stack, .col-closed-list{ max-height: none; overflow: visible; }
  .requests-scroll{ max-height: min(50vh, 420px); }
  .dashboard-card{ min-height: auto; }
  .dashboard-card .requests-scroll{ max-height: min(50vh, 420px); }
  .stats-row{ grid-template-columns: repeat(2, minmax(140px, 1fr)); }
  .stats-row > .stat-card:last-child:nth-child(odd){
    grid-column: 1 / -1;
    width: min(100%, 320px);
    justify-self: center;
  }
  .area-picker-grid{ grid-template-columns: 1fr; }
}

@media (min-width: 700px) and (max-width: 980px){
  #dashboard-area-chips{
    flex-wrap: wrap;
    justify-content: center;
    overflow-x: visible;
    -webkit-mask-image: none;
    mask-image: none;
  }

  #annual-area-chips{
    flex-wrap: wrap;
    justify-content: center;
    overflow-x: visible;
    -webkit-mask-image: none;
    mask-image: none;
  }

  #report-area-chips,
  #review-area-chips,
  #notif-area-chips,
  #area-chip-list{
    flex-wrap: wrap;
    justify-content: center;
    overflow-x: visible;
    -webkit-mask-image: none;
    mask-image: none;
  }
}

@media (max-width: 980px){
  .item.item-has-quick-review{
    flex-direction: column;
    align-items: stretch;
  }

  .item.item-has-quick-review > div:first-child{
    width: 100%;
  }

  .item.item-has-quick-review .right.quick-review-panel{
    margin-left: 0;
    width: 100%;
    flex: 1 1 auto;
    flex-basis: auto;
  }

  .review-toolbar,
  .page-filter-toolbar{
    grid-template-columns: 1fr;
  }

  .review-filter-toolbar{
    grid-template-columns: 1fr;
  }

  .review-filter-main{
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
  }

  .review-toolbar-balancer,
  .page-filter-toolbar-balancer{
    display: none;
  }

  .review-toolbar-right,
  .page-filter-toolbar-right{
    justify-content: flex-end;
  }

  .review-toolbar-right{
    display: none;
  }

  .review-filter-date-mobile{
    display: inline-flex;
  }

  .review-status-filter{
    width: 100%;
  }

  .quick-review-actions,
  .review-actions{
    grid-template-columns: 1fr;
  }

  .quick-review-actions .review-action,
  .review-actions .review-action{
    width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
  }

  .report-grid{
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .report-bars{
    width: 100%;
    justify-content: center;
  }

  .report-kpi-grid{
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .report-top-grid{
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px){
  .chat-root{
    left: auto;
    right: 12px;
    width: auto;
    bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .chat-dock{
    justify-items: end;
  }

  .chat-panel{
    width: min(calc(100vw - 24px), 520px);
    height: min(74vh, 620px);
    grid-template-columns: 1fr;
  }

  .chat-panel .hidden-mobile{
    display: none !important;
  }

  .chat-sidebar-pane{
    border-right: 0;
  }

  .chat-thread-head{
    padding-right: 12px;
  }

  .chat-back{
    display: inline-grid;
    place-items: center;
  }

  .chat-launcher{
    min-width: 114px;
  }

  .chat-launcher-label{
    display: none;
  }

  .chat-launcher{
    min-width: 58px;
    width: 58px;
    padding: 0;
    justify-content: center;
  }

  .chat-bubble{
    max-width: min(88%, 420px);
  }

  .chat-compose-row{
    flex-direction: column;
    align-items: stretch;
  }

  .chat-compose-tools{
    flex-direction: column;
    align-items: stretch;
  }

  .chat-compose-row .btn,
  .chat-compose-tools .btn{
    width: 100%;
  }
}

@media (max-width: 560px){
  .report-kpi-grid{
    grid-template-columns: 1fr;
  }

  .quick-review-actions,
  .review-actions{
    grid-template-columns: 1fr;
  }

  .quick-review-actions .review-action,
  .review-actions .review-action{
    width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
  }

  .watermark{
    right: 10px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    font-size: 10px;
    padding: 5px 8px;
  }
}

/* ===========================
   MINIMALIST REFRESH
=========================== */
:root{
  --radius: 18px;
  --radius-sm: 14px;
  --radius-lg: 24px;
  --shadow: 0 18px 48px rgba(6,10,18,0.34);
  --shadow-soft: 0 8px 24px rgba(6,10,18,0.24);
  --blur: 0px;

  --accent: #FF8A2A;
  --accent-2: #FFA24D;

  --bg: #0f1218;
  --bg2: #141924;
  --panel: rgba(23,30,42,0.58);
  --panel2: rgba(20,26,38,0.46);
  --border: rgba(255,255,255,0.14);
  --border2: rgba(255,255,255,0.22);
  --field: rgba(255,255,255,0.08);
  --field2: rgba(255,255,255,0.14);
  --fieldBorder: rgba(255,255,255,0.22);
  --overlay: rgba(8,10,14,0.50);
}

html[data-theme="light"]{
  --bg: #edf1f6;
  --bg2: #e3e8ef;
  --panel: rgba(255,255,255,0.62);
  --panel2: rgba(255,255,255,0.50);
  --border: rgba(22,33,52,0.12);
  --border2: rgba(22,33,52,0.20);
  --field: rgba(255,255,255,0.74);
  --field2: rgba(255,255,255,0.90);
  --fieldBorder: rgba(22,33,52,0.16);
  --shadow: 0 16px 36px rgba(22,33,52,0.14);
  --shadow-soft: 0 8px 18px rgba(22,33,52,0.10);
}

@media (prefers-color-scheme: light){
  html[data-theme="system"]{
    --bg: #edf1f6;
    --bg2: #e3e8ef;
    --panel: rgba(255,255,255,0.62);
    --panel2: rgba(255,255,255,0.50);
    --border: rgba(22,33,52,0.12);
    --border2: rgba(22,33,52,0.20);
    --field: rgba(255,255,255,0.74);
    --field2: rgba(255,255,255,0.90);
    --fieldBorder: rgba(22,33,52,0.16);
    --shadow: 0 16px 36px rgba(22,33,52,0.14);
    --shadow-soft: 0 8px 18px rgba(22,33,52,0.10);
  }
}

body{
  background:
    radial-gradient(1100px 460px at 4% -12%, rgba(255,138,42,0.16), transparent 56%),
    radial-gradient(920px 420px at 95% -18%, rgba(255,188,122,0.10), transparent 58%),
    linear-gradient(180deg, var(--bg), var(--bg2));
}

html[data-theme="light"] body{
  background:
    radial-gradient(1100px 460px at 4% -12%, rgba(255,138,42,0.22), transparent 56%),
    radial-gradient(920px 420px at 95% -18%, rgba(255,188,122,0.18), transparent 58%),
    linear-gradient(180deg, var(--bg), var(--bg2));
}

@media (prefers-color-scheme: light){
  html[data-theme="system"] body{
    background:
      radial-gradient(1100px 460px at 4% -12%, rgba(255,138,42,0.22), transparent 56%),
      radial-gradient(920px 420px at 95% -18%, rgba(255,188,122,0.18), transparent 58%),
      linear-gradient(180deg, var(--bg), var(--bg2));
  }
}

.card,
.sidebar,
.topbar,
.modal,
.drawer,
.watermark{
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.card,
.topbar,
.sidebar,
.modal,
.drawer,
.col,
.item,
.table tbody tr,
.request-slide,
.card-mini,
.profile,
.brand,
.stat-card,
.area-pick-card,
.check-item,
.review-action,
.upload-box,
.date-picker-card{
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.card,
.topbar,
.sidebar,
.modal,
.drawer,
.col,
.item,
.table tbody tr,
.request-slide,
.card-mini,
.profile,
.brand,
.stat-card,
.area-pick-card,
.check-item,
.review-action,
.upload-box,
.custom-select-menu,
.xbtn,
.logout-icon,
.btn,
.input,
.textarea,
.select,
.date-trigger{
  border-radius: var(--radius-sm);
}

.card-lg,
.modal{
  border-radius: var(--radius-lg);
}

.btn{
  background: linear-gradient(180deg, var(--field2), var(--field));
  border-color: var(--fieldBorder);
  font-weight: 600;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.btn:hover,
.btn:active{
  transform: translateY(-1px);
}

.btn-primary{
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--accent) 42%, #fff7f0 8%),
    color-mix(in srgb, var(--accent-2) 52%, #22160d 6%)
  );
  border-color: color-mix(in srgb, var(--accent) 54%, var(--fieldBorder));
  color: #f8fbff;
  box-shadow:
    0 10px 26px color-mix(in srgb, var(--accent) 28%, transparent),
    0 1px 0 rgba(255,255,255,0.22) inset;
}

.btn-primary:hover{
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--accent) 50%, #fff7f0 8%),
    color-mix(in srgb, var(--accent-2) 58%, #22160d 8%)
  );
  border-color: color-mix(in srgb, var(--accent) 64%, var(--fieldBorder));
}

.nav-item,
.item,
.table tbody tr,
.stat-card,
.request-slide,
.card-mini,
.upload-box,
.check-item,
.review-action{
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.nav-item:hover,
.item:hover,
.table tbody tr:hover,
.stat-card:hover,
.request-slide:hover,
.card-mini:hover,
.upload-box:hover,
.review-action:hover{
  transform: translateY(-1px);
  border-color: var(--border2);
}

.nav-item.active,
.chip.active{
  background: color-mix(in srgb, var(--accent) 16%, var(--panel));
  border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
}

.chip,
.badge{
  border-radius: 999px;
  font-weight: 600;
  background: color-mix(in srgb, var(--panel) 82%, transparent);
  border-color: color-mix(in srgb, var(--border) 80%, transparent);
}

.brand-dot,
.avatar{
  background:
    radial-gradient(circle at 32% 24%, rgba(255,255,255,0.34), transparent 56%),
    color-mix(in srgb, var(--accent) 18%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--border));
  box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 20%, transparent);
}

.custom-select-menu{
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  border-color: var(--border2);
  box-shadow: var(--shadow);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.input:focus, .textarea:focus, .select:focus,
.custom-select.open .custom-select-trigger,
.custom-select-trigger:focus,
.date-trigger.active{
  border-color: color-mix(in srgb, var(--accent) 58%, var(--fieldBorder));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.report-bar{
  border-color: color-mix(in srgb, var(--accent) 42%, transparent);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--accent) 70%, #fff7f0 8%),
    color-mix(in srgb, var(--accent-2) 62%, var(--panel))
  );
  border-radius: 12px 12px 6px 6px;
}

.modal-overlay{
  background: rgba(7,10,16,0.42);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Color separation: cards/columns distinct from page background */
.card,
.item,
.table tbody tr,
.stat-card,
.request-slide,
.card-mini,
.profile,
.brand,
.area-pick-card,
.check-item,
.review-action,
.date-picker-card,
.report-bars{
  background: linear-gradient(180deg, rgba(35,43,58,0.82), rgba(29,36,50,0.78));
  border-color: rgba(255,255,255,0.22);
  box-shadow: none;
}

.kanban.kanban-calendar{
  padding: 10px;
  border-radius: calc(var(--radius-lg) + 2px);
  border: 1px solid rgba(255,255,255,0.20);
  background: linear-gradient(180deg, rgba(32,40,56,0.82), rgba(27,34,48,0.78));
  box-shadow: none;
}

.col{
  background: linear-gradient(180deg, rgba(45,54,72,0.90), rgba(37,45,62,0.86));
  border-color: color-mix(in srgb, var(--accent) 34%, rgba(255,255,255,0.22));
  box-shadow: none;
}

.col-head{
  border-bottom-color: color-mix(in srgb, var(--accent) 28%, rgba(255,255,255,0.26));
}

.kanban .card-mini{
  border-color: rgba(255,255,255,0.24);
}

.kanban .card-mini:hover{
  border-color: color-mix(in srgb, var(--accent) 44%, rgba(255,255,255,0.24));
}

.calendar-arrow{
  border-color: color-mix(in srgb, var(--accent) 28%, var(--fieldBorder));
  background: linear-gradient(180deg, var(--field2), var(--field));
  box-shadow: none;
}

html[data-theme="light"] .card,
html[data-theme="light"] .item,
html[data-theme="light"] .table tbody tr,
html[data-theme="light"] .stat-card,
html[data-theme="light"] .request-slide,
html[data-theme="light"] .card-mini,
html[data-theme="light"] .profile,
html[data-theme="light"] .brand,
html[data-theme="light"] .area-pick-card,
html[data-theme="light"] .check-item,
html[data-theme="light"] .review-action,
html[data-theme="light"] .date-picker-card,
html[data-theme="light"] .report-bars{
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(246,249,253,0.92));
  border-color: rgba(30,44,70,0.20);
  box-shadow: none;
}

html[data-theme="light"] .kanban.kanban-calendar{
  background: linear-gradient(180deg, rgba(246,250,255,0.95), rgba(240,245,252,0.92));
  border-color: rgba(30,44,70,0.18);
  box-shadow: none;
}

html[data-theme="light"] .col{
  background: linear-gradient(180deg, rgba(239,245,255,0.96), rgba(232,239,250,0.94));
  border-color: color-mix(in srgb, var(--accent) 24%, rgba(30,44,70,0.20));
  box-shadow: none;
}

@media (prefers-color-scheme: light){
  html[data-theme="system"] .card,
  html[data-theme="system"] .item,
  html[data-theme="system"] .table tbody tr,
  html[data-theme="system"] .stat-card,
  html[data-theme="system"] .request-slide,
  html[data-theme="system"] .card-mini,
  html[data-theme="system"] .profile,
  html[data-theme="system"] .brand,
  html[data-theme="system"] .area-pick-card,
  html[data-theme="system"] .check-item,
  html[data-theme="system"] .review-action,
  html[data-theme="system"] .date-picker-card,
  html[data-theme="system"] .report-bars{
    background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(246,249,253,0.92));
    border-color: rgba(30,44,70,0.20);
    box-shadow: none;
  }

  html[data-theme="system"] .kanban.kanban-calendar{
    background: linear-gradient(180deg, rgba(246,250,255,0.95), rgba(240,245,252,0.92));
    border-color: rgba(30,44,70,0.18);
    box-shadow: none;
  }

  html[data-theme="system"] .col{
    background: linear-gradient(180deg, rgba(239,245,255,0.96), rgba(232,239,250,0.94));
    border-color: color-mix(in srgb, var(--accent) 24%, rgba(30,44,70,0.20));
    box-shadow: none;
  }
}

/* Login/Register button without shadow */
#view-login .btn-primary,
#view-login .btn-primary:hover,
#view-login .btn-primary:active{
  box-shadow: none !important;
}

/* Flat minimal palette + list spacing */
:root{
  --bg: #121212;
  --bg2: #121212;
  --panel: rgba(32,32,32,0.78);
  --panel2: rgba(32,32,32,0.78);
  --field: rgba(44,44,44,0.82);
  --field2: rgba(44,44,44,0.82);
  --border: rgba(255,255,255,0.16);
  --border2: rgba(255,255,255,0.24);
  --fieldBorder: rgba(255,255,255,0.22);
  --surface-card: rgba(34,34,34,0.78);
  --surface-col: rgba(42,42,42,0.84);
  --surface-calendar: rgba(28,28,28,0.80);
}

html[data-theme="light"]{
  --bg: #fcfbf8;
  --bg2: #fcfbf8;
  --panel: rgba(255,255,255,0.94);
  --panel2: rgba(255,255,255,0.94);
  --field: rgba(249,249,246,0.98);
  --field2: rgba(249,249,246,0.98);
  --border: rgba(34,34,34,0.16);
  --border2: rgba(34,34,34,0.24);
  --fieldBorder: rgba(34,34,34,0.20);
  --surface-card: rgba(255,255,255,0.98);
  --surface-col: rgba(246,244,238,0.96);
  --surface-calendar: rgba(250,248,243,0.96);
}

@media (prefers-color-scheme: light){
  html[data-theme="system"]{
    --bg: #fcfbf8;
    --bg2: #fcfbf8;
    --panel: rgba(255,255,255,0.94);
    --panel2: rgba(255,255,255,0.94);
    --field: rgba(249,249,246,0.98);
    --field2: rgba(249,249,246,0.98);
    --border: rgba(34,34,34,0.16);
    --border2: rgba(34,34,34,0.24);
    --fieldBorder: rgba(34,34,34,0.20);
    --surface-card: rgba(255,255,255,0.98);
    --surface-col: rgba(246,244,238,0.96);
    --surface-calendar: rgba(250,248,243,0.96);
  }
}

body{
  background: var(--bg);
}

html[data-theme="light"] body{
  background: var(--bg);
}

@media (prefers-color-scheme: light){
  html[data-theme="system"] body{
    background: var(--bg);
  }
}

.card,
.item,
.table tbody tr,
.stat-card,
.request-slide,
.card-mini,
.profile,
.brand,
.area-pick-card,
.check-item,
.review-action,
.date-picker-card,
.report-bars,
.custom-select-menu{
  background: var(--surface-card);
  border-color: var(--border);
  box-shadow: none;
}

html[data-theme="light"] .card,
html[data-theme="light"] .item,
html[data-theme="light"] .table tbody tr,
html[data-theme="light"] .stat-card,
html[data-theme="light"] .request-slide,
html[data-theme="light"] .card-mini,
html[data-theme="light"] .profile,
html[data-theme="light"] .brand,
html[data-theme="light"] .area-pick-card,
html[data-theme="light"] .check-item,
html[data-theme="light"] .review-action,
html[data-theme="light"] .date-picker-card,
html[data-theme="light"] .report-bars,
html[data-theme="light"] .custom-select-menu{
  background: var(--surface-card);
  border-color: var(--border);
}

html[data-theme="light"] .review-action.review-aprobado{
  border-color: rgba(34,197,94,0.34);
  background: rgba(34,197,94,0.08);
}

html[data-theme="light"] .review-action.review-retrabajo{
  border-color: rgba(249,115,22,0.38);
  background: rgba(249,115,22,0.08);
}

html[data-theme="light"] .review-action.review-rechazado{
  border-color: rgba(239,68,68,0.38);
  background: rgba(239,68,68,0.08);
}

html[data-theme="light"] .review-action.review-aprobado:hover{
  border-color: rgba(34,197,94,0.48);
  background: rgba(34,197,94,0.11);
}

html[data-theme="light"] .review-action.review-retrabajo:hover{
  border-color: rgba(249,115,22,0.50);
  background: rgba(249,115,22,0.12);
}

html[data-theme="light"] .review-action.review-rechazado:hover{
  border-color: rgba(239,68,68,0.52);
  background: rgba(239,68,68,0.12);
}

html[data-theme="light"] .review-action.review-aprobado.active{
  border-color: rgba(34,197,94,0.56);
  background: rgba(34,197,94,0.16);
}

html[data-theme="light"] .review-action.review-retrabajo.active{
  border-color: rgba(249,115,22,0.58);
  background: rgba(249,115,22,0.18);
}

html[data-theme="light"] .review-action.review-rechazado.active{
  border-color: rgba(239,68,68,0.60);
  background: rgba(239,68,68,0.18);
}

.kanban.kanban-calendar{
  background: var(--surface-calendar);
  border-color: var(--border);
  box-shadow: none;
}

html[data-theme="light"] .kanban.kanban-calendar{
  background: var(--surface-calendar);
  border-color: var(--border);
}

.col{
  background: var(--surface-col);
  border-color: color-mix(in srgb, var(--accent) 22%, var(--border));
  box-shadow: none;
}

html[data-theme="light"] .col{
  background: var(--surface-col);
  border-color: color-mix(in srgb, var(--accent) 22%, var(--border));
}

.col-head{
  border-bottom-color: color-mix(in srgb, var(--accent) 18%, var(--border));
}

.btn,
.input,
.textarea,
.select,
.date-trigger,
.calendar-arrow{
  background: var(--field);
  border-color: var(--fieldBorder);
  box-shadow: none;
}

.btn-primary{
  background: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 68%, #000 32%);
  color: #fff;
  box-shadow: none;
}

.btn-primary:hover{
  background: #e9781f;
  border-color: color-mix(in srgb, var(--accent) 68%, #000 32%);
}

.report-bar{
  background: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 64%, transparent);
}

.brand-dot,
.avatar{
  background: color-mix(in srgb, var(--accent) 20%, var(--surface-card));
  box-shadow: none;
}

html[data-theme="light"] .chat-launcher{
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--surface-card) 94%, var(--accent) 6%),
    color-mix(in srgb, var(--surface-col) 92%, var(--surface-card) 8%)
  );
  border-color: color-mix(in srgb, var(--accent) 34%, var(--border));
  color: var(--text);
}

html[data-theme="light"] .chat-launcher:hover{
  border-color: color-mix(in srgb, var(--accent) 48%, var(--border));
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--surface-card) 90%, var(--accent) 10%),
    color-mix(in srgb, var(--surface-col) 86%, var(--accent) 14%)
  );
}

html[data-theme="light"] .chat-launcher.active{
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--surface-card) 86%, var(--accent) 14%),
    color-mix(in srgb, var(--surface-col) 80%, var(--accent) 20%)
  );
}

html[data-theme="light"] .chat-launcher-ico{
  background: color-mix(in srgb, var(--accent) 18%, var(--surface-card));
  color: color-mix(in srgb, var(--accent) 76%, #7a3a0f 24%);
}

html[data-theme="light"] .chat-launcher-dot{
  border-color: var(--surface-card);
}

#dashboard-requests-body,
#myreq-requests-body{
  display: grid;
  gap: 10px;
  padding-top: 12px;
  padding-bottom: 6px;
}

#myreq-requests-body{
  padding-top: 4px;
}

#myreq-requests-body > .list{
  padding-top: 0;
}

#review-requests-scroll > .list{
  padding-bottom: 6px;
}

.list{
  padding-top: 10px;
  padding-bottom: 0;
}

@media (prefers-color-scheme: light){
  html[data-theme="system"] .card,
  html[data-theme="system"] .item,
  html[data-theme="system"] .table tbody tr,
  html[data-theme="system"] .stat-card,
  html[data-theme="system"] .request-slide,
  html[data-theme="system"] .card-mini,
  html[data-theme="system"] .profile,
  html[data-theme="system"] .brand,
  html[data-theme="system"] .area-pick-card,
  html[data-theme="system"] .check-item,
  html[data-theme="system"] .review-action,
  html[data-theme="system"] .date-picker-card,
  html[data-theme="system"] .report-bars,
  html[data-theme="system"] .custom-select-menu{
    background: var(--surface-card);
    border-color: var(--border);
  }

  html[data-theme="system"] .review-action.review-aprobado{
    border-color: rgba(34,197,94,0.34);
    background: rgba(34,197,94,0.08);
  }

  html[data-theme="system"] .review-action.review-retrabajo{
    border-color: rgba(249,115,22,0.38);
    background: rgba(249,115,22,0.08);
  }

  html[data-theme="system"] .review-action.review-rechazado{
    border-color: rgba(239,68,68,0.38);
    background: rgba(239,68,68,0.08);
  }

  html[data-theme="system"] .review-action.review-aprobado:hover{
    border-color: rgba(34,197,94,0.48);
    background: rgba(34,197,94,0.11);
  }

  html[data-theme="system"] .review-action.review-retrabajo:hover{
    border-color: rgba(249,115,22,0.50);
    background: rgba(249,115,22,0.12);
  }

  html[data-theme="system"] .review-action.review-rechazado:hover{
    border-color: rgba(239,68,68,0.52);
    background: rgba(239,68,68,0.12);
  }

  html[data-theme="system"] .review-action.review-aprobado.active{
    border-color: rgba(34,197,94,0.56);
    background: rgba(34,197,94,0.16);
  }

  html[data-theme="system"] .review-action.review-retrabajo.active{
    border-color: rgba(249,115,22,0.58);
    background: rgba(249,115,22,0.18);
  }

  html[data-theme="system"] .review-action.review-rechazado.active{
    border-color: rgba(239,68,68,0.60);
    background: rgba(239,68,68,0.18);
  }

  html[data-theme="system"] .kanban.kanban-calendar{
    background: var(--surface-calendar);
    border-color: var(--border);
  }

  html[data-theme="system"] .col{
    background: var(--surface-col);
    border-color: color-mix(in srgb, var(--accent) 22%, var(--border));
  }

  html[data-theme="system"] .col.is-drop-target{
    border-color: color-mix(in srgb, var(--accent) 52%, var(--border));
    background: linear-gradient(
      180deg,
      color-mix(in srgb, var(--accent) 12%, var(--surface-col)),
      color-mix(in srgb, var(--accent) 7%, var(--surface-col))
    );
    box-shadow:
      inset 0 0 0 2px color-mix(in srgb, var(--accent) 28%, transparent),
      0 0 0 2px color-mix(in srgb, var(--accent) 12%, transparent),
      0 14px 30px color-mix(in srgb, var(--accent) 16%, transparent);
  }

  html[data-theme="system"] .col.is-drop-target .col-head{
    border-bottom-color: color-mix(in srgb, var(--accent) 34%, var(--border));
  }

  html[data-theme="system"] .chat-launcher{
    background: linear-gradient(
      180deg,
      color-mix(in srgb, var(--surface-card) 94%, var(--accent) 6%),
      color-mix(in srgb, var(--surface-col) 92%, var(--surface-card) 8%)
    );
    border-color: color-mix(in srgb, var(--accent) 34%, var(--border));
    color: var(--text);
  }

  html[data-theme="system"] .chat-launcher:hover{
    border-color: color-mix(in srgb, var(--accent) 48%, var(--border));
    background: linear-gradient(
      180deg,
      color-mix(in srgb, var(--surface-card) 90%, var(--accent) 10%),
      color-mix(in srgb, var(--surface-col) 86%, var(--accent) 14%)
    );
  }

  html[data-theme="system"] .chat-launcher.active{
    background: linear-gradient(
      180deg,
      color-mix(in srgb, var(--surface-card) 86%, var(--accent) 14%),
      color-mix(in srgb, var(--surface-col) 80%, var(--accent) 20%)
    );
  }

  html[data-theme="system"] .chat-launcher-ico{
    background: color-mix(in srgb, var(--accent) 18%, var(--surface-card));
    color: color-mix(in srgb, var(--accent) 76%, #7a3a0f 24%);
  }

  html[data-theme="system"] .chat-launcher-dot{
    border-color: var(--surface-card);
  }
}
