:root { color-scheme: dark; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: #0a0f0d; color: #eef6f1; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at top left, rgba(0, 110, 255, .22), transparent 34rem), radial-gradient(circle at top right, rgba(25, 155, 91, .24), transparent 30rem), #080d0b; }
button, input { font: inherit; }
.login-card { width: min(460px, calc(100% - 32px)); margin: 8vh auto; padding: 34px; border: 1px solid rgba(255,255,255,.1); border-radius: 28px; background: rgba(9, 18, 15, .84); box-shadow: 0 24px 90px rgba(0,0,0,.42); }
.eyebrow { color: #36d399; text-transform: uppercase; letter-spacing: .18em; font-size: 12px; font-weight: 800; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(30px, 5vw, 56px); letter-spacing: -.05em; }
h2 { font-size: 18px; }
.login-form { display: grid; gap: 14px; }
label { display: grid; gap: 8px; color: #b7c5be; }
input { width: 100%; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); color: white; border-radius: 14px; padding: 13px 14px; }
button { border: 0; border-radius: 16px; padding: 14px 18px; background: linear-gradient(135deg, #1bb978, #0b7cff); color: white; font-weight: 800; cursor: pointer; }
.error { color: #ff8b8b; min-height: 20px; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.app-sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 20px; border-right: 1px solid rgba(255,255,255,.1); background: rgba(5, 12, 10, .72); display: flex; flex-direction: column; gap: 28px; }
.app-nav { display: grid; gap: 10px; }
.app-nav button { text-align: left; background: rgba(255,255,255,.06); color: #d8e9e1; }
.app-nav button[aria-current="page"] { background: linear-gradient(135deg, rgba(27,185,120,.95), rgba(11,124,255,.9)); color: white; }
.app-content { min-width: 0; }
.app-header { width: min(1440px, calc(100% - 36px)); margin: 0 auto; padding: 24px 0 0; display: flex; justify-content: flex-end; }
.dashboard { width: min(1440px, calc(100% - 36px)); margin: 0 auto; padding: 24px 0 56px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.user { padding: 10px 14px; border-radius: 999px; background: rgba(255,255,255,.08); color: #d7e6df; }
.metrics, .history-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 12px; margin: 18px 0; }
.metric { padding: 18px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.055); border-radius: 20px; }
.metric strong { display: block; font-size: 32px; }
.metric span, small { color: #a8bab0; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
.grid.two { grid-template-columns: 1.1fr .9fr; }
.panel { border: 1px solid rgba(255,255,255,.1); border-radius: 24px; padding: 20px; background: rgba(8, 16, 13, .76); min-width: 0; }
.panel.danger { border-color: rgba(255, 118, 118, .34); }
ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.row { display: flex; justify-content: space-between; gap: 18px; padding: 14px; border-radius: 16px; background: rgba(255,255,255,.055); }
.row.actionable { align-items: flex-start; }
.row div { display: grid; gap: 4px; }
.row strong { color: #fff; }
.row span { color: #c6d7cf; }
.inline-action, .action-stack { display: grid; gap: 8px; min-width: min(100%, 360px); }
.workflow-form { display: grid; gap: 10px; margin-top: 12px; }
.workflow-form input, .workflow-form textarea { padding: 10px 12px; border-radius: 12px; font-size: 13px; }
.workflow-form textarea { min-height: 72px; resize: vertical; }
.workflow-panel details { border-top: 1px solid rgba(255,255,255,.08); padding: 12px 0; }
.workflow-panel summary { cursor: pointer; font-weight: 800; color: #dff8eb; }
.signature-box { display: grid; gap: 8px; padding: 12px; border: 1px solid rgba(255,255,255,.12); border-radius: 16px; background: rgba(255,255,255,.035); }
.signature-box canvas { width: 100%; height: 160px; border: 1px dashed rgba(255,255,255,.28); border-radius: 14px; background: rgba(0,0,0,.22); touch-action: none; }
.signature-box button { background: rgba(255,255,255,.1); color: #e8f5ef; }
.document-preview-panel { grid-column: 1 / -1; }
.document-preview { min-height: 260px; border: 1px dashed rgba(255,255,255,.16); border-radius: 18px; display: grid; place-items: center; overflow: hidden; background: rgba(255,255,255,.035); }
.document-preview-image { max-width: 100%; max-height: 540px; object-fit: contain; }
.document-preview-frame { width: 100%; height: 620px; border: 0; background: #fff; }
.contract-detail-header { align-items: flex-start; }
.contract-header-actions { display: grid; justify-items: end; gap: 10px; min-width: min(100%, 520px); }
.contract-quick-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.contract-quick-actions button { padding: 10px 12px; border-radius: 999px; font-size: 13px; background: rgba(255,255,255,.08); color: #e7f5ef; border: 1px solid rgba(255,255,255,.1); }
.contract-quick-actions button:hover { background: rgba(54, 211, 153, .18); }
.contract-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 10px; padding: 8px; border: 1px solid rgba(255,255,255,.1); border-radius: 22px; background: rgba(255,255,255,.04); }
.contract-tabs button { flex: 1 1 140px; background: rgba(255,255,255,.07); color: #d8e9e1; }
.contract-tabs button[aria-selected="true"] { background: linear-gradient(135deg, rgba(27,185,120,.95), rgba(11,124,255,.9)); color: #fff; }
.contract-tab-panel[hidden] { display: none; }
.inline-action { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.inline-action input { padding: 9px 10px; border-radius: 11px; font-size: 13px; }
.inline-action button, .action-stack > button { padding: 10px 12px; border-radius: 12px; font-size: 13px; }
.action-stack > button { width: 100%; }
.feedback { min-height: 22px; padding: 10px 12px; border-radius: 14px; color: #a8bab0; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); }
.feedback[data-feedback-state="idle"] { background: transparent; border-color: transparent; padding-left: 0; }
.feedback[data-feedback-state="success"] { color: #c9fbe2; background: rgba(27,185,120,.16); border-color: rgba(54,211,153,.34); }
.feedback[data-feedback-state="error"] { color: #ffd1d1; background: rgba(255,118,118,.14); border-color: rgba(255,118,118,.34); }
.empty { color: #8da098; padding: 14px; }
@media (max-width: 900px) { .contract-header-actions { justify-items: stretch; } .contract-quick-actions { justify-content: flex-start; } .app-shell { grid-template-columns: 1fr; } .app-sidebar { position: static; height: auto; } .app-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid, .grid.two { grid-template-columns: 1fr; } .topbar, .row { align-items: flex-start; flex-direction: column; } .inline-action { grid-template-columns: 1fr; } }
.field-workflow { gap: 12px; }
.field-step { display: grid; gap: 7px; padding: 10px; border: 1px solid rgba(255,255,255,.08); border-radius: 14px; background: rgba(255,255,255,.03); }
.field-step span { color: #c9ddd3; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.checkbox-step { grid-template-columns: auto 1fr; align-items: center; }
.checkbox-step input { width: auto; }
.field-primary-button { min-height: 48px; }
@media (max-width: 640px) {
  body { background: #080d0b; }
  button, input, textarea, select { min-height: 48px; font-size: 16px; }
  .dashboard { width: min(100% - 20px, 100%); padding-bottom: 96px; }
  .topbar { gap: 12px; }
  .topbar h1 { font-size: 30px; }
  .metrics, .history-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric { padding: 14px; }
  .metric strong { font-size: 26px; }
  .contract-quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .contract-quick-actions button, .contract-tabs button { min-height: 48px; }
  .contract-tabs { position: sticky; top: 0; z-index: 5; backdrop-filter: blur(16px); }
  .workflow-panel details { padding: 14px 0; }
  .workflow-panel summary { min-height: 48px; display: flex; align-items: center; }
  .field-step { padding: 12px; }
  .field-workflow input, .field-workflow textarea { font-size: 16px; min-height: 48px; }
  .field-primary-button { min-height: 54px; width: 100%; position: sticky; bottom: 12px; z-index: 4; box-shadow: 0 14px 40px rgba(0,0,0,.42); }
  .signature-box canvas { height: 220px; }
  .row { padding: 12px; }
  .app-header { width: min(100% - 20px, 100%); }
}
