/* ===========================================================================
   Disciplinary app — the SHELL.

   This is the chrome that makes /disciplinary/ its own application rather than
   a page inside the polygraph system: sidebar, top bar, sign-in screen and the
   home dashboard's tiles.

   WHY THIS FILE EXISTS AND NOT ../styles.css
   ------------------------------------------
   disc.css already says it deliberately does not load styles.css — that file is
   53KB written around the polygraph shell and fights the .dc-* layout, and it
   re-declares .btn / .modal / .field in the polygraph's visual language. So the
   disciplinary app carries its own shell instead of borrowing one. Everything
   here is prefixed .da-* (disciplinary app) so it can never collide with the
   .dc-* workspace classes in disc.css, which this file loads AFTER.

   Load order in index.html:  disc.css  ->  disc-shell.css
   =========================================================================== */

/* The two apps share Agile Automate's branding but not their accent: the polygraph system
   runs on its navy/teal, the disciplinary app on the deep blue and amber used
   throughout the workspace hero. Same company, visibly different product. */
:root {
  --da-navy-900: #071d31;
  --da-navy-800: #0d3355;
  --da-ink-inv:  #ffffff;
  --da-nav:      #a9bed6;
  --da-nav-dim:  #6d87a7;
  --da-accent:   #d97706;   /* the disciplinary amber — the one deliberate difference */
  --da-line-inv: rgba(255,255,255,.08);
}

body { font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }

/* ---------- Scrollbars ----------
   Slim, rounded thumb in the workspace palette instead of the OS default —
   amber accent on hover everywhere; the dark sidebar nav gets a translucent
   white thumb so it stays visible against the navy background. */
* { scrollbar-width: thin; scrollbar-color: #c3cede transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c3cede; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--da-accent); }
::-webkit-scrollbar-corner { background: transparent; }
.da-nav { scrollbar-color: rgba(255,255,255,.28) transparent; }
.da-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.28); }
.da-nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.45); }

/* ============================================================ app shell ===
   The sidebar is a slide-in drawer at every screen size (not just tablets/
   phones) — the hamburger opens it as an overlay and it closes again on
   navigation, so the content column always has the full window width. */
.da-app { display: block; min-height: 100vh; }

.da-sidebar {
  background: linear-gradient(180deg, var(--da-navy-900), var(--da-navy-800));
  display: flex; flex-direction: column; height: 100vh;
  position: fixed; left: 0; top: 0; bottom: 0; width: min(288px, 86vw); z-index: 120;
  transform: translateX(-100%); transition: transform .25s ease;
  box-shadow: 0 30px 70px rgba(4,16,28,.45);
}
.da-sidebar.open { transform: none; }

/* ---- brand ---- */
.da-brand { display: flex; align-items: center; gap: 11px;
  padding: 16px 18px; border-bottom: 1px solid var(--da-line-inv); flex: none; }
.da-brand img { height: 40px; width: auto; max-width: 132px; object-fit: contain;
  background: #fff; border-radius: 9px; padding: 5px 7px; flex: none; }
.da-brand b { display: block; color: #fff; font-size: .96rem; line-height: 1.15; }
/* The product name is the amber line. It is the fastest way for someone with
   both apps open to know which tab they are looking at. */
.da-brand span { display: block; font-size: .7rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--da-accent); margin-top: 2px; }

/* ---- nav ---- */
.da-nav { padding: 10px 9px; flex: 1 1 auto; overflow-y: auto; }
.da-nav a { display: flex; align-items: center; gap: 11px; color: var(--da-nav);
  padding: 9px 12px; border-radius: 10px; font-weight: 600; font-size: .89rem;
  margin-bottom: 2px; cursor: pointer; text-decoration: none; }
.da-nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.da-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.da-nav a.on { background: var(--dc-brand-2); color: #fff; }
.da-nav a.on svg { opacity: 1; }
.da-section { font-size: .66rem; text-transform: uppercase; letter-spacing: .09em;
  color: var(--da-nav-dim); padding: 14px 12px 5px; font-weight: 700; }
/* External links (the manual, and the way back to the polygraph system) get a
   marker, so nobody is surprised when the sidebar disappears. */
.da-nav a.da-out::after { content: "↗"; margin-left: auto; opacity: .5; font-size: .8rem; }

/* ---- footer ---- */
.da-foot { padding: 12px 14px; border-top: 1px solid var(--da-line-inv); flex: none; }
.da-env { display: inline-block; font-size: .64rem; font-weight: 700; padding: 2px 8px;
  border-radius: 6px; margin-bottom: 9px; }
.da-env.live { background: #052e1c; color: #34d399; }
.da-env.demo { background: #3a2a00; color: #fbbf24; }
.da-signout { display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 9px; border-radius: 10px; cursor: pointer; font-weight: 700;
  font-size: .8rem; font-family: inherit; color: #fca5a5;
  background: rgba(220,38,38,.10); border: 1px solid rgba(248,113,113,.28); }
.da-signout:hover { background: rgba(220,38,38,.18); color: #fecaca; }
.da-signout svg { flex: none; }

/* ============================================================== top bar === */
.da-main { min-width: 0; display: flex; flex-direction: column; }
.da-topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center;
  gap: 12px; padding: 12px 22px; border-bottom: 1px solid var(--dc-line);
  background: rgba(255,255,255,.9); backdrop-filter: blur(8px); }
.da-topbar h1 { margin: 0; font-size: 1.12rem; color: var(--dc-ink); line-height: 1.2; }
.da-topbar .sub { color: var(--dc-muted); font-size: .82rem; margin-top: 1px; }
.da-spacer { flex: 1; }
.da-hamburger { display: block; background: none; border: 0; cursor: pointer; padding: 4px;
  color: var(--dc-ink); }
.da-topbar-logo { display: block; height: 30px; width: auto; object-fit: contain; flex: none; }

.da-content { padding: 0; width: 100%; min-width: 0; flex: 1 1 auto; }
/* The workspace and every screen here render inside a .dc-shell, which already
   owns the page padding and max width. Nesting it in .da-content must not add
   a second set of margins. */
.da-content > .dc-shell { max-width: 1500px; }

.da-scrim { position: fixed; inset: 0; background: rgba(7,29,49,.5); z-index: 110; }

/* ============================================================== sign-in === */
.da-login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 22px;
  background: radial-gradient(circle at 15% 0%, #123c66 0%, #071d31 55%, #04101c 100%); }
.da-login-card { width: 100%; max-width: 420px; background: #fff; border-radius: 20px;
  padding: 30px 28px; box-shadow: 0 30px 70px rgba(4,16,28,.45); }
.da-login-card .da-brand { border: 0; padding: 0; margin: 0 0 20px;
  flex-direction: column; text-align: center; gap: 10px; }
.da-login-card .da-brand img { background: transparent; padding: 0; height: 54px; max-width: 170px; }
.da-login-card .da-brand b { color: var(--dc-ink); font-size: 1rem; }
.da-login-card h2 { margin: 0 0 5px; font-size: 1.24rem; text-align: center; color: var(--dc-ink); }
.da-login-card .lead { margin: 0 0 20px; text-align: center; font-size: .88rem;
  color: var(--dc-muted); line-height: 1.5; }
.da-login-card .field { margin-bottom: 14px; }
.da-login-card .btn { width: 100%; min-height: 46px; font-size: .95rem; }
.da-pw { position: relative; }
.da-pw button { position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; cursor: pointer; color: var(--dc-muted); display: flex; padding: 3px; }
.da-login-note { margin-top: 16px; padding: 11px 13px; border-radius: 12px;
  background: var(--dc-soft); border: 1px solid var(--dc-line);
  font-size: .76rem; color: var(--dc-muted); line-height: 1.55; }

/* ================================================================= home === */
/* Navigation tiles on the home dashboard. Distinct from .dc-process (which
   STARTS a case) because these only go somewhere — same size, quieter. */
.da-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.da-tile { display: flex; flex-direction: column; gap: 5px; text-align: left;
  padding: 15px 16px; border-radius: 15px; border: 1px solid var(--dc-line);
  background: #fff; cursor: pointer; text-decoration: none; font-family: inherit;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.da-tile:hover { transform: translateY(-2px); border-color: #b9cee4;
  box-shadow: 0 12px 26px rgba(15,23,42,.09); }
.da-tile .ic { display: flex; color: var(--dc-brand-2); margin-bottom: 3px; }
.da-tile .t { font-size: 14px; font-weight: 800; color: var(--dc-ink); }
.da-tile .s { font-size: 12.5px; color: var(--dc-muted); line-height: 1.5; }

/* ============================================================= register === */
/* The same four-up strip as .dc-summary in the hero, in page-surface colours.
   .dc-summary paints its text white for the navy hero; on a white page that
   strip is invisible, which is why this is a separate class rather than a
   modifier on that one. */
.da-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px; margin: 0 0 16px; }
.da-stat { border-radius: 16px; padding: 15px 16px 13px; background: #fff;
  border: 1px solid var(--dc-line);
  display: flex; flex-direction: column; justify-content: center; text-align: center; }
.da-stat .k { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--dc-muted); font-weight: 700; margin-bottom: 9px; }
.da-stat .v { display: block; font-size: 1.4rem; font-weight: 800; color: var(--dc-ink); line-height: 1.1; }
.da-stat .s { display: block; margin-top: 5px; font-size: 12px; color: var(--dc-muted); }

.da-filters { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
.da-filters input, .da-filters select { border: 1px solid var(--dc-line); border-radius: 11px;
  padding: 9px 11px; font-size: 13px; color: var(--dc-ink); background: #fff;
  font-family: inherit; box-sizing: border-box; }
.da-table-wrap { overflow-x: auto; border: 1px solid var(--dc-line); border-radius: 14px; }
.da-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.da-table th { text-align: left; padding: 11px 13px; background: #f4f8fd; color: var(--dc-muted);
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700;
  white-space: nowrap; cursor: pointer; user-select: none; border-bottom: 1px solid var(--dc-line); }
.da-table th:hover { color: var(--dc-ink); }
.da-table th .ar { opacity: .45; margin-left: 4px; }
.da-table td { padding: 11px 13px; border-bottom: 1px solid #eef3f8; color: var(--dc-ink);
  vertical-align: middle; }
.da-table tr:last-child td { border-bottom: 0; }
.da-table tbody tr { cursor: pointer; }
.da-table tbody tr:hover td { background: #f7fbff; }
.da-mono { font-family: ui-monospace, Consolas, "Courier New", monospace; }
.da-ref { color: var(--dc-brand-2); font-weight: 700; white-space: nowrap; }

/* ========================================================== responsive === */
@media (max-width: 1180px) {
  .da-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .da-stats { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
  .da-topbar { padding: 10px 14px; }
}

@media print {
  .da-sidebar, .da-topbar, .da-scrim { display: none !important; }
  .da-app { display: block; }
  .da-content > .dc-shell { max-width: none; }
}
