:root {
  --ink: #17201d;
  --muted: #66736d;
  --line: #e3e9e6;
  --surface: #ffffff;
  --canvas: #f3f6f4;
  --green: #0f5b43;
  --green-2: #177657;
  --green-soft: #e7f3ee;
  --gold: #b8872c;
  --gold-soft: #fbf3df;
  --red: #b42318;
  --red-soft: #fceae8;
  --shadow: 0 22px 60px rgba(18, 48, 38, .10);
  font-family: Tahoma, Arial, sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { margin: 0; min-height: 100vh; background: var(--canvas); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.auth-page {
  background:
    radial-gradient(circle at 10% 15%, rgba(184, 135, 44, .16), transparent 24rem),
    linear-gradient(135deg, #eef4f0 0%, #f8faf8 55%, #edf2ef 100%);
  display: grid;
  place-items: center;
  padding: 32px;
}

.auth-shell {
  width: min(1040px, 100%);
  min-height: 620px;
  display: grid;
  grid-template-columns: .92fr 1.08fr;
  border-radius: 30px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--surface);
}

.install-shell { width: min(1180px, 100%); }
.brand-panel {
  color: #fff;
  padding: 64px 58px;
  background:
    linear-gradient(160deg, rgba(255,255,255,.07), transparent 40%),
    linear-gradient(145deg, #123c30, #0d513c 55%, #0c4233);
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  isolation: isolate;
}

.brand-panel::after {
  content: '';
  position: absolute;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 50%;
  left: -90px;
  bottom: -90px;
  box-shadow: 0 0 0 42px rgba(255,255,255,.035), 0 0 0 84px rgba(255,255,255,.025);
  z-index: -1;
}

.brand-mark {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #d9b15b, #ae7c20);
  color: #fff;
  font-size: 34px;
  font-weight: 800;
  box-shadow: 0 14px 28px rgba(0,0,0,.18);
  margin-bottom: 30px;
}

.brand-mark.small { width: 44px; height: 44px; border-radius: 14px; font-size: 22px; margin: 0; }
.eyebrow { margin: 0 0 12px; color: var(--gold); letter-spacing: 1.8px; font-size: 12px; font-weight: 800; }
.brand-panel .eyebrow { color: #e7c77f; }
.brand-panel h1 { font-size: clamp(36px, 5vw, 56px); line-height: 1.25; margin: 0 0 22px; }
.brand-panel > p:last-of-type { color: rgba(255,255,255,.75); line-height: 2; max-width: 420px; }
.secure-note { margin-top: 42px; display: inline-flex; gap: 10px; align-items: center; color: #d8ebe3; font-size: 13px; }
.secure-note span { color: #5ed5a7; }

.auth-card { padding: 64px; display: flex; flex-direction: column; justify-content: center; background: #fff; }
.auth-card.wide-card { padding: 44px 54px; }
.card-heading { margin-bottom: 30px; }
.card-heading h2 { margin: 14px 0 10px; font-size: 32px; }
.card-heading p { margin: 0; color: var(--muted); line-height: 1.7; }
.step-chip { color: var(--green); background: var(--green-soft); padding: 7px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; }

.stack-form { display: grid; gap: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
label { display: grid; gap: 8px; color: #35413d; font-size: 13px; font-weight: 700; }
label small { color: var(--muted); font-weight: 400; line-height: 1.6; }
input, select, textarea {
  width: 100%;
  border: 1px solid #d8e0dc;
  border-radius: 12px;
  background: #fbfcfb;
  padding: 13px 14px;
  color: var(--ink);
  outline: none;
  transition: .2s ease;
}
input:focus, select:focus, textarea:focus { border-color: var(--green-2); box-shadow: 0 0 0 4px rgba(23,118,87,.10); background: #fff; }
.form-divider { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 20px; margin-top: 4px; font-weight: 800; }
.full-span { grid-column: 1 / -1; }

.primary-button, .secondary-button, .primary-link {
  border: 0;
  border-radius: 12px;
  padding: 13px 18px;
  font-weight: 800;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}
.primary-button { background: linear-gradient(135deg, var(--green-2), var(--green)); color: #fff; box-shadow: 0 10px 22px rgba(15,91,67,.20); }
.secondary-button { color: var(--green); background: var(--green-soft); }
.primary-link { color: var(--green); background: var(--green-soft); padding: 10px 14px; }
.privacy-note { color: var(--muted); font-size: 12px; text-align: center; margin: 22px 0 0; }

.alert { border-radius: 13px; padding: 13px 16px; margin-bottom: 18px; font-size: 14px; line-height: 1.7; }
.alert-success { color: #0d684a; background: #e4f5ed; border: 1px solid #c4e8d9; }
.alert-danger { color: #8f2118; background: var(--red-soft); border: 1px solid #f3cbc7; }
.alert-warning { color: #7a5819; background: var(--gold-soft); border: 1px solid #ead49c; }

.dashboard-body { min-height: 100vh; background: var(--canvas); }
.sidebar {
  position: fixed;
  inset: 0 0 0 auto;
  width: 270px;
  background: #123b30;
  color: #fff;
  padding: 26px 20px;
  display: flex;
  flex-direction: column;
  z-index: 10;
}
.sidebar-brand { display: flex; gap: 13px; align-items: center; padding: 0 8px 28px; border-bottom: 1px solid rgba(255,255,255,.10); }
.sidebar-brand strong, .sidebar-brand span { display: block; }
.sidebar-brand strong { font-size: 20px; }
.sidebar-brand span { color: rgba(255,255,255,.58); font-size: 12px; margin-top: 4px; }
.sidebar nav { display: grid; gap: 7px; margin-top: 28px; }
.sidebar nav a { padding: 13px 15px; border-radius: 12px; display: flex; gap: 12px; align-items: center; color: rgba(255,255,255,.73); font-size: 14px; }
.sidebar nav a span { width: 21px; text-align: center; font-size: 19px; }
.sidebar nav a:hover, .sidebar nav a.active { background: rgba(255,255,255,.11); color: #fff; }
.sidebar-footer { margin-top: auto; padding: 18px 10px 4px; border-top: 1px solid rgba(255,255,255,.10); display: grid; gap: 6px; }
.sidebar-footer span { color: rgba(255,255,255,.55); font-size: 11px; }
.sidebar-footer a { color: #e8c77d; font-size: 12px; margin-top: 7px; }

.main-content { margin-right: 270px; padding: 36px clamp(24px, 4vw, 58px) 70px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.topbar h1 { margin: 5px 0 0; font-size: 31px; }
.today-chip { color: var(--muted); background: #fff; border: 1px solid var(--line); padding: 10px 14px; border-radius: 12px; font-size: 12px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 22px; box-shadow: 0 9px 30px rgba(28,50,42,.04); border-top: 4px solid var(--green-2); }
.stat-card.warning { border-top-color: var(--gold); }
.stat-card.danger { border-top-color: var(--red); }
.stat-card.muted { border-top-color: #89948f; }
.stat-card span, .stat-card small { color: var(--muted); display: block; }
.stat-card strong { font-size: 34px; display: block; margin: 13px 0 7px; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: 20px; margin-bottom: 22px; overflow: hidden; box-shadow: 0 8px 28px rgba(28,50,42,.035); }
.panel-heading { padding: 22px 24px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.panel-heading h2 { margin: 0 0 6px; font-size: 19px; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.form-panel { padding-bottom: 24px; }
.form-panel form { padding: 24px; }
.compact-form-panel .license-create-form { padding: 24px; grid-template-columns: repeat(3, minmax(0,1fr)); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 900px; }
th, td { padding: 15px 18px; border-bottom: 1px solid #edf0ee; text-align: right; white-space: nowrap; font-size: 13px; }
th { background: #fafbfa; color: var(--muted); font-size: 11px; font-weight: 800; }
td strong, td small { display: block; }
td small { color: var(--muted); margin-top: 4px; }
tbody tr:hover { background: #fbfcfb; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 6px 10px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.badge.success { color: #0d684a; background: #e4f5ed; }
.badge.warning { color: #815c18; background: var(--gold-soft); }
.badge.danger { color: #98271d; background: var(--red-soft); }

.two-column { display: grid; grid-template-columns: minmax(320px,.85fr) minmax(420px,1.15fr); gap: 22px; align-items: start; }
.simple-list article { display: grid; grid-template-columns: 44px 1fr auto; gap: 13px; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.simple-list article:last-child { border: 0; }
.simple-list strong, .simple-list span { display: block; }
.simple-list div > span { color: var(--muted); font-size: 12px; margin-top: 5px; }
.initial-avatar { width: 44px; height: 44px; border-radius: 13px; background: var(--green-soft); color: var(--green); display: grid; place-items: center; font-weight: 900; }
.initial-avatar.app { color: #956c20; background: var(--gold-soft); }
.empty-state { padding: 34px !important; text-align: center !important; color: var(--muted); }

.secret-card { display: grid; grid-template-columns: 1fr minmax(320px, 1.3fr) auto; gap: 16px; align-items: center; background: #142d25; color: #fff; border-radius: 18px; padding: 20px 22px; margin-bottom: 22px; box-shadow: var(--shadow); }
.secret-card strong, .secret-card span { display: block; }
.secret-card span { color: rgba(255,255,255,.65); font-size: 12px; margin-top: 5px; }
.secret-card code { overflow: hidden; text-overflow: ellipsis; direction: ltr; background: rgba(255,255,255,.08); padding: 12px; border-radius: 10px; color: #f2d793; }

.license-cards { padding: 18px; display: grid; gap: 14px; }
.license-card { border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.license-card-head { display: flex; justify-content: space-between; gap: 15px; align-items: start; }
.license-card-head strong, .license-card-head span { display: block; }
.license-card-head div span { color: var(--muted); margin-top: 5px; font-size: 12px; }
.license-meta { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin: 17px 0; padding: 13px; border-radius: 12px; background: #f7f9f8; }
.license-meta span, .license-meta b { display: block; }
.license-meta span { color: var(--muted); font-size: 11px; }
.license-meta b { color: var(--ink); margin-top: 5px; font-size: 12px; }
.inline-edit-form { display: flex; gap: 12px; align-items: end; }
.inline-edit-form label { min-width: 150px; }
.inline-edit-form .grow { flex: 1; }

@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .two-column { grid-template-columns: 1fr; }
  .compact-form-panel .license-create-form { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .secret-card { grid-template-columns: 1fr; }
  .inline-edit-form { flex-wrap: wrap; }
  .inline-edit-form label { flex: 1 1 200px; }
}

@media (max-width: 760px) {
  .auth-page { padding: 0; }
  .auth-shell { grid-template-columns: 1fr; border-radius: 0; min-height: 100vh; }
  .brand-panel { padding: 34px 26px; min-height: 280px; }
  .brand-panel h1 { font-size: 34px; }
  .brand-panel .brand-mark { width: 54px; height: 54px; margin-bottom: 18px; }
  .secure-note { margin-top: 18px; }
  .auth-card, .auth-card.wide-card { padding: 34px 24px; }
  .form-grid, .compact-form-panel .license-create-form { grid-template-columns: 1fr; }
  .full-span, .form-divider { grid-column: auto; }
  .sidebar { position: static; width: 100%; padding: 17px; }
  .sidebar nav { grid-template-columns: repeat(2, minmax(0,1fr)); margin-top: 16px; }
  .sidebar-footer { display: none; }
  .main-content { margin: 0; padding: 24px 16px 50px; }
  .topbar { align-items: end; }
  .topbar h1 { font-size: 25px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-card { padding: 17px; }
  .stat-card strong { font-size: 27px; }
  .license-meta { grid-template-columns: 1fr; }
}

