@import './tokens.css';

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
       background: var(--bg); color: var(--ink); min-height: 100vh; }
code, .mono { font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace; }

/* Shell */
.frame-top { background: var(--surface); border-bottom: 1px solid var(--line); padding: var(--s-3) var(--s-6); display: flex; justify-content: space-between; align-items: center; }
.brand { display: flex; align-items: center; gap: var(--s-2); }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.brand .name { font-weight: 700; font-size: var(--fs-14); }
.brand .sub { font-size: var(--fs-11); color: var(--muted); }
.tabs { background: var(--surface); border-bottom: 1px solid var(--line); padding: 0 var(--s-6); display: flex; gap: 4px; }
.tab { padding: 14px 16px; font-size: var(--fs-13); font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; text-decoration: none; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.whoami { display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs-12); color: var(--ink-3); }
.whoami .avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; font-size: var(--fs-12); display: flex; align-items: center; justify-content: center; }

/* Hero */
.hero { background: linear-gradient(135deg, var(--primary-dark), var(--primary) 60%, var(--primary-accent)); color: #fff; border-radius: var(--r-xl); padding: var(--s-6) 28px; display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-6); align-items: center; }
.hero .big { font-size: var(--fs-60); font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.hero .pre { font-size: var(--fs-11); opacity: .7; text-transform: uppercase; letter-spacing: .1em; margin-bottom: var(--s-2); }
.hero .caption { font-size: var(--fs-13); opacity: .85; margin-top: var(--s-2); }
.hero .mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4) var(--s-5); font-size: var(--fs-12); }
.hero .mini .l { opacity: .65; text-transform: uppercase; letter-spacing: .05em; font-size: var(--fs-10); }
.hero .mini .n { font-size: var(--fs-22); font-weight: 700; margin-top: 2px; }

/* Stat cards */
.cards-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-3); margin-top: var(--s-4); }
.card-stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-4); }
.card-stat.warn { border-left: 3px solid var(--red); }
.card-stat .lbl { font-size: var(--fs-10); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.card-stat .num { font-size: var(--fs-28); font-weight: 800; line-height: 1; letter-spacing: -0.02em; margin-top: 4px; }
.card-stat.warn .num { color: var(--red); }
.card-stat .foot { font-size: var(--fs-11); color: var(--muted); margin-top: 6px; }

/* Panels (generic) */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; }
.panel h4 { font-size: var(--fs-12); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 14px; display: flex; justify-content: space-between; }
.panel h4 .sub { font-size: var(--fs-11); color: var(--muted); font-weight: 500; text-transform: none; letter-spacing: 0; }

/* Pills */
.pill { padding: 7px 13px; border-radius: 20px; font-size: var(--fs-12); font-weight: 500; background: var(--surface); border: 1px solid var(--line); color: var(--ink-3); cursor: pointer; display: inline-flex; gap: 6px; }
.pill.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.pill.red { border-color: var(--red-border); background: var(--red-bg); color: var(--red-ink); font-weight: 600; }

/* Badges */
.badge { padding: 3px 9px; border-radius: 5px; font-size: var(--fs-10); font-weight: 700; text-transform: uppercase; letter-spacing: .02em; display: inline-block; }
.badge.pend { background: var(--line-2); color: var(--muted); }
.badge.prog { background: var(--blue-bg); color: var(--blue-ink); }
.badge.done { background: var(--green-bg); color: var(--green-ink); }
.badge.late { background: var(--red-bg); color: var(--red-ink); }
.badge.verify { background: var(--yellow-bg); color: var(--yellow-ink); }

/* Table */
.tbl { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.tbl .thead, .tbl .row { display: grid; grid-template-columns: 80px 1fr 180px 110px 130px 40px; gap: var(--s-4); padding: 12px 16px; align-items: center; font-size: var(--fs-12); }
.tbl .thead { background: #f8fafc; border-bottom: 1px solid var(--line); font-size: var(--fs-10); font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.tbl .row { border-top: 1px solid var(--line-2); cursor: pointer; }
.tbl .row:first-of-type { border-top: 0; }
.tbl .row:hover { background: #f8fafc; }
.tbl .row.late { background: var(--red-bg); }
.tbl .row.verify { background: var(--blue-bg); }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.5); display: none; align-items: center; justify-content: center; z-index: 100; }
.modal-overlay.open { display: flex; }
.modal { background: var(--surface); border-radius: var(--r-xl); max-width: 680px; width: 92vw; max-height: 88vh; overflow: auto; padding: 24px 28px; }

/* Utilities */
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--s-4); margin-top: 18px; }
.hidden { display: none !important; }

/* Panel view (Task 9) */
.atn-item { display: grid; grid-template-columns: 18px 1fr 130px; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line-2); align-items: start; cursor: pointer; }
.atn-item:first-of-type { border-top: 0; }
.pill-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; background: var(--muted); }
.pill-dot.red { background: var(--red); }
.pill-dot.orange { background: var(--orange); }
.pill-dot.amber { background: var(--amber); }
.submesa { margin-bottom: 14px; }
.submesa:last-child { margin-bottom: 0; }

/* Timeline (Gantt by submesa) */
.timeline-legend { display: flex; gap: 14px; padding: 10px 4px 14px; font-size: 11px; color: var(--ink-3); flex-wrap: wrap; }
.timeline-legend .leg { display: inline-flex; align-items: center; gap: 5px; }
.timeline-legend .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.timeline { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.tl-header { display: grid; grid-template-columns: 260px repeat(8, 1fr); background: #f8fafc; border-bottom: 1px solid var(--line); }
.tl-header > div { padding: 10px 12px; font-size: var(--fs-10); font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; border-left: 1px solid var(--line-2); }
.tl-header .tl-label { border-left: 0; }
.tl-body { position: relative; }
.tl-submesa-header { background: #fafafa; padding: 10px 16px; font-size: 11px; font-weight: 700; color: var(--ink-2); border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); display: flex; justify-content: space-between; align-items: center; }
.tl-submesa-header .meta { font-size: 10px; color: var(--muted); font-weight: 500; text-transform: none; }
.tl-row { display: grid; grid-template-columns: 260px repeat(8, 1fr); border-bottom: 1px solid var(--line-2); cursor: pointer; align-items: center; min-height: 34px; position: relative; }
.tl-row:hover { background: #f8fafc; }
.tl-row .tl-label { padding: 6px 12px; font-size: var(--fs-12); color: var(--ink-2); display: flex; gap: 8px; align-items: center; overflow: hidden; }
.tl-row .tl-label .id { font-size: 10px; color: var(--muted); flex-shrink: 0; }
.tl-row .tl-label .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-grid { grid-column: 2 / -1; position: relative; display: grid; grid-template-columns: repeat(8, 1fr); height: 100%; min-height: 28px; }
.tl-col { border-left: 1px solid var(--line-2); height: 100%; }
.tl-col:first-child { border-left: 0; }
.tl-bar { position: absolute; height: 16px; top: 50%; transform: translateY(-50%); border-radius: 4px; font-size: 9px; color: #fff; padding: 0 6px; display: flex; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; z-index: 2; font-weight: 600; letter-spacing: 0.01em; pointer-events: none; }
.tl-bar.done { background: var(--green); }
.tl-bar.late { background: var(--red); }
.tl-bar.prog { background: var(--blue); }
.tl-bar.verify { background: #d97706; }
.tl-bar.pend { background: var(--muted-2); }
.tl-today-line { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--red); z-index: 5; pointer-events: none; }
.tl-today-label { position: absolute; top: 4px; left: 50%; transform: translateX(-50%); background: var(--red); color: #fff; font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 3px; text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
