/* ===== Y-FLOW · Design System ===== */
:root {
  --navy: #141c2e;
  --navy-2: #1d2740;
  --navy-line: #2a3550;
  --orange: #e5661f;
  --orange-2: #cf5a19;
  --orange-soft: #fff3ea;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --text: #1d2431;
  --text-2: #414b5c;
  --muted: #77808f;
  --faint: #9aa2b1;
  --line: #e7eaf0;
  --line-2: #eef1f5;
  --green: #1f8a5b;
  --green-bg: #e8f6ee;
  --red: #cf4040;
  --red-bg: #fdecec;
  --blue: #2f6fb0;
  --blue-bg: #e9f2fb;
  --amber: #b9761a;
  --amber-bg: #fdf3e2;
  --violet: #7a4fb5;
  --violet-bg: #f3edfb;
  --grey: #5c6675;
  --grey-bg: #eef0f3;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm:
    0 1px 2px rgba(20, 28, 46, 0.05), 0 1px 3px rgba(20, 28, 46, 0.04);
  --shadow-md: 0 4px 16px rgba(20, 28, 46, 0.08);
  --sidebar-w: 246px;
}
* {
  box-sizing: border-box;
}
html {
  font-family:
    "Pretendard Variable",
    Pretendard,
    "Noto Sans KR",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Arial,
    sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body {
  margin: 0;
  line-height: 1.5;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
h1,
h2,
h3 {
  letter-spacing: -0.01em;
}

/* ===== Buttons ===== */
.button {
  display: inline-flex;
  gap: 6px;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: 0.15s;
  white-space: nowrap;
}
.button:hover {
  background: var(--surface-2);
  border-color: #d6dae2;
}
.button.primary {
  border-color: transparent;
  color: #fff;
  background: var(--orange);
  box-shadow: 0 1px 2px rgba(229, 102, 31, 0.35);
}
.button.primary:hover {
  background: var(--orange-2);
}
.button.quiet {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}
.button.quiet:hover {
  background: var(--grey-bg);
  color: var(--text-2);
}
.button.danger {
  border-color: #f0d2d2;
  color: var(--red);
  background: #fff;
}
.button.danger:hover {
  background: var(--red-bg);
  border-color: #e6b8b8;
}

/* ===== Layout shell ===== */
.app-shell {
  min-height: 100vh;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  color: #c7cfdd;
  background: var(--navy);
  z-index: 30;
}
.brand {
  height: 72px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 22px;
  border-bottom: 1px solid var(--navy-line);
}
.brand-logo {
  display: block;
  width: 40px;
  height: 40px;
  flex: none;
  object-fit: contain;
  border-radius: 9px;
}
.brand strong {
  display: block;
  color: #fff;
  font-size: 16px;
  letter-spacing: 0.01em;
}
.brand small {
  display: block;
  margin-top: 2px;
  color: #8b96a9;
  font-size: 11px;
}
.sidebar nav {
  flex: 1;
  display: grid;
  gap: 2px;
  align-content: start;
  padding: 16px 12px;
  overflow-y: auto;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 9px;
  color: #a3adbf;
  font-size: 14px;
  font-weight: 500;
  transition: 0.15s;
}
.nav-item svg {
  flex: none;
  opacity: 0.85;
}
.nav-item span {
  flex: 1;
}
.nav-item:hover {
  color: #fff;
  background: var(--navy-2);
}
.nav-item.active {
  color: #fff;
  background: var(--navy-2);
}
.nav-item.active svg {
  opacity: 1;
  color: var(--orange);
}
.nav-item b {
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 10px;
  color: #dfe4ec;
  background: #39435c;
  font-size: 11px;
  font-weight: 700;
}
.nav-item b.alert {
  color: #fff;
  background: var(--orange);
}
.user {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 16px 18px;
  border-top: 1px solid var(--navy-line);
}
.avatar {
  display: grid;
  width: 38px;
  height: 38px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #e8ebf0, #d6dbe4);
  color: #3f4855;
  font-weight: 700;
}
.user-meta {
  flex: 1;
  min-width: 0;
}
.user-meta strong {
  display: block;
  color: #fff;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-meta small {
  display: block;
  margin-top: 2px;
  color: #8b96a9;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user form button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  color: #8b96a9;
  background: transparent;
  cursor: pointer;
  transition: 0.15s;
}
.user form button:hover {
  color: #fff;
  background: var(--navy-2);
}

.main-area {
  margin-left: var(--sidebar-w);
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 72px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
}
.topbar > div {
  flex: 1;
  min-width: 0;
}
.topbar h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}
.topbar p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}
.menu {
  display: none;
  border: 0;
  background: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-2);
}
.content {
  max-width: 1200px;
  margin: auto;
  padding: 28px 32px 72px;
}
.site-footer {
  padding: 0 32px 24px;
  color: var(--faint);
  text-align: center;
  font-size: 11.5px;
}
.site-footer strong,
.login-footer strong {
  color: var(--muted);
  font-weight: 700;
}

/* ===== Flash ===== */
.flash {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 20px;
  padding: 13px 16px;
  border: 1px solid #bfe4cf;
  border-radius: var(--radius-sm);
  color: var(--green);
  background: var(--green-bg);
  font-size: 13px;
  font-weight: 500;
}
.flash.error {
  border-color: #f0cccc;
  color: var(--red);
  background: var(--red-bg);
}
.flash::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

/* ===== Cards / panels ===== */
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-2);
}
.panel h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}
.panel header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11.5px;
}
.panel-link {
  color: var(--orange);
  font-size: 12.5px;
  font-weight: 600;
}
.panel-link:hover {
  color: var(--orange-2);
}
.empty {
  padding: 44px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* ===== Badges & pills ===== */
.badge,
.priority {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1.4;
}
.badge {
  background: var(--grey-bg);
  color: var(--grey);
}
.status-approved {
  color: var(--green);
  background: var(--green-bg);
}
.status-rejected {
  color: var(--red);
  background: var(--red-bg);
}
.status-cancelled {
  color: var(--grey);
  background: var(--grey-bg);
}
.status-requester_review {
  color: var(--amber);
  background: var(--amber-bg);
}
.status-recipient_review {
  color: var(--blue);
  background: var(--blue-bg);
}
.status-final_approval {
  color: var(--violet);
  background: var(--violet-bg);
}
.status-revision_requested {
  color: var(--violet);
  background: var(--violet-bg);
}
.priority {
  background: var(--grey-bg);
  color: var(--grey);
}
.priority.important {
  color: var(--amber);
  background: var(--amber-bg);
}
.priority.urgent {
  color: var(--red);
  background: var(--red-bg);
}
.mono {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ===== Hero (dashboard) ===== */
.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 20px;
  padding: 30px 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(115deg, #fff6ef 0%, #fff 62%);
  box-shadow: var(--shadow-sm);
}
.hero::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -70px;
  width: 230px;
  height: 230px;
  border: 30px solid #fbe3d2;
  border-radius: 50%;
  opacity: 0.6;
}
.hero-text {
  position: relative;
  z-index: 1;
}
.eyebrow {
  display: inline-block;
  color: var(--orange);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.hero h2 {
  margin: 9px 0 10px;
  font-size: 25px;
  font-weight: 800;
  line-height: 1.4;
}
.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.flow-mini {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}
.flow-mini span {
  padding: 9px 13px;
  border: 1px solid #f0d3bd;
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  box-shadow: var(--shadow-sm);
}
.flow-mini i {
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: #e6b591;
}

/* ===== Summary stats ===== */
.summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}
.stat {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.stat-label {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}
.stat strong {
  display: block;
  margin: 10px 0 5px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.stat small {
  display: block;
  color: var(--faint);
  font-size: 11.5px;
}
.stat.danger {
  border-color: #f2d3d3;
  background: linear-gradient(180deg, #fff, #fdf4f4);
}
.stat.danger strong {
  color: var(--red);
}

/* ===== Dashboard grid ===== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.65fr 1fr;
  gap: 18px;
  align-items: start;
}
.request-row {
  display: grid;
  grid-template-columns: 1fr auto 92px;
  align-items: center;
  gap: 14px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line-2);
  transition: 0.12s;
}
.request-row:last-child {
  border: 0;
}
.request-row:hover {
  background: var(--surface-2);
}
.request-row-main {
  min-width: 0;
}
.request-row-main small {
  display: block;
  color: var(--faint);
  font-size: 11px;
  font-weight: 600;
}
.request-row-main strong {
  display: block;
  margin: 4px 0;
  font-size: 13.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.route {
  color: var(--muted);
  font-size: 11.5px;
}
.route em {
  color: var(--orange);
  font-style: normal;
  font-weight: 700;
  margin: 0 3px;
}
.request-row time {
  color: var(--faint);
  font-size: 11px;
  text-align: right;
}
.notice-list form {
  border-bottom: 1px solid var(--line-2);
}
.notice-list form:last-child {
  border: 0;
}
.notice {
  width: 100%;
  padding: 14px 20px;
  border: 0;
  text-align: left;
  background: transparent;
  cursor: pointer;
  transition: 0.12s;
}
.notice:hover {
  background: var(--surface-2);
}
.notice strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
}
.notice span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.notice time {
  display: block;
  margin-top: 6px;
  color: var(--faint);
  font-size: 10.5px;
}
.notice.unread {
  background: var(--orange-soft);
  box-shadow: inset 3px 0 var(--orange);
}
.notice.unread:hover {
  background: #ffeee0;
}

/* ===== Filters ===== */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.search-field {
  position: relative;
  flex: 1;
  min-width: 260px;
  display: flex;
  align-items: center;
}
.search-field svg {
  position: absolute;
  left: 12px;
  color: var(--faint);
}
.search-field input {
  width: 100%;
  padding-left: 36px;
}
.filters input,
.filters select {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 13px;
}
.filters select {
  min-width: 150px;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(229, 102, 31, 0.12);
}

/* ===== Table ===== */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}
th,
td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-2);
  text-align: left;
  font-size: 13px;
}
th {
  color: var(--muted);
  background: var(--surface-2);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
tbody tr {
  cursor: pointer;
  transition: 0.12s;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: var(--surface-2);
}
td strong {
  display: block;
  font-weight: 600;
}
td small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11.5px;
}
td.empty {
  cursor: default;
}

/* ===== Form card ===== */
.policy-note,
.equality-note,
.inbox-intro {
  display: flex;
  gap: 14px;
  margin-bottom: 18px;
  padding: 16px 20px;
  border: 1px solid #f0dcc9;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fff9f4, #fff);
}
.policy-icon,
.equality-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: var(--orange);
  background: var(--orange-soft);
}
.policy-note strong,
.equality-note strong {
  display: block;
  color: var(--orange-2);
  font-size: 13.5px;
  margin-bottom: 3px;
}
.policy-note span,
.equality-note p {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}
.equality-note p {
  margin: 0;
}
.form-shell {
  max-width: 880px;
  margin: 0 auto;
}
.form-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.form-card section {
  padding: 24px 26px;
  border-bottom: 1px solid var(--line-2);
}
.form-card h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
  font-size: 15px;
  font-weight: 700;
}
.sec-num {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--navy);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 20px;
}
.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}
.form-grid .full {
  grid-column: 1/-1;
}
.form-grid em {
  color: var(--red);
  font-style: normal;
  margin-left: 2px;
}
.form-card input,
.form-card select,
.form-card textarea {
  min-height: 44px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 14px;
  font-weight: 400;
}
.form-card input:disabled {
  background: var(--surface-2);
  color: var(--muted);
}
.form-card textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.65;
}
.form-card footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 26px;
}

/* ===== Detail ===== */
.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.detail-head-main {
  min-width: 0;
}
.detail-head h2 {
  margin: 10px 0 8px;
  font-size: 23px;
  font-weight: 800;
  line-height: 1.34;
}
.detail-head .route {
  font-size: 13px;
  color: var(--muted);
}
.dot-sep {
  margin: 0 5px;
  color: var(--faint);
}
.document-number {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.detail-head-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex: none;
}
.state-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  margin-bottom: 18px;
  padding: 14px 18px;
  border: 1px solid;
  border-radius: var(--radius);
  font-size: 12.5px;
}
.state-banner strong {
  font-size: 13px;
}
.state-banner span {
  color: var(--muted);
}
.state-banner.revision {
  border-color: #e2d3f2;
  background: var(--violet-bg);
}
.state-banner.revision strong {
  color: var(--violet);
}
.state-banner.reject {
  border-color: #f0cccc;
  background: var(--red-bg);
}
.state-banner.reject strong {
  color: var(--red);
}
.state-banner.cancel {
  border-color: var(--line);
  background: var(--grey-bg);
}
.state-banner.cancel strong {
  color: var(--grey);
}

/* Workflow stepper */
.workflow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.workflow .step {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-right: 1px solid var(--line-2);
}
.workflow .step:last-child {
  border-right: 0;
}
.workflow b {
  flex: none;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  color: var(--faint);
  font-size: 13px;
  font-weight: 700;
  background: var(--surface);
}
.workflow strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
}
.workflow small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}
.workflow .done {
  background: #f4faf6;
}
.workflow .done b {
  border-color: var(--green);
  color: #fff;
  background: var(--green);
}
.workflow .done strong {
  color: var(--green);
}
.workflow .current {
  background: var(--orange-soft);
}
.workflow .current b {
  border-color: var(--orange);
  color: #fff;
  background: var(--orange);
  box-shadow: 0 0 0 4px rgba(229, 102, 31, 0.15);
}
.workflow .current strong {
  color: var(--orange-2);
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 328px;
  gap: 20px;
  align-items: start;
}
.detail-col {
  display: grid;
  gap: 18px;
  min-width: 0;
}
.detail-side {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 16px;
}
.detail-main dl,
.meta dl {
  margin: 0;
  padding: 6px 22px 14px;
}
.detail-main dl div {
  padding: 18px 0;
  border-bottom: 1px solid var(--line-2);
}
.detail-main dl div:last-child {
  border: 0;
}
.detail-main dt,
.meta dt {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.detail-main dd,
.meta dd {
  margin: 0;
  line-height: 1.7;
  white-space: pre-line;
  font-size: 13.5px;
}
.meta dl div {
  padding: 13px 0;
  border-bottom: 1px solid var(--line-2);
}
.meta dl div:last-child {
  border: 0;
}
.meta dd {
  font-size: 13.5px;
}
.deadline {
  color: var(--orange-2);
  font-weight: 700;
}

/* Timeline */
.history {
  margin-top: 18px;
}
.timeline {
  padding: 22px 24px 8px;
}
.timeline article {
  position: relative;
  display: flex;
  gap: 16px;
  padding-bottom: 22px;
}
.timeline article:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 16px;
  bottom: 0;
  width: 2px;
  background: var(--line);
}
.timeline .dot {
  position: relative;
  z-index: 1;
  flex: none;
  width: 12px;
  height: 12px;
  margin-top: 3px;
  border-radius: 50%;
  background: var(--grey);
  box-shadow: 0 0 0 4px var(--grey-bg);
}
.tl-submit .dot {
  background: var(--orange);
  box-shadow: 0 0 0 4px var(--orange-soft);
}
.tl-approve .dot {
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-bg);
}
.tl-revise .dot {
  background: var(--violet);
  box-shadow: 0 0 0 4px var(--violet-bg);
}
.tl-reject .dot,
.tl-cancel .dot {
  background: var(--red);
  box-shadow: 0 0 0 4px var(--red-bg);
}
.tl-comment .dot {
  background: var(--blue);
  box-shadow: 0 0 0 4px var(--blue-bg);
}
.timeline-body {
  flex: 1;
  min-width: 0;
}
.timeline-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.timeline-head strong {
  font-size: 13px;
  font-weight: 700;
}
.tl-pos {
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
}
.timeline time {
  margin-left: auto;
  color: var(--faint);
  font-size: 11px;
  white-space: nowrap;
}
.timeline p {
  margin: 6px 0 0;
  color: var(--text-2);
  font-size: 13px;
}
.timeline blockquote {
  margin: 9px 0 0;
  padding: 11px 14px;
  border-left: 3px solid var(--line);
  border-radius: 0 8px 8px 0;
  background: var(--surface-2);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-2);
}
.comment-form {
  display: flex;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--line-2);
}
.comment-form input {
  flex: 1;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

/* Action card (sticky rail) */
.button.block {
  width: 100%;
}
.action-card > header {
  background: var(--orange-soft);
  border-bottom-color: #f3ddca;
}
.action-card > header h2 {
  color: var(--orange-2);
}
.action-body {
  padding: 18px 20px;
  display: grid;
  gap: 12px;
}
.action-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.action-body form {
  display: grid;
  gap: 10px;
}
.action-body textarea {
  min-height: 88px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
}
.action-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* ===== Approvals ===== */
.inbox-intro {
  align-items: center;
}
.inbox-count {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex: none;
}
.inbox-count strong {
  color: var(--orange);
  font-size: 30px;
  font-weight: 800;
}
.inbox-count span {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
}
.inbox-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}
.card-list {
  display: grid;
  gap: 14px;
}
.approval-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 22px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: 0.15s;
}
.approval-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #dbe0e8;
}
.approval-body {
  min-width: 0;
}
.approval-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}
.approval-card h2 {
  margin: 9px 0 8px;
  font-size: 16.5px;
  font-weight: 700;
}
.approval-card h2 a:hover {
  color: var(--orange);
}
.approval-card p {
  margin: 0;
  max-width: 880px;
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.6;
}
.approval-route {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 11.5px;
}
.approval-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex: none;
}
.panel-empty {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 56px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--faint);
}
.panel-empty p {
  margin: 0;
  font-size: 13px;
}

/* ===== Tasks / Kanban ===== */
.kanban {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  align-items: start;
}
.task-column {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  overflow: hidden;
}
.task-column > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.task-column h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}
.col-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--grey);
}
.col-waiting .col-dot {
  background: var(--grey);
}
.col-progress .col-dot {
  background: var(--blue);
}
.col-blocked .col-dot {
  background: var(--amber);
}
.col-done .col-dot {
  background: var(--green);
}
.col-count {
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  padding: 0 7px;
  border-radius: 11px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  border: 1px solid var(--line);
}
.task-column-body {
  display: grid;
  gap: 12px;
  padding: 12px;
}
.task-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.task-card h3 {
  margin: 7px 0 12px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
}
.task-card h3 a:hover {
  color: var(--orange);
}
.progress-bar {
  height: 6px;
  margin-bottom: 14px;
  border-radius: 6px;
  background: var(--line-2);
  overflow: hidden;
}
.progress-bar span {
  display: block;
  height: 100%;
  border-radius: 6px;
  background: var(--orange);
  transition: width 0.2s;
}
.task-card form {
  display: grid;
  gap: 10px;
}
.task-card label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.task-card label b {
  color: var(--text);
  float: right;
}
.task-card input,
.task-card select {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  font-size: 12.5px;
}
.task-card input[type="range"] {
  padding: 0;
  min-height: auto;
  accent-color: var(--orange);
}
.task-card time {
  display: block;
  margin-top: 12px;
  color: var(--faint);
  font-size: 10.5px;
}
.col-empty {
  padding: 22px;
  text-align: center;
  color: var(--faint);
  font-size: 12px;
}

/* ===== Notifications ===== */
.page-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}
.notification-list {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.notification-list form {
  border-bottom: 1px solid var(--line-2);
}
.notification-list form:last-child {
  border: 0;
}
.notification {
  width: 100%;
  display: flex;
  gap: 13px;
  padding: 18px 22px;
  border: 0;
  text-align: left;
  background: transparent;
  cursor: pointer;
  transition: 0.12s;
}
.notification:hover {
  background: var(--surface-2);
}
.notification.unread {
  background: var(--orange-soft);
}
.notification.unread:hover {
  background: #ffeee0;
}
.notification .dot {
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: #cdd2db;
}
.notification.unread .dot {
  background: var(--orange);
}
.notification-body {
  min-width: 0;
}
.notification strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
}
.notification em {
  display: block;
  margin: 5px 0;
  color: var(--muted);
  font-style: normal;
  font-size: 12.5px;
  line-height: 1.5;
}
.notification time {
  display: block;
  color: var(--faint);
  font-size: 10.5px;
}

/* ===== Members ===== */
.member-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.member-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.member-card > header {
  padding: 20px;
  border-bottom: 1px solid var(--line-2);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
}
.dept-code {
  display: inline-block;
  margin-bottom: 8px;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--navy);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
}
.member-card h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}
.member-card p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.member-list {
  padding: 6px 0;
}
.member-create {
  margin-bottom: 18px;
}
.member-create form {
  display: grid;
  grid-template-columns: 1fr 1fr 1.35fr 1fr auto;
  align-items: end;
  gap: 12px;
  padding: 18px 20px;
}
.member-create label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
}
.member-create input,
.member-create select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 13px;
}
.settings-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(360px, 1.2fr);
  gap: 18px;
  align-items: start;
  max-width: 900px;
  margin: 0 auto;
}
.account-card dl {
  margin: 0;
  padding: 8px 20px;
}
.account-card dl div {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-2);
}
.account-card dl div:last-child {
  border-bottom: 0;
}
.account-card dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.account-card dd {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}
.password-card form {
  display: grid;
  gap: 16px;
  padding: 20px;
}
.password-card label {
  display: grid;
  gap: 8px;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
}
.password-card input {
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.member {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line-2);
}
.member:last-child {
  border: 0;
}
.member-info {
  flex: 1;
  min-width: 0;
}
.member-info strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
}
.member-info small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}
.role-tag {
  flex: none;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--grey-bg);
  color: var(--grey);
  font-size: 10.5px;
  font-weight: 700;
  font-style: normal;
}
.role-tag.head {
  background: var(--orange-soft);
  color: var(--orange-2);
}
.role-tag.deputy {
  background: var(--blue-bg);
  color: var(--blue);
}
.member-role {
  display: grid;
  justify-items: end;
  gap: 6px;
}
.role-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  border-radius: 20px;
  background: var(--grey-bg);
  color: var(--grey);
}
.role-picker.head {
  background: var(--orange-soft);
  color: var(--orange-2);
}
.role-picker.deputy {
  background: var(--blue-bg);
  color: var(--blue);
}
.role-picker select {
  min-height: 25px;
  padding: 4px 25px 4px 10px;
  border: 0;
  border-radius: inherit;
  outline: 0;
  appearance: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-size: 10.5px;
  font-weight: 700;
}
.role-picker svg {
  position: absolute;
  right: 8px;
  width: 11px;
  height: 11px;
  pointer-events: none;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}
.role-picker:focus-within {
  box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 20%, transparent);
}
.role-transfer-modal {
  width: min(440px, calc(100vw - 32px));
  padding: 28px;
  border: 0;
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 70px rgba(20, 28, 46, 0.22);
}
.role-transfer-modal::backdrop {
  background: rgba(20, 28, 46, 0.55);
  backdrop-filter: blur(3px);
}
.role-transfer-icon {
  display: grid;
  width: 46px;
  height: 46px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: 13px;
  background: var(--orange-soft);
  color: var(--orange-2);
}
.role-transfer-icon svg {
  width: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}
.role-transfer-copy > span {
  color: var(--orange-2);
  font-size: 11px;
  font-weight: 800;
}
.role-transfer-copy h2 {
  margin: 4px 0 9px;
  font-size: 20px;
}
.role-transfer-copy p {
  margin: 0;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.65;
}
.role-transfer-copy p strong {
  color: var(--text);
}
.role-transfer-warning {
  margin-top: 20px;
  padding: 12px 14px;
  border: 1px solid #f7dac8;
  border-radius: var(--radius-sm);
  background: var(--orange-soft);
  color: #8d481f;
  font-size: 11.5px;
  line-height: 1.55;
}
.role-transfer-actions {
  display: grid;
  grid-template-columns: 1fr 1.45fr;
  gap: 9px;
  margin-top: 22px;
}
.role-transfer-actions .button {
  justify-content: center;
  width: 100%;
}
.role-promote {
  padding: 0;
  border: 0;
  color: var(--orange-2);
  background: transparent;
  cursor: pointer;
  font-size: 10.5px;
  font-weight: 700;
}
.role-promote:hover {
  text-decoration: underline;
}

/* ===== Login ===== */
.login-page {
  min-height: 100vh;
  background: var(--bg);
}
.login-page main {
  min-height: 100vh;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.login-brand {
  display: grid;
  place-content: center;
  padding: 60px;
  color: #fff;
  background: linear-gradient(150deg, #141c2e, #243354);
}
.login-brand-inner {
  max-width: 420px;
}
.login-logo {
  display: block;
  width: 84px;
  height: 84px;
  object-fit: contain;
  border-radius: 14px;
}
.login-brand h1 {
  margin: 22px 0 10px;
  font-size: 38px;
  font-weight: 800;
}
.login-brand p {
  color: #aab4c6;
  line-height: 1.75;
  font-size: 14px;
}
.login-flow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 38px;
}
.login-flow b {
  padding: 8px 12px;
  border: 1px solid #3a475f;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #dfe4ec;
}
.login-flow i {
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--orange);
}
.login-card {
  align-self: center;
  width: 100%;
  max-width: 420px;
  margin: 40px auto;
  padding: 38px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.login-card h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
}
.login-card > p {
  margin: 8px 0 26px;
  color: var(--muted);
  font-size: 13px;
}
.login-card form {
  display: grid;
  gap: 18px;
}
.login-card label {
  display: grid;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}
.login-card input,
.login-card select {
  height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 14px;
}
.login-card .button {
  height: 48px;
  font-size: 14px;
  margin-top: 4px;
}
.login-card > small {
  display: block;
  margin-top: 18px;
  color: var(--faint);
  text-align: center;
  font-size: 12px;
}
.login-footer {
  position: fixed;
  right: 24px;
  bottom: 18px;
  color: var(--faint);
  font-size: 11.5px;
}

/* ===== Error ===== */
.error-page {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  text-align: center;
  padding: 24px;
}
.error-page > strong {
  color: var(--orange);
  font-size: 72px;
  font-weight: 800;
  line-height: 1;
}
.error-page h1 {
  margin: 8px 0 20px;
  font-size: 19px;
  font-weight: 600;
  color: var(--text-2);
}

/* ===== Overlay (mobile) ===== */
.overlay {
  display: none;
}

/* ===== Responsive ===== */
@media (max-width: 1080px) {
  .summary {
    grid-template-columns: 1fr 1fr;
  }
  .dashboard-grid,
  .detail-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .kanban,
  .member-grid {
    grid-template-columns: 1fr 1fr;
  }
  .owner-box,
  .decision-box {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .member-create form {
    grid-template-columns: 1fr 1fr;
  }
  .member-create form .button {
    grid-column: 1 / -1;
  }
}
@media (max-width: 760px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.22s ease;
  }
  .sidebar.open {
    transform: none;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.35);
  }
  .main-area {
    margin-left: 0;
  }
  .menu {
    display: block;
  }
  .overlay.open {
    position: fixed;
    inset: 0;
    display: block;
    background: rgba(10, 15, 25, 0.5);
    z-index: 25;
  }
  .topbar {
    padding: 0 16px;
  }
  .topbar p {
    display: none;
  }
  .topbar > .button {
    padding: 0 12px;
  }
  .content {
    padding: 18px 16px 48px;
  }
  .summary,
  .kanban,
  .member-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-grid .full {
    grid-column: auto;
  }
  .member-create form {
    grid-template-columns: 1fr;
  }
  .member-create form .button {
    grid-column: auto;
  }
  .hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 22px;
  }
  .flow-mini {
    flex-wrap: wrap;
  }
  .workflow {
    grid-template-columns: 1fr 1fr;
  }
  .workflow .step:nth-child(2) {
    border-right: 0;
  }
  .workflow .step {
    border-bottom: 1px solid var(--line-2);
  }
  .filters {
    flex-direction: column;
    align-items: stretch;
  }
  .search-field {
    min-width: 0;
  }
  .approval-card {
    grid-template-columns: 1fr;
  }
  .approval-side {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .request-row {
    grid-template-columns: 1fr auto;
  }
  .request-row time {
    display: none;
  }
  .comment-form {
    flex-direction: column;
  }
  .login-page main {
    grid-template-columns: 1fr;
  }
  .login-brand {
    display: none;
  }
  .login-card {
    margin: 8vh auto;
    max-width: 440px;
  }
  .login-footer {
    right: 0;
    bottom: 16px;
    width: 100%;
    text-align: center;
  }
}
