/* ===== Y-FLOW · Global Styles ===== */
: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;
  overflow-x: hidden;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
h1,
h2,
h3 {
  letter-spacing: -0.01em;
}

/* ===== Buttons ===== */
.hero-text {
  position: relative;
  z-index: 1;
}

.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: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: 10px;
  color: #dfe4ec;
  background: #39435c;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.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);
}
.status-current_department_review {
  color: var(--amber);
  background: var(--amber-bg);
}
.status-target_department_review {
  color: var(--blue);
  background: var(--blue-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;
}

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