:root {
  --orange: #F47C16;
  --orange-soft: #FFF1E4;
  --ink: #201C18;
  --muted: #6F675F;
  --bg: #FBF4EA;
  --card: #FFFDF8;
  --line: #E5D5C2;
  --line-soft: #F0E4D6;
  --danger: #A33A4C;
  --success-bg: #DDEED8;
  --warning-bg: #FCE4D6;
  --shadow: 0 18px 50px rgba(67, 44, 16, .07);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(244,124,22,.10), transparent 28%),
    linear-gradient(120deg, #FBF0E2 0%, #FFFDF8 50%, #F8EFE5 100%);
  letter-spacing: 0;
}

button, input, select, textarea { font: inherit; }

.page { width: min(1480px, 100%); margin: 0 auto; padding: 32px 40px 28px; }

.topbar { display: grid; grid-template-columns: 250px 1fr auto; gap: 28px; align-items: start; margin-bottom: 24px; }
.login-topbar { grid-template-columns: 1fr auto; }

.brand-logo { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.brand-logo img { width: 178px; height: auto; display: block; object-fit: contain; }
.admin-label { margin-left: 2px; color: var(--orange); font-size: 11px; letter-spacing: .12em; font-weight: 800; }

.eyebrow { color: var(--orange); font-size: 12px; font-weight: 800; letter-spacing: .10em; text-transform: uppercase; margin-bottom: 8px; }
.title-block h1 { margin: 0 0 8px; font-size: 38px; line-height: 1.06; letter-spacing: -0.010em; }
.title-block p { margin: 0; color: var(--muted); font-size: 16px; }

.top-actions { display: flex; gap: 10px; align-items: center; }
.phone-pill, .ghost-btn { border: 1px solid var(--line); background: rgba(255,253,248,.86); color: var(--ink); border-radius: 999px; padding: 10px 15px; text-decoration: none; cursor: pointer; font-weight: 650; }

.login-page { min-height: 100vh; }
.login-grid { display: grid; grid-template-columns: 420px 1fr; gap: 28px; align-items: start; margin-top: 28px; }
.intro-panel, .login-card, .dashboard-panel, .filters, .request-list, .detail-panel { background: rgba(255,253,248,.92); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow); }
.intro-panel { padding: 30px; }
.intro-panel h1 { font-size: 40px; line-height: 1.08; letter-spacing: -0.010em; margin: 0 0 18px; }
.intro-panel p { color: var(--muted); margin-bottom: 24px; }
.system-rows { display: grid; gap: 12px; }
.system-rows div { background: white; border: 1px solid var(--line-soft); border-radius: 16px; padding: 14px; }
.system-rows span, .system-rows strong { display: block; }
.system-rows span { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.login-card { padding: 36px; }
.login-card h2 { font-size: 36px; letter-spacing: -0.010em; margin: 0 0 8px; }
.muted { color: var(--muted); }
.pass-input { width: 100%; border: 1px solid var(--line); border-radius: 20px; padding: 16px; background: white; outline: none; font-size: 30px; letter-spacing: .22em; text-align: center; margin: 22px 0 16px; }
.primary-btn, .save-btn { border: 0; border-radius: 999px; background: var(--orange); color: white; padding: 13px 18px; font-weight: 800; cursor: pointer; }
.primary-btn { width: 100%; padding: 15px 20px; }

.error, .success { padding: 12px 14px; border-radius: 14px; margin: 12px 0; }
.error { background: #fff1f1; color: #9b1c1c; border: 1px solid #ffd0d0; }
.success { background: var(--success-bg); color: #245C2B; border: 1px solid #b9dcb1; }
.banner { margin-bottom: 18px; }
.inline-message { margin: 16px 18px 0; }

.dashboard-panel { padding: 22px; margin-bottom: 18px; }
.panel-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 16px; }
.panel-head h2 { font-size: 25px; letter-spacing: -0.005em; margin: 0; }
.data-time { color: var(--muted); font-size: 13px; }
.dashboard-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.metric-card { background: white; border: 1px solid var(--line-soft); border-radius: 20px; padding: 16px; }
.metric-label { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.metric-value { font-size: 34px; font-weight: 850; letter-spacing: -0.010em; line-height: 1.05; }
.metric-note { color: var(--muted); font-size: 12px; margin-top: 4px; }

.filters { display: grid; grid-template-columns: 2fr repeat(4, 1fr); gap: 12px; padding: 16px; margin-bottom: 18px; }
.filter-field span, .search-field span, .field-label, .edit-field span { display: block; color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 750; margin-bottom: 8px; }
.search-field input, .filter-field select, .edit-field input, .edit-field select, .edit-field textarea { width: 100%; border: 1px solid var(--line); border-radius: 15px; padding: 12px 13px; background: white; outline: none; }
.edit-field textarea { min-height: 112px; resize: vertical; }

.main-grid { display: grid; grid-template-columns: 410px 1fr; gap: 20px; align-items: start; }
.section-head { padding: 20px 20px 13px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: flex-start; }
.section-head h2 { margin: 0; font-size: 21px; letter-spacing: -0.005em; }
.list-scroll { max-height: 850px; overflow: auto; padding: 12px; }
.request-card { width: 100%; text-align: left; border: 1px solid transparent; background: transparent; border-radius: 18px; padding: 14px; cursor: pointer; display: block; margin-bottom: 8px; }
.request-card:hover, .request-card.selected { background: #FFF8EF; border-color: var(--orange); }
.request-title { display: flex; justify-content: space-between; gap: 10px; align-items: start; margin-bottom: 6px; }
.request-title strong { font-size: 16px; font-weight: 780; }
.company { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.service-line { font-size: 14px; font-weight: 680; margin-bottom: 8px; }
.decision-line { color: var(--muted); font-size: 13px; line-height: 1.4; margin-bottom: 10px; }
.card-footer { display: flex; justify-content: space-between; align-items: center; }

.tag { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 9px; font-size: 12px; font-weight: 680; background: #F4F0EA; color: #554E46; white-space: nowrap; }
.tag-warn { background: var(--warning-bg); color: #8A4A12; }
.tag-success { background: var(--success-bg); color: #245C2B; }
.tag-danger { background: #F4D7DF; color: var(--danger); }
.tag-neutral { background: #F4F0EA; color: #554E46; }

.detail-panel { overflow: hidden; }
.detail-head { display: flex; justify-content: space-between; gap: 18px; padding: 26px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #FFF8EF, #FFFDF8); }
.detail-head h2 { font-size: 31px; line-height: 1.12; letter-spacing: -0.005em; margin: 0 0 8px; }
.detail-head p { color: var(--muted); margin: 0; }
.tag-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.decision-card { margin: 18px; padding: 20px; border-radius: 22px; background: var(--orange-soft); border: 1px solid #F4C795; }
.decision-card h3 { font-size: 24px; line-height: 1.22; letter-spacing: -0.005em; margin: 0 0 8px; }
.decision-card p { margin: 0 0 16px; color: #4E4337; }
.decision-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.writeback-panel { margin: 18px; padding: 20px; border: 1px solid var(--line); border-radius: 22px; background: #FFFDF8; }
.writeback-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.writeback-head h3 { margin: 0; font-size: 22px; }
.edit-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.edit-field.wide { grid-column: span 2; }

.detail-section { border-top: 1px solid var(--line); }
.detail-section-head { padding: 22px 24px 10px; }
.detail-section-head h3 { font-size: 21px; letter-spacing: 0; margin: 0 0 6px; }
.detail-section-head p { color: var(--muted); margin: 0; font-size: 14px; }
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 0 18px 20px; }
.info-block { background: white; border: 1px solid var(--line-soft); border-radius: 16px; padding: 15px; min-height: 88px; }
.info-block.wide { grid-column: span 3; }
.field-value { white-space: pre-wrap; line-height: 1.5; }
.footer { color: var(--muted); font-size: 12px; padding: 16px 4px 0; }
.empty { padding: 24px; color: var(--muted); }

@media (max-width: 1180px) {
  .topbar { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: repeat(3, 1fr); }
  .filters { grid-template-columns: 1fr 1fr; }
  .main-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .info-block.wide { grid-column: span 1; }
  .decision-meta { grid-template-columns: 1fr; }
  .login-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .page { padding: 18px; }
  .title-block h1 { font-size: 31px; }
  .top-actions { flex-wrap: wrap; }
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .filters { grid-template-columns: 1fr; }
  .detail-head { flex-direction: column; }
  .tag-row { justify-content: flex-start; }
  .brand-logo img { width: 150px; }
  .edit-grid { grid-template-columns: 1fr; }
  .edit-field.wide { grid-column: span 1; }
}
