/* NovaCore 23.0.0 · Fase 58 · Enterprise Design System 3.0
   Capa transversal visual. No cambia reglas de negocio ni esquema de datos. */

:root {
  --nc3-ink-950:#0b1220; --nc3-ink-900:#111827; --nc3-ink-800:#1f2937; --nc3-ink-700:#344054;
  --nc3-ink-600:#475467; --nc3-ink-500:#667085; --nc3-ink-400:#98a2b3; --nc3-ink-300:#cbd5e1;
  --nc3-canvas:#f4f7fb; --nc3-surface:#ffffff; --nc3-surface-2:#f8faff; --nc3-surface-3:#f1f5fb;
  --nc3-border:#dfe6ef; --nc3-border-strong:#c7d2e0; --nc3-primary:#5661ed; --nc3-primary-strong:#414bd4;
  --nc3-primary-soft:#eef0ff; --nc3-cyan:#21c6ef; --nc3-success:#168a5b; --nc3-warning:#c97808; --nc3-danger:#c93646;
  --nc3-info:#1976a5; --nc3-radius-xs:8px; --nc3-radius-sm:11px; --nc3-radius-md:15px; --nc3-radius-lg:20px;
  --nc3-radius-xl:26px; --nc3-shadow-1:0 1px 2px rgba(15,23,42,.035),0 7px 20px rgba(15,23,42,.035);
  --nc3-shadow-2:0 14px 38px rgba(15,23,42,.075); --nc3-shadow-float:0 24px 70px rgba(15,23,42,.16);
  --nc3-control-h:42px; --nc3-content-gap:1rem; --nc3-transition:160ms cubic-bezier(.2,.75,.3,1);
}

/* Shell */
body[data-design-system="nc3"] { background:var(--nc3-canvas); }
body[data-design-system="nc3"] .sidebar {
  background:radial-gradient(circle at 20% 0%,rgba(86,97,237,.22),transparent 28%),linear-gradient(180deg,#08111f 0%,#101b31 56%,#0c1628 100%);
  border-right:1px solid rgba(255,255,255,.065); box-shadow:12px 0 32px rgba(15,23,42,.035);
}
body[data-design-system="nc3"] .brand-sidebar { min-height:64px; }
body[data-design-system="nc3"] .nav-list { gap:.18rem; padding-right:.12rem; }
body[data-design-system="nc3"] .nav-section { margin-top:1rem; color:#71809d; font-size:.57rem; letter-spacing:.15em; }
body[data-design-system="nc3"] .nav-item { min-height:42px; border-radius:11px; padding:.55rem .65rem; font-size:.79rem; }
body[data-design-system="nc3"] .nav-item.active { background:linear-gradient(135deg,#5964ee,#5147cf); box-shadow:0 9px 22px rgba(55,50,170,.3); }
body[data-design-system="nc3"] .nav-item.active::before { height:20px; background:var(--nc3-cyan); }
body[data-design-system="nc3"] .topbar { background:rgba(255,255,255,.91); border-bottom-color:rgba(215,224,236,.9); box-shadow:0 8px 24px rgba(15,23,42,.025); }
body[data-design-system="nc3"] .topbar-title { font-size:.9rem; }
body[data-design-system="nc3"] .main-content { padding-top:calc(var(--topbar-height) + 1.35rem); }
body[data-design-system="nc3"] .presence { min-height:34px; padding:.3rem .5rem; background:#fff; box-shadow:var(--nc3-shadow-1); }
body[data-design-system="nc3"] .profile-menu-trigger { border-radius:13px; }

/* Page rhythm */
body[data-design-system="nc3"] .main-content > :is(section,div,article):not(.flash-stack) { min-width:0; }
body[data-design-system="nc3"] :is(.page-stack,.crm-enterprise-page,.attendance-page,.assets-page,.ai-enterprise-page,.projects-page,.tasks-page) { gap:var(--nc3-content-gap); }
body[data-design-system="nc3"] :is(.page-header,.page-hero) {
  border-color:var(--nc3-border); border-radius:var(--nc3-radius-lg); background:linear-gradient(135deg,#fff 0%,#fbfcff 60%,#f2fbff 100%);
  box-shadow:var(--nc3-shadow-1); margin-bottom:1rem;
}
body[data-design-system="nc3"] .page-header { padding:1.08rem 1.18rem; }
body[data-design-system="nc3"] .page-hero { min-height:126px; padding:1.08rem 1.18rem; }
body[data-design-system="nc3"] .page-hero.compact { min-height:108px; }
body[data-design-system="nc3"] :is(.page-header,.page-hero) h1 { font-size:clamp(1.35rem,2.2vw,1.9rem); letter-spacing:-.035em; margin-bottom:.36rem; }
body[data-design-system="nc3"] :is(.page-header,.page-hero) p { font-size:.76rem; line-height:1.55; }
body[data-design-system="nc3"] .eyebrow { margin-bottom:.45rem; font-size:.58rem; }
body[data-design-system="nc3"] .hero-symbol { width:48px; height:48px; flex-basis:48px; border-radius:14px; font-size:1.05rem; }

/* Panels */
body[data-design-system="nc3"] :is(.panel,.panel-card,.stat-card,.module-card,.admin-menu-card,.project-card,.workload-card) {
  border-color:var(--nc3-border); border-radius:var(--nc3-radius-md); box-shadow:var(--nc3-shadow-1); background:var(--nc3-surface);
}
body[data-design-system="nc3"] .panel { padding:1rem; }
body[data-design-system="nc3"] .panel-heading { margin:-1rem -1rem .25rem; padding:.9rem 1rem; }
body[data-design-system="nc3"] :is(.panel-heading,.panel-card-header) { border-bottom-color:#e8edf4; }
body[data-design-system="nc3"] :is(.panel-heading,.panel-card-header) h2 { font-size:.9rem; margin:0 0 .18rem; }
body[data-design-system="nc3"] :is(.panel-heading,.panel-card-header) p { font-size:.68rem; }
body[data-design-system="nc3"] .stat-grid { gap:.7rem; margin-bottom:.85rem; }
body[data-design-system="nc3"] .stat-card { min-height:92px; padding:.82rem; gap:.7rem; }
body[data-design-system="nc3"] .stat-card strong { font-size:1.35rem; margin:.12rem 0; }
body[data-design-system="nc3"] .stat-card small { font-size:.61rem; }
body[data-design-system="nc3"] .stat-card p { font-size:.61rem; }
body[data-design-system="nc3"] .stat-icon { width:38px; height:38px; border-radius:11px; font-size:.92rem; }

/* Buttons */
body[data-design-system="nc3"] .button {
  min-height:38px; padding:.55rem .78rem; border-radius:10px; font-size:.72rem; font-weight:780; letter-spacing:-.005em;
  box-shadow:none; transition:transform var(--nc3-transition),box-shadow var(--nc3-transition),background var(--nc3-transition),border-color var(--nc3-transition);
}
body[data-design-system="nc3"] .button:hover { transform:translateY(-1px); }
body[data-design-system="nc3"] :is(.button-primary,.button.primary) { background:linear-gradient(135deg,var(--nc3-primary),#4d49d6); border-color:transparent; color:#fff; box-shadow:0 7px 16px rgba(73,77,210,.18); }
body[data-design-system="nc3"] :is(.button-primary,.button.primary):hover { box-shadow:0 10px 22px rgba(73,77,210,.24); }
body[data-design-system="nc3"] :is(.button-secondary,.button.secondary) { background:var(--nc3-primary-soft); border-color:#d8dcff; color:var(--nc3-primary-strong); }
body[data-design-system="nc3"] :is(.button-outline,.button.outline) { border-color:var(--nc3-border-strong); color:var(--nc3-ink-700); background:#fff; }
body[data-design-system="nc3"] :is(.button-danger,.button.danger) { background:#b92f3f; border-color:#b92f3f; color:#fff; }
body[data-design-system="nc3"] :is(.button.small,.button-small,.button.compact) { min-height:32px; padding:.42rem .62rem; font-size:.65rem; border-radius:9px; }
body[data-design-system="nc3"] :is(.icon-button,.composer-action) { border-radius:10px; }

/* Forms */
body[data-design-system="nc3"] .main-content :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea,.form-control) {
  max-width:100%; border-color:#d4deeb; border-radius:10px; background:#fff; color:var(--nc3-ink-900); box-shadow:inset 0 1px 1px rgba(15,23,42,.018);
}
body[data-design-system="nc3"] .main-content :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,.form-control) { min-height:var(--nc3-control-h); padding:.6rem .72rem; font-size:.75rem; }
body[data-design-system="nc3"] .main-content textarea { min-height:104px; padding:.68rem .72rem; font-size:.75rem; line-height:1.5; resize:vertical; }
body[data-design-system="nc3"] .main-content :is(input,select,textarea,.form-control):focus { border-color:#8f98ef; box-shadow:0 0 0 3px rgba(86,97,237,.11); }
body[data-design-system="nc3"] :is(.form-label,.field>span,.field>label,.field label) { margin-bottom:.32rem; font-size:.65rem; color:#3d4a5f; }
body[data-design-system="nc3"] :is(.field-help,.form-help) { font-size:.61rem; line-height:1.45; }
body[data-design-system="nc3"] .field-error { font-size:.62rem; }
body[data-design-system="nc3"] .form-grid { gap:.72rem .85rem; }
body[data-design-system="nc3"] .form-actions { margin-top:.8rem; padding-top:.8rem; gap:.48rem; border-top-color:#e8edf4; }
body[data-design-system="nc3"] .check-label { font-size:.7rem; }
body[data-design-system="nc3"] :is(input[type=checkbox],input[type=radio]) { accent-color:var(--nc3-primary); }
body[data-design-system="nc3"] fieldset { min-width:0; border:1px solid var(--nc3-border); border-radius:12px; padding:.9rem; }
body[data-design-system="nc3"] legend { padding:0 .3rem; color:var(--nc3-ink-700); font-size:.65rem; font-weight:800; }

/* Tables */
.nc3-table-shell { width:100%; max-width:100%; overflow:auto; border:1px solid var(--nc3-border); border-radius:13px; background:#fff; scrollbar-width:thin; }
.nc3-table-shell > table { width:100%; margin:0; border:0 !important; border-collapse:separate; border-spacing:0; }
body[data-design-system="nc3"] .main-content table { font-size:.69rem; }
body[data-design-system="nc3"] .main-content table th { position:relative; padding:.66rem .72rem; background:#f8fafd; color:#596579; font-size:.58rem; font-weight:850; letter-spacing:.035em; text-transform:uppercase; border-bottom:1px solid var(--nc3-border); white-space:nowrap; }
body[data-design-system="nc3"] .main-content table td { padding:.68rem .72rem; color:#344054; border-bottom:1px solid #edf1f6; vertical-align:middle; }
body[data-design-system="nc3"] .main-content table tbody tr:last-child td { border-bottom:0; }
body[data-design-system="nc3"] .main-content table tbody tr { transition:background var(--nc3-transition); }
body[data-design-system="nc3"] .main-content table tbody tr:hover { background:#fafbfe; }
body[data-design-system="nc3"] .main-content table :is(a:not(.button),strong) { color:#1f2937; }

/* Status labels / chips */
body[data-design-system="nc3"] :is(.task-badge,.ticket-status,.ticket-priority,.status-badge,.badge,.chip,.pill,.project-code,.module-badge,.ticket-reference) {
  border-radius:999px; font-size:.57rem; font-weight:820; line-height:1.15; letter-spacing:.01em;
}
body[data-design-system="nc3"] :is(.status-approved,.status-completed,.status-resolved,.status-active,.status-success,.sync-synced) { background:#e8f7ef !important; color:#126747 !important; border-color:#ccebdc !important; }
body[data-design-system="nc3"] :is(.status-pending,.status-planned,.status-waiting_user,.status-in_review,.status-warning) { background:#fff6e7 !important; color:#8a5705 !important; border-color:#f2dfb9 !important; }
body[data-design-system="nc3"] :is(.status-rejected,.status-cancelled,.status-failed,.status-error,.priority-critical,.overdue) { background:#fff0f1 !important; color:#a92f3d !important; border-color:#f2cbd0 !important; }
body[data-design-system="nc3"] :is(.status-in_progress,.status-assigned,.status-open,.status-info) { background:#eaf4ff !important; color:#1f618b !important; border-color:#cfe3f5 !important; }
body[data-design-system="nc3"] :is(.status-blocked,.status-on_hold) { background:#f2edff !important; color:#6644a6 !important; border-color:#ded3f7 !important; }

/* Lists / empty / alerts */
body[data-design-system="nc3"] :is(.list-row,.task-row,.desk-ticket-row,.activity-item) { transition:background var(--nc3-transition),border-color var(--nc3-transition),transform var(--nc3-transition); }
body[data-design-system="nc3"] :is(.list-row,.task-row,.desk-ticket-row):hover { background:#fafbfe; }
body[data-design-system="nc3"] .empty-state { min-height:150px; padding:1.5rem; border:1px dashed #cfdae8; border-radius:14px; background:linear-gradient(180deg,#fff,#fafcff); color:var(--nc3-ink-500); }
body[data-design-system="nc3"] .empty-state > span:first-child { color:#7c86ed; }
body[data-design-system="nc3"] :is(.alert,.notice,.form-note) { border-radius:12px; box-shadow:none; }
body[data-design-system="nc3"] .alert { font-size:.7rem; }

/* Progress and metrics: values are injected by design-system-v3.js from data-* */
[data-progress] { --nc3-progress:0%; }
[data-progress-axis="y"] { --nc3-progress-y:0%; }
body[data-design-system="nc3"] :is(.task-progress-ring span,.project-progress span,.task-progress-bar,.workload-meter,.crm-bar,.inventory-progress,.drive-quota>span,.campaign-progress) {
  overflow:hidden; background:#edf1f7; border-radius:999px;
}
body[data-design-system="nc3"] :is(.task-progress-ring span i,.project-progress span i,.task-progress-bar i,.workload-meter i,.crm-bar i,.inventory-progress span,.drive-quota>span i,.campaign-progress span)[data-progress] {
  width:var(--nc3-progress); display:block; border-radius:inherit; background:linear-gradient(90deg,var(--nc3-primary),var(--nc3-cyan)); transition:width .3s ease;
}
body[data-design-system="nc3"] .ai-bar-column i[data-progress] { height:var(--nc3-progress); }
body[data-design-system="nc3"] .crm-health-ring { --score:0; }

/* Details / menus */
body[data-design-system="nc3"] details > summary { cursor:pointer; }
body[data-design-system="nc3"] :is(.profile-popover,.notification-popover,.crm-nav-menu) { border-color:var(--nc3-border); border-radius:15px; box-shadow:var(--nc3-shadow-float); }
body[data-design-system="nc3"] dialog, body[data-design-system="nc3"] [role=dialog] { border-radius:16px; }

/* Module-specific harmonization */
body[data-design-system="nc3"] .connect-shell { border-radius:15px; border-color:var(--nc3-border); box-shadow:var(--nc3-shadow-1); }
body[data-design-system="nc3"] .message-composer { background:#fbfcfe; }
body[data-design-system="nc3"] .message-bubble { border-radius:14px; }
body[data-design-system="nc3"] .crm-command-nav { border-radius:13px; box-shadow:var(--nc3-shadow-1); }
body[data-design-system="nc3"] .crm-command-primary > a, body[data-design-system="nc3"] .crm-nav-more > summary { min-height:35px; border-radius:9px; font-size:.64rem; }
body[data-design-system="nc3"] .projects-grid { gap:.8rem; }
body[data-design-system="nc3"] .task-row { border-radius:12px; }
body[data-design-system="nc3"] :is(.attendance-clock-card,.attendance-status-card,.asset-card,.drive-toolbar) { border-color:var(--nc3-border); }

/* Dynamic tenant preview */
[data-nc-accent] { --tenant-accent:var(--nc3-primary); }

/* Responsive */
@media (max-width:1180px) {
  body[data-design-system="nc3"] .stat-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  body[data-design-system="nc3"] .module-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media (max-width:900px) {
  :root { --nc3-content-gap:.8rem; }
  body[data-design-system="nc3"] .main-content { padding-left:.8rem; padding-right:.8rem; padding-top:calc(var(--topbar-height) + .9rem); }
  body[data-design-system="nc3"] :is(.page-header,.page-hero) { padding:.9rem; border-radius:15px; }
  body[data-design-system="nc3"] .page-header { gap:.8rem; }
  body[data-design-system="nc3"] .page-actions { width:100%; justify-content:flex-start; }
  body[data-design-system="nc3"] .form-grid.two, body[data-design-system="nc3"] .form-grid.three { grid-template-columns:1fr; }
  body[data-design-system="nc3"] :is(.span-two,.field.full,.field.full-width,.full-width) { grid-column:auto; }
  body[data-design-system="nc3"] .module-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  body[data-design-system="nc3"] .nc3-table-shell { border-radius:11px; }
}
@media (max-width:640px) {
  body[data-design-system="nc3"] .stat-grid, body[data-design-system="nc3"] .module-grid { grid-template-columns:1fr; }
  body[data-design-system="nc3"] .stat-card { min-height:82px; }
  body[data-design-system="nc3"] :is(.page-header,.page-hero) h1 { font-size:1.25rem; }
  body[data-design-system="nc3"] .button { min-height:37px; }
  body[data-design-system="nc3"] .form-actions { justify-content:stretch; }
  body[data-design-system="nc3"] .form-actions .button { flex:1 1 140px; }
  body[data-design-system="nc3"] .profile-trigger-copy { display:none; }
  body[data-design-system="nc3"] .presence { max-width:34px; overflow:hidden; color:transparent; padding:.25rem; justify-content:center; }
  body[data-design-system="nc3"] .presence i { flex:none; }
}
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior:auto !important; transition-duration:.001ms !important; animation-duration:.001ms !important; animation-iteration-count:1 !important; }
}
