/* AgenturOS grammar, locally scoped: standalone operation needs no shared service. */
.admin-console {
  --font-sans: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", sans-serif;
  --space-1: 8px; --space-2: 16px; --space-3: 24px; --space-4: 32px;
  --color-paper: #f5f5f7; --color-surface: #fff; --color-ink: #1d1d1f;
  --color-muted: #55555a; --color-line: #d2d2d7; --color-accent: #0066cc;
  --os-surface: var(--color-surface); --os-sidebar: #ececef; --os-ink: var(--color-ink);
  --os-muted: var(--color-muted); --os-line: var(--color-line); --os-accent: var(--color-accent);
  --os-selected: #e6f0fb; --os-nav-selected: #dcdce1; --os-radius: 10px;
  --os-fs-1: 12px; --os-fs-2: 13px; --os-fs-3: 14px; --os-fs-4: 17px; --os-fs-5: 24px;
  --text: var(--os-ink); --muted: var(--os-muted); --accent: var(--os-accent); --line: var(--os-line);
  font-family: var(--font-sans); font-size: var(--os-fs-3); padding-left: 210px; min-width: 0;
}
body:has(.admin-console:not(.hidden)) { background: #f5f5f7; }
body:has(.admin-console:not(.hidden)) .wrap { max-width: 1540px; padding-top: 24px; }
.admin-sidebar-brand { display: none; }
.admin-console .admin-sidebar-brand { display: block; font-size: 20px; font-weight: 700; letter-spacing: .04em; white-space: nowrap; padding: 4px 13px 23px; }
.admin-sidebar-brand span { display: block; font-size: var(--os-fs-1); font-weight: 450; letter-spacing: 0; color: var(--os-muted); margin-top: 5px; }
/* In-flow sidebar cannot cover an update notice inserted above the app. */
.admin-console #adminTabs { position: sticky; float: left; top: 95px; margin-left: -210px; width: 190px; flex-direction: column; align-items: stretch; gap: 6px; background: var(--os-sidebar); border: 1px solid var(--os-line); border-radius: var(--os-radius); padding: 20px 10px; box-shadow: none; }
.admin-console #adminTabs .tab { width: 100%; text-align: left; border: 0; background: transparent; color: var(--os-ink); font-size: var(--os-fs-3); font-weight: 550; border-radius: 6px; min-height: 44px; padding: 10px 12px; box-shadow: none; }
.admin-console #adminTabs .tab.active { background: var(--os-nav-selected); color: var(--os-ink); }
.admin-request-count { border-radius: 12px; background: #d6dbe4; color: #303640; padding: 1px 7px; font-size: var(--os-fs-1); margin-left: 6px; }
.admin-console .card { border-radius: var(--os-radius); background: var(--os-surface); border: 1px solid var(--os-line); box-shadow: none; backdrop-filter: none; }
.admin-console button, .admin-console input, .admin-console select { border-radius: 6px; box-shadow: none; min-height: 44px; font-weight: 500; }
.admin-console button { background: var(--os-surface); border-color: #8e8e93; }
.admin-console button.primary { background: var(--os-accent); color: white; border-color: var(--os-accent); }
.admin-console button:hover { filter: brightness(.97); }
.admin-console :focus-visible { outline: 3px solid var(--os-accent); outline-offset: 3px; }
.admin-console .muted { color: var(--os-muted); }
.admin-console input::placeholder { color: #65676e; opacity: 1; }
.admin-console #todayCard { background: transparent; border: 0; box-shadow: none; padding: 18px 0; }
.admin-console #dayTitle { font-size: var(--os-fs-5); font-weight: 650; letter-spacing: -.035em; text-transform: none; color: var(--os-ink); }
.admin-console #dayPicker { width: 100%; padding: 8px 0; }
.admin-console #dayPicker .admin-day-nav { justify-content: flex-start; }
.admin-console .admin-day-nav-label { font-weight: 550; border: 0; background: transparent; text-align: left; padding-left: 4px; }
.admin-console #adminOwnTimeHint { margin-bottom: 18px; font-weight: 400; }
.admin-console #dayPicker .dp-field { max-width: 240px; }
.admin-console #activeWorkersWrap { display: none !important; }
.admin-console #tableToolbar { border: 0; background: transparent; padding: 8px 0; box-shadow: none; }
.admin-console #btnExpandAll { display: none; }
.admin-console #daySum { font-weight: 550; }
.admin-console[data-admin-tab="today"] #adminOwnTimeHint, .admin-console[data-admin-tab="today"] #dayPicker > .dp-field, .admin-console[data-admin-tab="today"] #today { display: none !important; }
.admin-console:not([data-admin-tab="today"]) #adminDayWorkspace { display: none !important; }
.admin-day-workspace { display: grid; grid-template-columns: minmax(290px,1fr) minmax(350px,420px); gap: 24px; align-items: start; margin-top: 14px; }
.admin-day-master, .admin-day-detail { min-width: 0; background: var(--os-surface); border: 1px solid var(--os-line); border-radius: var(--os-radius); overflow: hidden; }
.admin-day-list-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 22px 22px 16px; font-size: var(--os-fs-2); }
.admin-day-list-head h3 { margin: 0; font-size: var(--os-fs-4); font-weight: 600; }
.admin-day-filters { padding: 0 20px 20px; display: flex; gap: 8px; flex-wrap: wrap; border-bottom: 1px solid var(--os-line); }
.admin-day-filters input { flex: 1; width: 130px; min-width: 90px; font-size: var(--os-fs-2); }
.admin-day-filters select { width: auto; max-width: 165px; font-size: var(--os-fs-2); }
.admin-day-person { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 19px 20px; border: 0; border-bottom: 1px solid var(--os-line); border-radius: 0 !important; text-align: left; min-height: 100px !important; }
.admin-day-person:last-child { border-bottom: 0; }
.admin-day-person[aria-current="true"] { background: var(--os-selected); }
.admin-day-avatar { flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; background: #e5e8ed; color: #4b5363; font-size: var(--os-fs-1); font-weight: 600; }
.admin-day-person-info { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.admin-day-person-info strong { display: block; font-size: var(--os-fs-3); font-weight: 600; }
.admin-day-person-info > .muted { display: block; margin-top: 3px; font-size: var(--os-fs-1); }
.admin-day-state { display: inline-flex; align-items: center; gap: 5px; font-size: var(--os-fs-1); color: #1b6e33; margin-top: 7px; }
.admin-day-state::before { content: ""; width: 6px; height: 6px; background: currentColor; border-radius: 50%; }
.admin-day-state.pending { color: #7a4a00; }.admin-day-state.pause { color: #6451a1; }.admin-day-state.ended { color: var(--os-muted); }
.admin-day-person-time { text-align: right; font-size: var(--os-fs-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.admin-day-person-time small { display: block; color: var(--os-muted); font-size: var(--os-fs-1); margin-top: 4px; }
.admin-day-detail-head { padding: 24px; border-bottom: 1px solid var(--os-line); }
.admin-day-detail-head h3 { margin: 0 0 6px; font-size: var(--os-fs-4); font-weight: 600; letter-spacing: -.02em; }
.admin-day-detail-head p { font-size: var(--os-fs-2); margin: 0; }
.admin-day-entry-section { padding: 22px 24px; border-bottom: 1px solid var(--os-line); }
.admin-day-entry-section h4 { margin: 0 0 16px; font-size: var(--os-fs-3); font-weight: 600; }
.admin-day-detail #dayTableWrap { margin: 0 !important; min-height: 0 !important; max-height: none !important; overflow: visible !important; }
.admin-day-detail table, .admin-day-detail tbody { display: block; min-width: 0; width: 100%; }
.admin-day-detail thead { display: none !important; }
.admin-day-detail tr.entryRow { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 16px; padding: 15px 0; background: transparent !important; border: 0; border-bottom: 1px solid var(--os-line); }
.admin-day-detail tr.entryRow:first-child { padding-top: 0; }.admin-day-detail tr.entryRow:last-child { border-bottom: 0; padding-bottom: 0; }
.admin-day-detail tr.entryRow td { display: block; padding: 0; border: 0; text-align: left; width: auto; font-size: var(--os-fs-2); min-width: 0; overflow-wrap: anywhere; }
.admin-day-detail tr.entryRow td::before { content: attr(data-label); display: block; font-size: var(--os-fs-1); color: var(--os-muted); font-weight: 400; margin-bottom: 2px; }
.admin-day-detail td[data-col="name"], .admin-day-detail td[data-col="selection"] { display: none !important; }
.admin-day-workspace.selection-mode td[data-col="selection"] { display: block !important; grid-column: 1/-1; }
.admin-day-detail td[data-col="kind"] { font-weight: 600; }
.admin-day-detail td[data-col="eventLabel"], .admin-day-detail td[data-col="status"] { grid-column: 1/-1; }
.admin-day-detail td[data-col="status"]::before { content: none; }
.admin-day-detail td .badge { background: #f2f2f5; color: var(--os-muted); font-size: var(--os-fs-1); box-shadow: none; border: 0; }
.admin-day-requests { padding: 22px 24px; }
.admin-day-requests > h3 { margin: 0 0 16px; font-size: var(--os-fs-3); font-weight: 600; }
.admin-day-requests p { font-size: var(--os-fs-2); overflow-wrap: anywhere; margin: 7px 0; }
.admin-day-request + .admin-day-request { border-top: 1px solid var(--os-line); margin-top: 22px; padding-top: 18px; }
.admin-day-comparison { background: #f2f2f5; padding: 11px 12px; border-radius: 6px; }
.admin-day-comparison strong { font-weight: 550; }
.admin-day-request-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.admin-day-request-actions button { flex: 1; font-size: var(--os-fs-2); }
/* An undecided request is neutral; blue is reserved for navigation and focus. */
.admin-console .admin-day-request-actions button.primary { background: var(--os-surface); border-color: #8e8e93; color: var(--os-ink); }
.admin-day-request-created { font-size: var(--os-fs-1) !important; margin-top: 14px !important; }
.admin-day-empty { padding: 40px 22px; color: var(--os-muted); text-align: center; }
.admin-day-empty strong { display: block; color: var(--os-ink); font-size: var(--os-fs-4); margin-bottom: 7px; }.admin-day-empty p { margin: 0; font-size: var(--os-fs-2); }
.admin-day-mobile-close { display: none; }
.admin-day-list-footer { padding: 12px 16px; border-top: 1px solid var(--os-line); }
.admin-day-list-footer button { font-size: var(--os-fs-1); color: var(--os-accent); border: 0; background: transparent; }
.admin-console .admin-request-panel { background: white; box-shadow: none; }
body:has(.admin-day-detail.is-open) #adminNotice { display: none !important; }
body:has(.admin-day-detail.is-open) #toast { top: auto; bottom: 18px; font-weight: 500; }
body:has(.admin-console:not(.hidden)) .public-news { box-shadow: none; backdrop-filter: none; border-radius: 10px; background: white; }
body:has(.admin-console:not(.hidden)) .public-news h2 { text-transform: none; letter-spacing: -.01em; }
@media (max-width: 1200px) { .admin-console { padding-left: 185px; }.admin-console #adminTabs { width: 170px; margin-left: -185px; }.admin-day-workspace { gap: 16px; grid-template-columns: minmax(250px,1fr) minmax(310px,350px); }.admin-day-person { padding: 17px 15px; }.admin-day-person-time { font-size: var(--os-fs-1); } }
@media (max-width: 1050px) { .admin-console { padding-left: 0; }.admin-console #adminTabs { position: static; float: none; margin-left: 0; width: 100%; flex-direction: row; flex-wrap: wrap; padding: 7px; }.admin-console #adminTabs .tab { width: auto; }.admin-console .admin-sidebar-brand { width: 100%; font-size: var(--os-fs-4); padding: 8px 10px; }.admin-sidebar-brand span { display: none; } }
@media (max-width: 1024px) { .admin-console { --os-fs-1: 14px; --os-fs-2: 14px; } }
@media (max-width: 760px) {
  .admin-console { --os-fs-3: 16px; --os-fs-4: 18px; --os-fs-5: 26px; }
  .admin-day-workspace { display: block; }.admin-console #todayCard { padding-top: 10px; }.admin-console #dayTitle { font-size: var(--os-fs-5); }
  .admin-day-detail { display: none; }.admin-day-detail.is-open { display: block; position: fixed; inset: 0; z-index: 1000; width: 100%; height: 100dvh; overflow-y: auto; border: 0; border-radius: 0; background: white; padding-bottom: env(safe-area-inset-bottom); }
  .admin-day-mobile-close { display: flex; justify-content: flex-end; padding: 8px 16px; position: sticky; top: 0; background: white; border-bottom: 1px solid var(--os-line); z-index: 1; }
  .admin-day-person { padding: 18px 14px; gap: 10px; }.admin-day-list-head { padding: 20px 16px 15px; }.admin-day-filters { padding: 0 14px 18px; }
  .admin-console #dayPicker .dp-field { width: 100%; max-width: none; }.admin-console #adminTabs { gap: 3px; }.admin-console #adminTabs .tab { font-size: var(--os-fs-2); padding: 8px 10px; }
}
@media (max-width: 359px) { .admin-day-person { gap: 8px; }.admin-day-avatar { display: none; }.admin-day-person-time { font-size: var(--os-fs-1); } }
@media (prefers-reduced-motion: no-preference) { .admin-console button { transition: background-color 150ms ease, color 150ms ease; } }

/* Shared overlays live outside #app; keep their appearance in the same admin grammar. */
body:has(.admin-console:not(.hidden)) :is(#yesNoOverlay, #choiceOverlay, #formOverlay) .card {
  background: #fff; color: #1d1d1f; border: 1px solid #d2d2d7; border-radius: 12px;
  backdrop-filter: none; box-shadow: 0 20px 50px #0004;
}
body:has(.admin-console:not(.hidden)) :is(#yesNoOverlay, #choiceOverlay, #formOverlay) button {
  min-height: 44px; border-radius: 6px; font-weight: 500;
}
body:has(.admin-console:not(.hidden)) :is(#yesNoOverlay, #choiceOverlay, #formOverlay) button.primary {
  background: #0066cc; border-color: #0066cc; color: #fff;
}
body:has(.admin-console:not(.hidden)) :is(#yesNoOverlay, #choiceOverlay, #formOverlay) :focus-visible {
  outline: 3px solid #0066cc; outline-offset: 3px;
}
body:has(.admin-console:not(.hidden)) #yesNoText { font-weight: 500 !important; white-space: pre-line; }

@media (max-width: 1024px) {
  .admin-console :is(button, input, select, textarea, .muted, .badge) { font-size: max(14px, 1em); }
  body:has(.admin-console:not(.hidden)) :is(#yesNoOverlay, #choiceOverlay, #formOverlay) { font-size: 16px; }
}

/* App identity remains visible before and after login, including narrow screens. */
.app-identity { display:contents; }
html[data-app-role] .app-identity { display:flex; align-items:center; gap:8px; flex-wrap:wrap; min-width:0; }
html[data-app-role] .app-identity h1 { margin:0; }
html[data-app-role] .topbar { flex-wrap:wrap; }
.app-role-label { font-size:13px; color:#55555a; border:1px solid #b9bcc3; border-radius:5px; padding:3px 7px; }
.role-app-entries:not(.hidden) { display:flex; gap:12px; flex-wrap:wrap; margin-bottom:16px; }
.role-app-entries a { display:inline-flex; align-items:center; min-height:44px; color:#0066cc; font-weight:600; }

.role-app-companion:not(.hidden) { display:inline-flex; align-items:center; min-height:44px; font-size:13px; color:#0066cc; text-underline-offset:3px; }
@media (max-width:600px) { html[data-app-role] .app-identity { width:100%; } .app-role-label { font-size:12px; } }

/* The catalog extends the existing master/detail workspace without changing day review. */
.admin-console .project-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; margin:24px 0 16px; }
.admin-console .project-heading h2 { margin:0; }
.admin-console .project-workspace { display:grid; grid-template-columns:minmax(240px,1fr) minmax(280px,1fr); gap:24px; align-items:start; }
.admin-console .project-filters { display:grid; grid-template-columns:minmax(0,1fr) 110px; gap:12px; }
.admin-console .project-filters input, .admin-console .project-filters select, .admin-console .project-editor input, .admin-console .project-editor select { width:100%; box-sizing:border-box; min-height:44px; }
.admin-console .project-row { display:grid; width:100%; text-align:left; padding:12px; gap:4px; border:0; border-bottom:1px solid var(--os-line,#d2d2d7); border-radius:0; background:transparent; }
.admin-console .project-row:hover { background:var(--os-selected,#e6f0fb); }
.admin-console .project-row span, .admin-console .project-row small { color:var(--os-muted,#515154); overflow-wrap:anywhere; }
.admin-console .project-row strong { overflow-wrap:anywhere; }
.admin-console .project-editor { background:var(--os-surface,#fff); border:1px solid var(--os-line,#d2d2d7); border-radius:10px; padding:20px; }
.admin-console .project-editor h3 { margin-top:0; }
.admin-console .project-editor label { display:block; margin:16px 0 6px; }
.admin-console .project-actions { display:flex; justify-content:flex-end; gap:12px; background:var(--os-surface,#fff); padding-top:16px; }
.admin-console #projectList { min-height:100px; }
.admin-console #projectBefore { white-space:pre-line; }
.admin-console #projectEditorInfo { overflow-wrap:anywhere; }
@media(max-width:760px) { .admin-console .project-workspace { grid-template-columns:1fr; } .admin-console .project-editor { order:-1; } .admin-console .project-heading { align-items:flex-start; } }

.admin-console #btnProjects.primary span { color:inherit; }
.admin-console .project-filters input::placeholder { color:var(--os-muted,#515154); opacity:1; }
