/* ============================================================
   АСУП — Корпоративный интерфейс
   Цветовая схема: тёмно-синий / голубой / белый / чёрный
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --navy:        #0d2240;
  --navy-dark:   #081628;
  --navy-mid:    #153354;
  --blue:        #1565c0;
  --blue-mid:    #1976d2;
  --blue-light:  #1e88e5;
  --sky:         #42a5f5;
  --sky-pale:    #bbdefb;
  --ice:         #e3f2fd;
  --white:       #ffffff;
  --gray-50:     #f8f9fa;
  --gray-100:    #f1f3f5;
  --gray-200:    #e9ecef;
  --gray-300:    #dee2e6;
  --gray-500:    #6c757d;
  --gray-700:    #495057;
  --black:       #0a0e14;
  --font-main:   'IBM Plex Sans', 'Segoe UI', sans-serif;
  --font-mono:   'IBM Plex Mono', 'Courier New', monospace;
  --sidebar-w:   240px;
  --header-h:    56px;
  --radius:      6px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.12);
  --shadow-md:   0 4px 12px rgba(0,0,0,.12);
  --shadow-lg:   0 8px 24px rgba(0,0,0,.16);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--font-main);
  font-size: 14px;
  color: var(--black);
  background: var(--gray-100);
  line-height: 1.5;
  margin: 0;
}
a { color: var(--blue-light); text-decoration: none; }
a:hover { color: var(--sky); text-decoration: underline; }

/* ── LOGIN ──────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, var(--navy-dark) 0%, var(--navy-mid) 55%, var(--blue) 100%);
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent 0, transparent 39px, rgba(255,255,255,.04) 39px, rgba(255,255,255,.04) 40px),
    repeating-linear-gradient(90deg, transparent 0, transparent 39px, rgba(255,255,255,.04) 39px, rgba(255,255,255,.04) 40px);
  pointer-events: none;
}
.login-card {
  background: var(--white);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  width: 420px;
  max-width: 95vw;
  position: relative;
  z-index: 1;
  animation: slideUp .4s ease;
}
.login-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}
.login-brand .brand-icon {
  width: 42px; height: 42px;
  background: var(--navy);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--sky-pale);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: .95rem;
}
.login-brand .brand-name { font-size: 1.1rem; font-weight: 700; color: var(--navy); line-height: 1.2; }
.login-brand .brand-sub  { font-size: .72rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: .08em; }
.login-title { font-size: 1.2rem; font-weight: 600; color: var(--navy); margin-bottom: .25rem; }
.login-hint  { font-size: .85rem; color: var(--gray-500); margin-bottom: 1.75rem; }
.form-label  { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--gray-700); margin-bottom: .35rem; display: block; }
.form-control {
  width: 100%;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  padding: .6rem .8rem;
  font-family: var(--font-main);
  font-size: .9rem;
  transition: border-color .2s, box-shadow .2s;
  display: block;
}
.form-control:focus { border-color: var(--blue-light); box-shadow: 0 0 0 3px rgba(30,136,229,.15); outline: none; }
.btn-login {
  width: 100%;
  padding: .72rem;
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-main);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, transform .1s;
  margin-top: .75rem;
}
.btn-login:hover { background: var(--navy-mid); }
.btn-login:active { transform: scale(.99); }
.login-footer { text-align: center; font-size: .78rem; color: var(--gray-500); margin-top: 1.5rem; }
.error-msg { background: #ffebee; color: #b71c1c; border-radius: var(--radius); padding: .6rem .9rem; font-size: .85rem; margin-bottom: 1rem; border-left: 3px solid #c62828; }

/* ── LAYOUT ─────────────────────────────────────────────── */
.app-wrapper { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  z-index: 100;
}
.sidebar-brand {
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  gap: .65rem;
  text-decoration: none;
}
.sidebar-brand:hover { text-decoration: none; }
.s-icon {
  width: 30px; height: 30px;
  background: var(--blue);
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: .8rem;
  color: var(--white);
  flex-shrink: 0;
}
.s-name { font-size: .88rem; font-weight: 700; color: var(--white); letter-spacing: .02em; line-height: 1.2; }
.s-sub  { font-size: .62rem; color: rgba(255,255,255,.35); text-transform: uppercase; letter-spacing: .07em; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: .6rem 0; }
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }

.nav-section {
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.28);
  padding: .8rem 1.1rem .3rem;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .48rem 1.1rem;
  color: rgba(255,255,255,.65);
  font-size: .86rem;
  font-weight: 400;
  border-left: 3px solid transparent;
  transition: all .15s;
  text-decoration: none;
  cursor: pointer;
}
.nav-item:hover { color: var(--white); background: rgba(255,255,255,.06); text-decoration: none; }
.nav-item.active { color: var(--white); background: rgba(66,165,245,.15); border-left-color: var(--sky); font-weight: 500; }
.nav-icon { width: 18px; text-align: center; font-size: .95rem; opacity: .8; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: var(--blue-light);
  color: var(--white);
  font-size: .62rem;
  font-weight: 700;
  padding: .1rem .4rem;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}
.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: .75rem 1rem;
}
.sidebar-user { display: flex; align-items: center; gap: .6rem; }
.sidebar-avatar {
  width: 32px; height: 32px;
  background: var(--blue);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--white);
  font-size: .8rem;
  font-weight: 700;
  flex-shrink: 0;
}
.u-name { font-size: .8rem; color: var(--white); font-weight: 500; line-height: 1.2; }
.u-role { font-size: .68rem; color: rgba(255,255,255,.38); }
.logout-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: rgba(255,255,255,.38);
  font-size: 1rem;
  cursor: pointer;
  padding: .2rem;
  transition: color .15s;
}
.logout-btn:hover { color: rgba(255,255,255,.8); }

.main-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.topbar {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.topbar-title { font-size: 1rem; font-weight: 600; color: var(--navy); flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: .65rem; }

.notif-btn {
  position: relative;
  width: 34px; height: 34px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-700);
  cursor: pointer;
  transition: all .15s;
  font-size: .95rem;
}
.notif-btn:hover { border-color: var(--blue-light); color: var(--blue-light); }
.notif-dot {
  position: absolute; top: 5px; right: 5px;
  width: 7px; height: 7px;
  background: #c62828;
  border-radius: 50%;
  border: 1.5px solid var(--white);
}
.content-area { flex: 1; overflow-y: auto; padding: 1.5rem; }
.content-area::-webkit-scrollbar { width: 5px; }
.content-area::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }

/* ── STATS ──────────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, transform .2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.stat-icon.blue  { background: var(--ice); color: var(--blue); }
.stat-icon.green { background: #e8f5e9; color: #388e3c; }
.stat-icon.amber { background: #fff8e1; color: #f57c00; }
.stat-icon.red   { background: #ffebee; color: #c62828; }
.stat-icon.teal  { background: #e0f7fa; color: #00838f; }
.stat-icon.purple{ background: #f3e5f5; color: #7b1fa2; }
.stat-label { font-size: .72rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: .07em; font-weight: 500; }
.stat-value { font-size: 1.7rem; font-weight: 700; color: var(--navy); line-height: 1.1; font-family: var(--font-mono); }
.stat-sub   { font-size: .72rem; color: var(--gray-500); }

/* ── CARDS ──────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
}
.card-header {
  padding: .9rem 1.2rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: .75rem;
  background: var(--gray-50);
  border-radius: var(--radius) var(--radius) 0 0;
}
.card-header-title { font-size: .875rem; font-weight: 600; color: var(--navy); flex: 1; }
.card-header-icon {
  width: 28px; height: 28px;
  background: var(--ice);
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  color: var(--blue);
  font-size: .85rem;
}
.card-body { padding: 1.2rem; }
.card-footer { padding: .7rem 1.2rem; border-top: 1px solid var(--gray-200); background: var(--gray-50); font-size: .8rem; color: var(--gray-500); border-radius: 0 0 var(--radius) var(--radius); }

/* ── BADGES ─────────────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .18rem .6rem;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
  white-space: nowrap;
}
.status-badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.s-DRAFT        { background: #eceff1; color: #546e7a; }
.s-CONFIRMED    { background: #e3f2fd; color: #1565c0; }
.s-IN_PROGRESS  { background: #fff3e0; color: #e65100; }
.s-ON_HOLD      { background: #f3e5f5; color: #6a1b9a; }
.s-COMPLETED    { background: #e8f5e9; color: #2e7d32; }
.s-CANCELLED    { background: #ffebee; color: #b71c1c; }
.s-SHIPPED      { background: #e0f7fa; color: #006064; }
.s-PENDING      { background: #f5f5f5; color: #616161; }
.s-ASSIGNED     { background: #e3f2fd; color: #1565c0; }
.s-DONE         { background: #e8f5e9; color: #2e7d32; }
.s-REJECTED     { background: #ffebee; color: #b71c1c; }

.priority-badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .7rem;
  font-weight: 700;
  padding: .12rem .45rem;
  border-radius: 4px;
}
.p-0 { background: #e3f2fd; color: #1565c0; }
.p-1 { background: #fff8e1; color: #e65100; }
.p-2 { background: #ffebee; color: #b71c1c; }

/* ── TABLE ──────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead tr { background: var(--gray-50); }
.data-table th {
  padding: .55rem 1rem;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--gray-500);
  border-bottom: 2px solid var(--gray-200);
  white-space: nowrap;
  text-align: left;
}
.data-table td { padding: .65rem 1rem; border-bottom: 1px solid var(--gray-200); font-size: .875rem; vertical-align: middle; }
.data-table tbody tr { transition: background .1s; }
.data-table tbody tr:hover { background: var(--ice); }
.data-table tbody tr:last-child td { border-bottom: none; }
.tbl-num { font-family: var(--font-mono); font-size: .8rem; color: var(--blue); font-weight: 500; }

/* ── BUTTONS ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .9rem;
  border-radius: var(--radius);
  font-family: var(--font-main);
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  border: none;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-sm { padding: .28rem .6rem; font-size: .78rem; }

.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-mid); color: var(--white); }

.btn-blue { background: var(--blue); color: var(--white); }
.btn-blue:hover { background: var(--blue-mid); color: var(--white); }

.btn-outline {
  background: var(--white);
  color: var(--navy);
  border: 1.5px solid var(--gray-300);
}
.btn-outline:hover { border-color: var(--blue-light); color: var(--blue-light); }

.btn-success { background: #388e3c; color: var(--white); }
.btn-success:hover { background: #2e7d32; color: var(--white); }
.btn-warning { background: #f57c00; color: var(--white); }
.btn-warning:hover { background: #e65100; color: var(--white); }
.btn-danger  { background: #c62828; color: var(--white); }
.btn-danger:hover  { background: #b71c1c; color: var(--white); }

/* ── FORMS ──────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-label-styled {
  font-size: .8rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: .35rem;
  display: block;
}
.form-label-styled .req { color: #c62828; margin-left: .1rem; }
.form-select, .form-textarea, .form-input {
  width: 100%;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  padding: .5rem .75rem;
  font-family: var(--font-main);
  font-size: .875rem;
  background: var(--white);
  transition: border-color .2s, box-shadow .2s;
}
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236c757d'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  padding-right: 2rem;
}
.form-textarea { resize: vertical; min-height: 85px; }
.form-select:focus, .form-textarea:focus, .form-input:focus {
  border-color: var(--blue-light);
  box-shadow: 0 0 0 3px rgba(30,136,229,.12);
  outline: none;
}
.form-section-title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--gray-500);
  margin-bottom: .75rem;
  padding-bottom: .4rem;
  border-bottom: 2px solid var(--gray-200);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }

/* ── BREADCRUMB ─────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .8rem;
  color: var(--gray-500);
  margin-bottom: 1.25rem;
}
.breadcrumb a { color: var(--gray-500); }
.breadcrumb a:hover { color: var(--blue-light); }
.breadcrumb .sep { color: var(--gray-300); }
.breadcrumb .cur { color: var(--navy); font-weight: 500; }

/* ── WORKFLOW ───────────────────────────────────────────── */
.wf-strip {
  display: flex;
  align-items: center;
  overflow-x: auto;
  padding: .75rem 0 .5rem;
  gap: 0;
}
.wf-strip::-webkit-scrollbar { height: 3px; }
.wf-strip::-webkit-scrollbar-thumb { background: var(--gray-300); }

.wf-step { display: flex; align-items: center; flex-shrink: 0; }
.wf-node { display: flex; flex-direction: column; align-items: center; gap: .3rem; min-width: 82px; text-align: center; }
.wf-dot {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem;
  font-weight: 700;
  border: 2px solid transparent;
  transition: all .2s;
}
.wf-dot.done    { background: #e8f5e9; border-color: #388e3c; color: #388e3c; }
.wf-dot.current { background: var(--blue); border-color: var(--navy); color: var(--white); box-shadow: 0 0 0 4px rgba(21,101,192,.2); }
.wf-dot.pending { background: var(--gray-100); border-color: var(--gray-300); color: var(--gray-500); }

.wf-lbl { font-size: .63rem; color: var(--gray-500); line-height: 1.2; max-width: 78px; }
.wf-lbl.active-lbl { color: var(--blue); font-weight: 600; }

.wf-line { width: 28px; height: 2px; background: var(--gray-200); flex-shrink: 0; }
.wf-line.done { background: #388e3c; }

/* ── PROGRESS ───────────────────────────────────────────── */
.progress-wrap { background: var(--gray-100); border-radius: 4px; height: 5px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--blue), var(--sky)); border-radius: 4px; transition: width .6s ease; }

/* ── TASK CARD ──────────────────────────────────────────── */
.task-row {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .8rem 1.2rem;
  border-bottom: 1px solid var(--gray-200);
  transition: background .1s;
}
.task-row:last-child { border-bottom: none; }
.task-row:hover { background: var(--ice); }
.task-row-body { flex: 1; }
.task-row-title { font-size: .875rem; font-weight: 500; color: var(--navy); margin-bottom: .2rem; }
.task-row-meta  { font-size: .75rem; color: var(--gray-500); display: flex; gap: .75rem; flex-wrap: wrap; }

.task-priority-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: .35rem;
}
.tp-0 { background: var(--blue-light); }
.tp-1 { background: #f57c00; }
.tp-2 { background: #c62828; }

/* ── ACTIVITY ───────────────────────────────────────────── */
.activity-item {
  display: flex;
  gap: .65rem;
  padding: .55rem 0;
  border-bottom: 1px solid var(--gray-100);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue-light); flex-shrink: 0; margin-top: .4rem; }
.activity-text { font-size: .83rem; color: var(--gray-700); line-height: 1.4; }
.activity-time { font-size: .73rem; color: var(--gray-500); margin-top: .1rem; }

/* ── FILTER BAR ─────────────────────────────────────────── */
.filter-bar {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: .65rem 1rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .65rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}
.filter-bar label { font-size: .78rem; font-weight: 600; color: var(--gray-700); white-space: nowrap; }
.filter-bar .form-select, .filter-bar .form-input { padding: .3rem .6rem; font-size: .82rem; width: auto; }

/* ── MODAL ──────────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn .2s;
}
.modal-box {
  background: var(--white);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  width: 540px;
  max-width: 95vw;
  max-height: 90vh;
  display: flex; flex-direction: column;
  animation: slideUp .25s ease;
}
.modal-hdr {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-ttl  { font-size: .95rem; font-weight: 600; color: var(--navy); }
.modal-cls  { background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--gray-500); line-height: 1; padding: 0 .2rem; }
.modal-cls:hover { color: var(--black); }
.modal-bdy  { padding: 1.2rem; overflow-y: auto; flex: 1; }
.modal-ftr  { padding: .75rem 1.2rem; border-top: 1px solid var(--gray-200); display: flex; justify-content: flex-end; gap: .5rem; }

/* ── ALERTS ─────────────────────────────────────────────── */
.alert {
  padding: .65rem .9rem;
  border-radius: var(--radius);
  font-size: .85rem;
  margin-bottom: .75rem;
  border-left: 3px solid;
  display: flex; align-items: flex-start; gap: .5rem;
}
.alert-info    { background: #e3f2fd; color: #0d47a1; border-color: #1565c0; }
.alert-success { background: #e8f5e9; color: #1b5e20; border-color: #388e3c; }
.alert-warning { background: #fff8e1; color: #e65100; border-color: #f57c00; }
.alert-danger  { background: #ffebee; color: #b71c1c; border-color: #c62828; }

/* ── EMPTY STATE ────────────────────────────────────────── */
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--gray-500); }
.empty-icon  { font-size: 2.5rem; margin-bottom: .5rem; opacity: .35; }
.empty-text  { font-size: .875rem; }

/* ── OVERDUE ────────────────────────────────────────────── */
.overdue-text { color: #c62828 !important; font-weight: 600; }
.overdue-row td { background: #fff9f9 !important; }

/* ── PAGE HEADER ────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: .75rem;
}
.page-header-left .page-title { font-size: 1.15rem; font-weight: 700; color: var(--navy); margin: 0; }
.page-header-left .page-sub   { font-size: .82rem; color: var(--gray-500); margin-top: .15rem; }
.page-header-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ── DETAIL VIEW ────────────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.25rem; }
.detail-field { margin-bottom: .75rem; }
.detail-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--gray-500); margin-bottom: .2rem; }
.detail-value { font-size: .9rem; color: var(--navy); }
.detail-value.mono { font-family: var(--font-mono); }
.detail-fields-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem 1.5rem; }

/* ── TABS ───────────────────────────────────────────────── */
.tab-nav {
  display: flex;
  border-bottom: 2px solid var(--gray-200);
  gap: 0;
  margin-bottom: 1.25rem;
}
.tab-btn {
  padding: .6rem 1.1rem;
  font-size: .85rem;
  font-weight: 500;
  color: var(--gray-500);
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all .15s;
}
.tab-btn:hover { color: var(--navy); }
.tab-btn.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── HISTORY LIST ───────────────────────────────────────── */
.history-item {
  display: flex;
  gap: 1rem;
  padding: .65rem 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: .84rem;
}
.history-item:last-child { border-bottom: none; }
.history-date { color: var(--gray-500); white-space: nowrap; flex-shrink: 0; font-size: .78rem; font-family: var(--font-mono); }
.history-user { color: var(--navy); font-weight: 500; flex-shrink: 0; }
.history-text { color: var(--gray-700); }

@keyframes slideUp { from { opacity:0; transform: translateY(14px); } to { opacity:1; transform: none; } }
@keyframes fadeIn  { from { opacity:0; } to { opacity:1; } }

@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
