/* ========= Theme tokens */
:root{
  --ath-bg:#f8fafc;
  --ath-card:#ffffff;
  --ath-ink:#0f172a;
  --ath-muted:#6b7280;
  --ath-ring:#10b981;           /* anillo hover avatar */
  --ath-primary:#0ea5e9;        /* botones */
  --ath-success:#10b981;
  --ath-shadow:0 8px 24px rgba(0,0,0,.06);
  --ath-radius:16px;
}

/* Layout base */
.ath-wrap{max-width:1200px;margin:0 auto;padding:24px;display:grid;grid-template-columns:260px 1fr;gap:24px;background:var(--ath-bg)}
@media (max-width:1024px){ .ath-wrap{grid-template-columns:1fr} }

/* Header estilo LP */
.ath-header{grid-column:1/-1;display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}
.ath-h-left{display:flex;gap:16px;align-items:center}
.ath-avatar img,.ath-avatar .avatar{width:72px;height:72px;border-radius:9999px;box-shadow:var(--ath-shadow);object-fit:cover}
.ath-title{font-size:34px;line-height:1.1;margin:0 0 4px;color:var(--ath-ink)}
.ath-bc{color:var(--ath-muted);font-size:14px}
.ath-bc a{color:var(--ath-muted);text-decoration:none}
.ath-name{margin-top:6px;color:var(--ath-muted)}

/* Sidebar */
.ath-side{background:var(--ath-card);border-radius:var(--ath-radius);box-shadow:var(--ath-shadow);padding:12px;height:max-content}
.ath-side nav a{display:flex;align-items:center;gap:10px;padding:12px;border-radius:12px;color:var(--ath-ink);text-decoration:none}
.ath-side nav a.is-active{background:#eef2ff}
.ath-sep{border:none;border-top:1px solid #e5e7eb;margin:10px 0}

/* Main */
.ath-main{}
.ath-h2{margin:0 0 12px}

/* KPIs */
.ath-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:16px;margin-bottom:16px}
.ath-card{background:var(--ath-card);border-radius:var(--ath-radius);box-shadow:var(--ath-shadow);padding:16px}
.ath-num{font-size:28px;font-weight:700}
.ath-muted{color:var(--ath-muted)}
.ath-alert{background:#ecfdf5;border-left:4px solid var(--ath-success);padding:12px;border-radius:12px;margin-bottom:12px}

/* Tabla cursos/órdenes */
table.ath-t{width:100%;border-collapse:separate;border-spacing:0 10px}
table.ath-t td{background:var(--ath-card);padding:12px;vertical-align:middle}
table.ath-t td:first-child{border-radius:12px 0 0 12px}
table.ath-t td:last-child{border-radius:0 12px 12px 0}
.ath-row{display:flex;align-items:center;gap:14px}
.ath-thumb{width:84px;height:64px;object-fit:cover;border-radius:10px}
.ath-td-actions{text-align:right}

/* Botones */
.ath-btn{display:inline-block;background:var(--ath-primary);color:#fff;padding:10px 14px;border-radius:10px;text-decoration:none;transition:filter .15s}
.ath-btn:hover{filter:brightness(.95)}
.ath-btn.secondary{background:var(--ath-success)}

/* Form */
.ath-form label{display:block;margin:.5rem 0 .25rem;color:var(--ath-ink)}
.ath-form input{width:100%;padding:.6rem .8rem;border:1px solid #e5e7eb;border-radius:10px}

/* ==== Header account button (avatar + caret + dropdown) */
.ath-acc{position:relative;display:inline-flex;align-items:center;gap:6px}
.ath-acc-btn{display:flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:9999px;background:#eef2ff;overflow:hidden;transition: box-shadow .2s ease, transform .06s ease}
.ath-acc-btn:hover{ box-shadow:0 0 0 3px var(--ath-ring), 0 6px 18px rgba(0,0,0,.08); transform: translateY(-1px) }
.ath-acc-btn:active{ transform: translateY(0) }
.ath-acc-btn img{width:100%;height:100%;object-fit:cover}

/* caret sin estilos del theme */
.ath-caret{all:unset;width:26px;height:26px;border-radius:9999px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;background:transparent !important;padding:0 !important;box-shadow:none !important;border:none !important}
.ath-caret:hover{ box-shadow:0 0 0 2px var(--ath-ring) }

/* dropdown */
.ath-dd{position:absolute;right:0;top:48px;min-width:220px;background:#fff;border:1px solid #e5e7eb;border-radius:12px;box-shadow:0 12px 32px rgba(0,0,0,.08);padding:10px;display:none;z-index:99}
.ath-dd a{display:block;padding:10px 12px;border-radius:8px;color:var(--ath-ink);text-decoration:none}
.ath-dd a:hover{background:#f1f5f9}

/* Desktop: hover abre menú y oculta caret. Móvil: se usa JS toggle */
@media (hover:hover){ .ath-acc:hover .ath-dd{ display:block } .ath-caret{ display:none } }
.ath-acc.is-open .ath-dd{ display:block }

/* Margen superior global si va pegado al header */
body .ath-wrap{margin-top:12px}