  :root {
    --bg: #fdfaf5;
    --bg-elevated: #ffffff;
    --bg-sidebar: #f7f0e6;
    --bg-tint: #f5ebde;
    --bg-hover: rgba(200, 65, 43, 0.06);

    --border: rgba(74, 30, 15, 0.08);
    --border-strong: rgba(74, 30, 15, 0.14);

    --ink: #2a1810;
    --ink-soft: #6b4f3f;
    --ink-dim: #7a5c49;
    --ink-faint: #c4b09a;

    --red: #c8412b;
    --red-dark: #a13321;
    --red-soft: #e85d44;
    --red-light: #fde4dc;
    --gold: #f4b942;
    --gold-dark: #b8860b;
    --green: #4a7c3a;
    --green-soft: #6b9e58;
    --terracotta: #8b3a1f;
    --blue: #3b6e8f;
    --purple: #7c4a8f;

    --shadow-sm: 0 1px 2px rgba(74, 30, 15, 0.04);
    --shadow-md: 0 4px 12px rgba(74, 30, 15, 0.06);
    --shadow-lg: 0 12px 32px rgba(74, 30, 15, 0.08);

    --sidebar-width: 260px;
    --topbar-height: 56px;
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; }

  body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--ink);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.011em;
    overflow-x: hidden;
  }

  /* ===== SIDEBAR ===== */
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    z-index: 50;
    overflow-y: auto;
  }

  .sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    margin-bottom: 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
  }

  .sidebar-brand:hover { background: var(--bg-hover); }

  .brand-logo {
    width: 32px; height: 32px;
    background: var(--red);
    border-radius: 8px;
    display: grid; place-items: center;
    color: white;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 2px 6px rgba(200, 65, 43, 0.3);
  }

  .brand-info { flex: 1; min-width: 0; }

  .brand-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.2;
  }

  .brand-sub {
    font-size: 0.72rem;
    color: var(--ink-dim);
    margin-top: 1px;
  }

  .brand-chevron {
    color: var(--ink-dim);
    flex-shrink: 0;
  }

  /* Search */
  .search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 18px;
    cursor: pointer;
    transition: border-color 0.15s;
  }

  .search-box:hover { border-color: var(--border-strong); }

  .search-box svg { color: var(--ink-dim); flex-shrink: 0; }

  .search-text {
    font-size: 0.85rem;
    color: var(--ink);
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-family: inherit;
    min-width: 0;
  }

  .search-text::placeholder { color: var(--ink-dim); }

  .search-clear {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 4px;
    background: var(--bg-tint);
    color: var(--ink-dim);
    cursor: pointer;
    padding: 0;
  }

  .search-clear:hover { color: var(--ink); background: var(--border); }

  .search-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 32px 16px;
    color: var(--ink-dim);
    font-size: 0.85rem;
  }

  .search-empty-clear {
    display: inline-block;
    margin-top: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ink);
    background: var(--bg-tint);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 14px;
    cursor: pointer;
  }

  .search-empty-clear:hover { border-color: var(--border-strong); }

  .search-key {
    font-size: 0.7rem;
    color: var(--ink-dim);
    background: var(--bg-tint);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
  }

  /* Sidebar sections */
  .sidebar-section {
    margin-bottom: 20px;
  }

  .sidebar-label {
    font-size: 0.7rem;
    color: var(--ink-dim);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 4px 12px 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    border-radius: 6px;
    transition: color 0.15s;
  }

  .sidebar-label:hover { color: var(--ink); }

  .label-chevron {
    opacity: 0.6;
    transition: transform 0.2s ease;
    flex-shrink: 0;
  }

  .sidebar-section.collapsed .label-chevron { transform: rotate(-90deg); }

  .sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 1px;
    max-height: 500px;
    opacity: 1;
    overflow: hidden;
    transition: max-height 0.25s ease, opacity 0.2s ease;
  }

  .sidebar-section.collapsed .sidebar-nav {
    max-height: 0;
    opacity: 0;
  }

  .nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    border-radius: 6px;
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
  }

  .nav-item:hover { background: var(--bg-hover); color: var(--ink); }
  .nav-item.active { background: var(--bg-tint); color: var(--ink); font-weight: 600; }

  .nav-item svg {
    width: 16px; height: 16px;
    flex-shrink: 0;
    opacity: 0.7;
  }

  .nav-item.active svg { opacity: 1; color: var(--red); }

  .nav-badge {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--ink-dim);
    background: var(--bg-elevated);
    padding: 1px 7px;
    border-radius: 100px;
    font-weight: 600;
    border: 1px solid var(--border);
  }

  .nav-dot {
    margin-left: auto;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--green);
  }

  /* Sidebar footer */
  .sidebar-footer {
    margin-top: auto;
    padding: 12px 10px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .sidebar-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--red) 0%, var(--gold) 100%);
    display: grid; place-items: center;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
  }

  .sidebar-user { flex: 1; min-width: 0; }

  .user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.2;
  }

  .user-role {
    font-size: 0.72rem;
    color: var(--ink-dim);
    margin-top: 1px;
  }

  .user-role.is-ceo-active { color: var(--green); font-weight: 600; }

  .ceo-btn {
    width: 28px; height: 28px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--ink-soft);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: all 0.15s;
    flex-shrink: 0;
  }

  .ceo-btn:hover { background: var(--bg-tint); color: var(--ink); }

  .ceo-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(42, 24, 16, 0.35);
    backdrop-filter: blur(2px);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
  }

  .ceo-modal-overlay.open { display: flex; }

  .ceo-modal {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    padding: 24px;
    width: 320px;
    max-width: 90vw;
  }

  .ceo-modal h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
  }

  .ceo-modal p {
    font-size: 0.8rem;
    color: var(--ink-soft);
    margin-bottom: 16px;
    line-height: 1.4;
  }

  .ceo-modal input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    margin-bottom: 10px;
    outline: none;
  }

  .ceo-modal input:focus { border-color: var(--red); }

  .ceo-modal-error {
    font-size: 0.78rem;
    color: var(--red);
    margin-bottom: 10px;
    min-height: 1em;
  }

  .ceo-modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
  }

  .ceo-modal-btn {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
  }

  .ceo-modal-btn.primary { background: var(--red); color: white; }
  .ceo-modal-btn.primary:hover { background: var(--red-dark); }
  .ceo-modal-btn.secondary { background: transparent; color: var(--ink-soft); border-color: var(--border-strong); }
  .ceo-modal-btn.secondary:hover { background: var(--bg-tint); }

  /* ===== MAIN ===== */
  .main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
  }

  /* Topbar */
  .topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-height);
    background: rgba(253, 250, 245, 0.85);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    z-index: 40;
  }

  .breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--ink-soft);
  }

  .breadcrumb-item { color: var(--ink-soft); }
  .breadcrumb-item.current { color: var(--ink); font-weight: 600; }
  .breadcrumb-sep { color: var(--ink-faint); }

  .topbar-actions { display: flex; align-items: center; gap: 12px; }

  .icon-btn {
    width: 32px; height: 32px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--ink-soft);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: all 0.15s;
  }

  .icon-btn:hover {
    background: var(--bg-tint);
    color: var(--ink);
  }

  .icon-btn-relative { position: relative; }

  .icon-btn-badge {
    position: absolute;
    top: 4px; right: 4px;
    width: 7px; height: 7px;
    background: var(--red);
    border-radius: 50%;
    border: 1.5px solid var(--bg);
  }

  .time-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    background: var(--bg-tint);
    border-radius: 100px;
    font-size: 0.78rem;
    color: var(--ink-soft);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
  }

  .time-pill-dot {
    width: 6px; height: 6px;
    background: var(--green);
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(74, 124, 58, 0.15);
  }

  /* ===== CONTENT ===== */
  .content {
    padding: 32px;
    max-width: 1400px;
  }

  /* Page header */
  .page-header {
    margin-bottom: 32px;
  }

  .page-eyebrow {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--red);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
  }

  .page-title {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 8px;
  }

  .page-desc {
    font-size: 0.95rem;
    color: var(--ink-soft);
    max-width: 600px;
  }

  /* Quick stats row */
  .quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 32px;
  }

  .qstat {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 18px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s;
  }

  .qstat:hover { border-color: var(--border-strong); }

  .qstat-label {
    font-size: 0.75rem;
    color: var(--ink-soft);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
  }

  .qstat-icon {
    width: 18px; height: 18px;
    border-radius: 5px;
    display: grid; place-items: center;
    color: white;
    font-size: 0.7rem;
  }

  .qstat-icon.red { background: var(--red); }
  .qstat-icon.green { background: var(--green); }
  .qstat-icon.gold { background: var(--gold-dark); }
  .qstat-icon.blue { background: var(--blue); }

  .qstat-value {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
    margin-bottom: 4px;
  }

  .qstat-sub {
    font-size: 0.75rem;
    color: var(--ink-dim);
    font-weight: 500;
  }

  .qstat-pulse {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--green);
    font-weight: 600;
  }

  .qstat-pulse::before {
    content: '';
    width: 6px; height: 6px;
    background: var(--green);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
  }

  @keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(74, 124, 58, 0.5); }
    50% { opacity: 0.7; box-shadow: 0 0 0 5px rgba(74, 124, 58, 0); }
  }

  .qstat-pulse.is-checking { color: var(--ink-dim); }
  .qstat-pulse.is-checking::before { background: var(--ink-faint); animation: none; }
  .qstat-pulse.is-offline { color: var(--red); }
  .qstat-pulse.is-offline::before { background: var(--red); animation: none; }

  /* Section divider */
  .section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
  }

  .section-header-left {
    display: flex;
    align-items: baseline;
    gap: 10px;
  }

  .section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.015em;
  }

  .section-count {
    font-size: 0.78rem;
    color: var(--ink-dim);
    font-family: 'JetBrains Mono', monospace;
  }

  .exec-last-updated {
    font-size: 0.78rem;
    color: var(--ink-dim);
    font-family: 'JetBrains Mono', monospace;
  }

  .section-link {
    font-size: 0.8rem;
    color: var(--ink-soft);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.15s;
  }

  .section-link:hover { background: var(--bg-tint); color: var(--ink); }

  /* App cards grid */
  .apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
  }

  .app-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s, border-color 0.3s;
    display: flex;
    flex-direction: column;
  }

  .app-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-strong);
  }

  .app-preview {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
  }

  .app-preview svg { width: 100%; height: 100%; display: block; }

  .preview-hr-bg { background: linear-gradient(135deg, #fde4dc 0%, #f9c4b5 100%); }
  .preview-ops-bg { background: linear-gradient(135deg, #e3f0db 0%, #c8e0b8 100%); }
  .preview-finance-bg { background: linear-gradient(135deg, #fdf2d4 0%, #f9e0a3 100%); }
  .preview-sales-bg { background: linear-gradient(135deg, #f5e8dc 0%, #e8c8a0 100%); }
  .preview-maintenance-bg { background: linear-gradient(135deg, #dce8f0 0%, #b7d2e2 100%); }

  .preview-overlay {
    position: absolute;
    top: 10px; left: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 100px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--ink);
    z-index: 2;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  }

  .preview-overlay-dot {
    width: 5px; height: 5px;
    background: var(--green);
    border-radius: 50%;
  }

  .app-info {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .app-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 2px;
  }

  .app-tag::before {
    content: '';
    width: 5px; height: 5px;
    border-radius: 50%;
    background: currentColor;
  }

  .app-card[data-cat="hr"] .app-tag { color: var(--red); }
  .app-card[data-cat="ops"] .app-tag { color: var(--green); }
  .app-card[data-cat="finance"] .app-tag { color: var(--gold-dark); }
  .app-card[data-cat="sales"] .app-tag { color: var(--terracotta); }
  .app-card[data-cat="maintenance"] .app-tag { color: var(--blue); }

  .app-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .app-title {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ink);
  }

  .app-arrow {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--bg-tint);
    color: var(--ink-soft);
    display: grid; place-items: center;
    transition: all 0.25s;
    flex-shrink: 0;
  }

  .app-card:hover .app-arrow {
    background: var(--red);
    color: white;
    transform: scale(1.1);
  }

  .app-url {
    font-size: 0.75rem;
    color: var(--ink-dim);
    font-family: 'JetBrains Mono', monospace;
  }

  .app-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    font-size: 0.72rem;
    color: var(--ink-dim);
  }

  .app-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .app-meta-item svg { width: 12px; height: 12px; opacity: 0.6; }

  /* TWO COLUMN LAYOUT */
  .two-col {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 16px;
    margin-bottom: 40px;
  }

  /* Activity panel */
  .panel {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
  }

  .panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
  }

  .panel-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ink);
  }

  .panel-actions {
    display: flex;
    gap: 4px;
  }

  .panel-tab {
    font-size: 0.75rem;
    color: var(--ink-soft);
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.15s;
  }

  .panel-tab:hover { background: var(--bg-tint); color: var(--ink); }
  .panel-tab.active { background: var(--bg-tint); color: var(--ink); font-weight: 600; }

  /* Activity feed */
  .activity-list { display: flex; flex-direction: column; }

  .activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
  }

  .activity-item:last-child { border-bottom: none; }

  .activity-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: grid; place-items: center;
    color: white;
    font-size: 0.85rem;
    flex-shrink: 0;
  }

  .activity-icon.red { background: var(--red-light); color: var(--red); }
  .activity-icon.green { background: #e3f0db; color: var(--green); }
  .activity-icon.gold { background: #fdf2d4; color: var(--gold-dark); }
  .activity-icon.terra { background: #f5e8dc; color: var(--terracotta); }

  .activity-content { flex: 1; min-width: 0; }

  .activity-title {
    font-size: 0.85rem;
    color: var(--ink);
    font-weight: 500;
    line-height: 1.35;
  }

  .activity-title strong { font-weight: 600; }

  .activity-time {
    font-size: 0.72rem;
    color: var(--ink-dim);
    margin-top: 2px;
  }

  .activity-tag {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 6px;
    background: var(--bg-tint);
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  /* Sidebar panel widgets */
  .widget {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 16px;
  }

  .widget:last-child { margin-bottom: 0; }

  .widget-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  /* Calendar widget */
  .cal-day {
    text-align: center;
    margin-bottom: 12px;
  }

  .cal-month {
    font-size: 0.72rem;
    color: var(--red);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }

  .cal-date {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1;
    margin: 4px 0;
  }

  .cal-weekday {
    font-size: 0.78rem;
    color: var(--ink-soft);
    font-weight: 500;
  }

  .cal-events {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
  }

  .cal-event {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 0.78rem;
    color: var(--ink-soft);
  }

  .cal-event-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--ink-dim);
    font-weight: 500;
    min-width: 38px;
  }

  .cal-event-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
  }

  /* Status widget */
  .status-list { display: flex; flex-direction: column; gap: 8px; }

  .status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
  }

  .status-row-left {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
    font-weight: 500;
  }

  .status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 3px rgba(74, 124, 58, 0.12);
  }

  .status-value {
    font-size: 0.72rem;
    color: var(--green);
    font-weight: 600;
  }

  .status-dot.is-checking { background: var(--ink-faint); box-shadow: 0 0 0 3px rgba(154, 130, 112, 0.12); }
  .status-dot.is-offline { background: var(--red); animation: alertPulse 1.2s infinite; }
  .status-value.is-checking { color: var(--ink-dim); }
  .status-value.is-offline { color: var(--red); font-weight: 700; }

  .preview-overlay-dot.is-checking { background: var(--ink-faint); }
  .preview-overlay-dot.is-offline { background: var(--red); animation: alertPulse 1.2s infinite; }

  /* Alerta real (caída de servicio) distinta del rojo decorativo estático
     usado como color de marca en el resto de la página. */
  @keyframes alertPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(200, 65, 43, 0.5); }
    50% { box-shadow: 0 0 0 6px rgba(200, 65, 43, 0); }
  }

  /* Categories overview */
  .categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 40px;
  }

  .cat-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
  }

  .cat-card:hover {
    border-color: var(--border-strong);
    background: var(--bg-tint);
  }

  .cat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
  }

  .cat-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: grid; place-items: center;
    color: white;
    font-size: 0.95rem;
  }

  .cat-card[data-cat="hr"] .cat-icon { background: var(--red); }
  .cat-card[data-cat="ops"] .cat-icon { background: var(--green); }
  .cat-card[data-cat="finance"] .cat-icon { background: var(--gold-dark); }
  .cat-card[data-cat="sales"] .cat-icon { background: var(--terracotta); }
  .cat-card[data-cat="maintenance"] .cat-icon { background: var(--blue); }

  .cat-count {
    font-size: 0.7rem;
    color: var(--ink-dim);
    background: var(--bg-tint);
    padding: 2px 8px;
    border-radius: 100px;
    font-weight: 600;
  }

  .cat-name {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 2px;
  }

  .cat-desc {
    font-size: 0.75rem;
    color: var(--ink-dim);
  }

  /* Executive summary (CEO only) */
  .exec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 40px;
  }

  .exec-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 18px;
  }

  .exec-card-title {
    font-size: 0.72rem;
    color: var(--ink-soft);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
  }

  .exec-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    padding: 3px 0;
  }

  .exec-stat-label {
    font-size: 0.8rem;
    color: var(--ink-dim);
  }

  .exec-stat-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }

  .exec-card-note {
    font-size: 0.72rem;
    color: var(--ink-dim);
    margin-top: 6px;
  }

  .exec-card-note.is-urgent {
    color: var(--red);
    font-weight: 700;
    font-size: 0.8rem;
  }

  .exec-card-body.is-pending,
  .exec-card-body.is-error {
    font-size: 0.8rem;
    color: var(--ink-dim);
  }

  .exec-card-body.is-error { font-style: italic; }

  /* SVG Animations */
  @keyframes barGrow {
    from { transform: scaleY(0); }
    to { transform: scaleY(1); }
  }

  @keyframes lineDraw {
    from { stroke-dashoffset: 1000; }
    to { stroke-dashoffset: 0; }
  }

  @keyframes fadeInUp {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
  }

  @keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
  }

  @keyframes donutDraw {
    from { stroke-dashoffset: 565; }
    to { stroke-dashoffset: var(--donut-offset, 0); }
  }

  @keyframes scaleIn {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
  }

  .preview-hr .avatar { animation: fadeInUp 0.5s ease-out backwards; }
  .preview-hr .avatar:nth-child(1) { animation-delay: 0.1s; }
  .preview-hr .avatar:nth-child(2) { animation-delay: 0.2s; }
  .preview-hr .avatar:nth-child(3) { animation-delay: 0.3s; }
  .preview-hr .avatar:nth-child(4) { animation-delay: 0.4s; }
  .preview-hr .avatar:nth-child(5) { animation-delay: 0.5s; }

  .app-card:hover .preview-hr .avatar { animation: float 2s ease-in-out infinite; }
  .app-card:hover .preview-hr .avatar:nth-child(2) { animation-delay: 0.2s; }
  .app-card:hover .preview-hr .avatar:nth-child(3) { animation-delay: 0.4s; }
  .app-card:hover .preview-hr .avatar:nth-child(4) { animation-delay: 0.6s; }

  .preview-ops .bar {
    transform-origin: bottom;
    animation: barGrow 0.6s cubic-bezier(0.4, 0, 0.2, 1) backwards;
  }
  .preview-ops .bar:nth-child(1) { animation-delay: 0.1s; }
  .preview-ops .bar:nth-child(2) { animation-delay: 0.15s; }
  .preview-ops .bar:nth-child(3) { animation-delay: 0.2s; }
  .preview-ops .bar:nth-child(4) { animation-delay: 0.25s; }
  .preview-ops .bar:nth-child(5) { animation-delay: 0.3s; }
  .preview-ops .bar:nth-child(6) { animation-delay: 0.35s; }
  .preview-ops .bar:nth-child(7) { animation-delay: 0.4s; }
  .preview-ops .bar:nth-child(8) { animation-delay: 0.45s; }

  .preview-finance .line {
    stroke-dasharray: 1000;
    animation: lineDraw 2s ease-out forwards;
  }
  .preview-finance .dot {
    opacity: 0;
    animation: fadeInUp 0.4s ease-out forwards;
  }
  .preview-finance .dot:nth-child(3) { animation-delay: 1.4s; }
  .preview-finance .dot:nth-child(4) { animation-delay: 1.6s; }

  .preview-sales .donut-segment {
    transform-origin: center;
    transform: rotate(-90deg);
    stroke-dasharray: 565;
    animation: donutDraw 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }

  .preview-sales .donut-label {
    opacity: 0;
    animation: scaleIn 0.6s ease-out 1.4s forwards;
  }

  @keyframes gearSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
  }

  .preview-maintenance .gear {
    transform-origin: center;
    animation: gearSpin 7s linear infinite;
  }

  .preview-maintenance .bolt {
    opacity: 0;
    animation: fadeInUp 0.5s ease-out forwards;
  }
  .preview-maintenance .bolt:nth-child(1) { animation-delay: 0.3s; }
  .preview-maintenance .bolt:nth-child(2) { animation-delay: 0.5s; }

  /* Card entry */
  .app-card { animation: fadeInUp 0.5s ease-out backwards; }
  .app-card:nth-child(1) { animation-delay: 0.05s; }
  .app-card:nth-child(2) { animation-delay: 0.1s; }
  .app-card:nth-child(3) { animation-delay: 0.15s; }
  .app-card:nth-child(4) { animation-delay: 0.2s; }

  /* Responsive */
  @media (max-width: 968px) {
    .two-col { grid-template-columns: 1fr; }
  }

  @media (max-width: 768px) {
    .sidebar {
      transform: translateX(-100%);
      transition: transform 0.3s;
    }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; }
    .content { padding: 20px; }
    .topbar { padding: 0 20px; }
  }
