:root {
  --ink: #17121f;
  --muted: #665f72;
  --paper: #fffaf0;
  --paper-strong: #ffffff;
  --violet: #7c3cff;
  --violet-deep: #4d16ad;
  --lime: #baff4f;
  --pink: #ff5f9f;
  --orange: #ff9b3f;
  --cyan: #55d9ff;
  --line: rgba(23, 18, 31, 0.16);
  --shadow: 9px 10px 0 var(--ink);
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; }
button, input, textarea { font: inherit; }
a { color: inherit; }

.dashboard-body {
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 6% 10%, rgba(255, 95, 159, .22), transparent 25rem),
    radial-gradient(circle at 92% 17%, rgba(85, 217, 255, .25), transparent 27rem),
    linear-gradient(rgba(23, 18, 31, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 18, 31, .04) 1px, transparent 1px),
    var(--paper);
  background-size: auto, auto, 38px 38px, 38px 38px, auto;
  font: 500 16px/1.55 "Nunito Sans", sans-serif;
}

.dashboard-grain {
  position: fixed;
  z-index: 20;
  inset: 0;
  pointer-events: none;
  opacity: .08;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.25'/%3E%3C/svg%3E");
}

.dashboard-header {
  position: sticky;
  z-index: 10;
  top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1400px, calc(100% - 32px));
  margin: 14px auto 0;
  padding: 10px 12px 10px 16px;
  border: 2px solid var(--ink);
  border-radius: 20px;
  background: rgba(255, 250, 240, .9);
  box-shadow: 5px 6px 0 var(--ink);
  backdrop-filter: blur(18px);
}

.dashboard-brand { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.dashboard-brand img { width: 46px; height: 46px; border: 2px solid var(--ink); border-radius: 13px; object-fit: cover; }
.dashboard-brand span { font: 400 1.05rem/1 "Chango", sans-serif; }
.dashboard-brand b { padding: 5px 8px; border-radius: 7px; color: #fff; background: var(--violet); font: 700 .62rem/1 "Azeret Mono", monospace; letter-spacing: .08em; }

.dashboard-header nav { display: flex; align-items: center; gap: 5px; }
.nav-link { padding: 10px 12px; border: 0; border-radius: 10px; color: var(--ink); background: transparent; font: 700 .72rem/1 "Azeret Mono", monospace; text-decoration: none; text-transform: uppercase; cursor: pointer; }
.nav-link:hover { background: rgba(124, 60, 255, .11); }
.inline-form { display: inline-flex; margin: 0; }
.account-chip { display: inline-flex; align-items: center; gap: 7px; max-width: 220px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.account-chip i { width: 8px; height: 8px; flex: none; border-radius: 50%; background: #3ecf6b; box-shadow: 0 0 0 4px rgba(62, 207, 107, .15); }

.dashboard-shell { width: min(1280px, calc(100% - 32px)); min-height: calc(100vh - 180px); margin: 0 auto; padding: 70px 0 90px; }
.eyebrow { color: var(--violet-deep); font: 700 .72rem/1.2 "Azeret Mono", monospace; letter-spacing: .12em; }

.notice { margin: 0 0 24px; padding: 15px 18px; border: 2px solid var(--ink); border-radius: 14px; box-shadow: 4px 5px 0 var(--ink); font-weight: 800; }
.notice-success { background: var(--lime); }
.notice-error { color: #fff; background: #b91f4b; }

.login-layout { display: grid; grid-template-columns: 1.08fr .92fr; align-items: center; min-height: 680px; gap: clamp(34px, 7vw, 100px); }
.login-story h1, .dashboard-hero h1, .project-hero h1 { margin: 22px 0; font: 400 clamp(3.3rem, 7vw, 7.2rem)/.9 "Chango", sans-serif; letter-spacing: -.05em; }
.login-story h1 em, .dashboard-hero h1 em { color: transparent; background: linear-gradient(90deg, #ff4f63, #ff9b3f 25%, #2ca65a 50%, #247eca 72%, #7c3cff); background-clip: text; -webkit-background-clip: text; font-style: normal; }
.login-story > p { max-width: 680px; color: var(--muted); font-size: 1.2rem; }
.login-steps { display: grid; padding: 0; margin: 34px 0 0; list-style: none; gap: 12px; }
.login-steps li { display: grid; grid-template-columns: 46px 1fr; align-items: center; padding: 13px 15px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.55); }
.login-steps b { color: var(--violet); font: 700 .76rem "Azeret Mono", monospace; }
.login-steps code { padding: 3px 7px; border-radius: 6px; color: #fff; background: var(--ink); }

.key-card, .create-panel, .credential-panel, .settings-panel, .core-panel, .danger-panel, .limit-panel, .icon-panel {
  border: 2px solid var(--ink);
  border-radius: 25px;
  background: rgba(255,255,255,.8);
  box-shadow: var(--shadow);
}
.key-card { position: relative; padding: clamp(28px, 5vw, 52px); overflow: hidden; }
.key-card::before { position: absolute; top: -70px; right: -60px; width: 190px; height: 190px; border: 28px solid var(--orange); border-radius: 50%; content: ""; opacity: .85; }
.card-number { position: relative; color: var(--violet); font: 700 .7rem "Azeret Mono", monospace; letter-spacing: .12em; }
.key-card h2, .create-panel h2, .credential-panel h2, .settings-panel h2, .core-panel h2, .danger-panel h2, .icon-panel h2 { position: relative; margin: 13px 0 8px; font: 400 clamp(1.8rem, 4vw, 3rem)/1 "Chango", sans-serif; }
.key-card p { position: relative; margin-bottom: 30px; color: var(--muted); }
label { display: grid; margin-top: 17px; gap: 8px; font: 700 .7rem/1.3 "Azeret Mono", monospace; letter-spacing: .05em; text-transform: uppercase; }
input, textarea { width: 100%; border: 2px solid var(--ink); border-radius: 12px; outline: 0; color: var(--ink); background: #fff; font: 700 .95rem/1.3 "Azeret Mono", monospace; text-transform: none; }
input { min-height: 50px; padding: 0 14px; }
textarea { padding: 14px; resize: vertical; }
input:focus, textarea:focus { border-color: var(--violet); box-shadow: 0 0 0 4px rgba(124,60,255,.14); }
input:disabled { color: var(--muted); background: #ece7f1; }
.key-card small { display: block; margin-top: 16px; color: var(--muted); }

.primary-button, .secondary-button, .danger-button { display: inline-flex; min-height: 52px; align-items: center; justify-content: space-between; gap: 20px; padding: 0 20px; border: 2px solid var(--ink); border-radius: 13px; font: 700 .76rem "Azeret Mono", monospace; text-decoration: none; text-transform: uppercase; cursor: pointer; transition: 150ms ease; }
.primary-button { width: 100%; margin-top: 22px; color: #fff; background: var(--violet); box-shadow: 4px 5px 0 var(--ink); }
.primary-button:hover, .secondary-button:hover, .danger-button:hover { transform: translate(-2px,-2px); box-shadow: 6px 7px 0 var(--ink); }
.button-link { width: auto; margin-top: 0; }
.secondary-button { background: var(--paper-strong); }
.danger-button { color: #fff; background: #b91f4b; }

.dashboard-hero { display: flex; align-items: end; justify-content: space-between; min-height: 370px; padding: 20px 0 50px; gap: 30px; }
.dashboard-hero h1 { margin-bottom: 0; font-size: clamp(3rem, 7vw, 6.8rem); }
.capacity-card { min-width: 230px; padding: 26px; border: 2px solid var(--ink); border-radius: 50% 50% 18px 18px; background: var(--lime); box-shadow: 8px 9px 0 var(--ink); text-align: center; }
.capacity-card span { font: 400 3.4rem/1 "Chango", sans-serif; }
.capacity-card p { margin: 8px 0 0; font-weight: 900; }

.project-section { padding: 42px 0; border-top: 2px solid var(--ink); }
.section-heading, .panel-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.section-heading h2 { margin: 8px 0 0; font: 400 2.2rem "Chango", sans-serif; }
.section-heading > p { max-width: 420px; color: var(--muted); }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); margin-top: 26px; gap: 18px; }
.project-card { display: flex; min-height: 250px; flex-direction: column; padding: 24px; border: 2px solid var(--ink); border-radius: 22px; background: rgba(255,255,255,.72); box-shadow: 5px 6px 0 var(--ink); text-decoration: none; transition: 160ms ease; }
.project-card:nth-child(3n+2) { background: #f4ecff; }
.project-card:nth-child(3n+3) { background: #e8faff; }
.project-card:hover { transform: translateY(-5px); box-shadow: 8px 11px 0 var(--ink); }
.project-card-top { display: flex; align-items: center; gap: 7px; font: 700 .63rem "Azeret Mono", monospace; }
.project-card-top code { margin-left: auto; color: var(--muted); }
.status-dot { width: 10px; height: 10px; flex: none; border: 1px solid var(--ink); border-radius: 50%; background: var(--orange); }
.status-live { background: #35d36d; }
.status-error { background: #f03265; }
.project-card h3 { margin: 34px 0 10px; font: 400 1.55rem/1.05 "Chango", sans-serif; }
.project-card p { margin: 0; color: var(--muted); }
.project-open { margin-top: auto; padding-top: 24px; font: 700 .72rem "Azeret Mono", monospace; }
.empty-projects { display: flex; grid-column: 1/-1; align-items: center; padding: 34px; border: 2px dashed var(--violet); border-radius: 22px; gap: 24px; }
.empty-projects > span { color: var(--violet); font: 400 4rem "Chango", sans-serif; }
.empty-projects h3, .empty-projects p { margin: 4px 0; }

.create-panel, .credential-panel { margin-top: 44px; padding: clamp(24px, 5vw, 46px); }
.form-grid, .credential-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 18px; }
.slots-badge, .secure-badge { padding: 8px 11px; border: 2px solid var(--ink); border-radius: 999px; background: var(--lime); font: 700 .67rem "Azeret Mono", monospace; }
.pma-link { text-decoration: none; }
.pma-link:hover { background: var(--cyan); }
.provision-note { display: flex; align-items: center; margin-top: 20px; padding: 13px 15px; border-radius: 13px; background: #f1eaff; gap: 12px; }
.provision-note span { color: var(--violet); font-size: 1.6rem; }
.provision-note p { margin: 0; }
.limit-panel { margin-top: 44px; padding: 30px; background: #ffe5ed; }
.limit-panel b { font: 400 1.4rem "Chango", sans-serif; }

.back-link { display: inline-flex; margin: 20px 0 34px; font: 700 .76rem "Azeret Mono", monospace; text-decoration: none; }
.project-hero { display: flex; align-items: end; justify-content: space-between; padding: 20px 0 30px; gap: 30px; }
.project-hero h1 { margin: 15px 0; font-size: clamp(3rem, 7vw, 6.5rem); }
.project-hero p { max-width: 700px; color: var(--muted); font-size: 1.16rem; }
.project-status { display: inline-flex; align-items: center; padding: 11px 14px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; gap: 8px; font: 700 .7rem "Azeret Mono", monospace; }
.project-actions { display: flex; flex-wrap: wrap; margin-bottom: 34px; gap: 12px; }

.copy-field { display: flex; align-items: stretch; }
.copy-field input { border-radius: 12px 0 0 12px; }
.copy-field button { padding: 0 12px; border: 2px solid var(--ink); border-left: 0; background: var(--lime); font: 700 .67rem "Azeret Mono", monospace; cursor: pointer; }
.copy-field button:last-child { border-radius: 0 12px 12px 0; }
.credential-wide { grid-column: 1/-1; }
.icon-panel { display: grid; grid-template-columns: minmax(0, .9fr) minmax(340px, 1.1fr); align-items: center; margin-top: 38px; padding: clamp(24px, 5vw, 46px); background: linear-gradient(135deg, rgba(255,255,255,.92), #f1eaff); gap: clamp(28px, 6vw, 80px); }
.icon-copy p { max-width: 580px; color: var(--muted); font-size: 1.05rem; }
.icon-copy ul { display: flex; flex-wrap: wrap; padding: 0; margin: 24px 0 0; list-style: none; gap: 8px; }
.icon-copy li { padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font: 700 .65rem "Azeret Mono", monospace; }
.icon-editor { display: grid; grid-template-columns: 180px 1fr; align-items: center; gap: 24px; }
.icon-preview { display: grid; width: 180px; height: 180px; place-items: center; border: 2px solid var(--ink); border-radius: 38px 12px 38px 12px; overflow: hidden; background: #fff; box-shadow: 7px 8px 0 var(--violet); }
.icon-preview img { width: 100%; height: 100%; object-fit: cover; }
.icon-editor form { min-width: 0; }
.file-input { min-height: 0; padding: 10px; background: #fff; }
.file-input::file-selector-button { margin-right: 10px; padding: 9px 12px; border: 0; border-radius: 8px; color: #fff; background: var(--ink); font: 700 .65rem "Azeret Mono", monospace; cursor: pointer; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; margin-top: 38px; gap: 24px; }
.settings-panel, .core-panel { padding: 30px; }
.core-panel { background: var(--ink); color: #fff; box-shadow: 9px 10px 0 var(--violet); }
.core-panel .eyebrow { color: var(--lime); }
.core-panel p { color: #ccc1d9; }
.core-panel code { color: var(--lime); }
.core-panel dl { display: grid; margin: 24px 0; gap: 10px; }
.core-panel dl div { display: grid; grid-template-columns: 110px 1fr; padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,.15); }
.core-panel dt { color: #a99fb5; }
.core-panel dd { margin: 0; overflow-wrap: anywhere; }
.core-panel > a { color: var(--lime); font-weight: 900; }
.danger-panel { display: grid; grid-template-columns: 1fr 1fr; align-items: center; margin-top: 38px; padding: 30px; border-color: #8e1739; background: #ffe9ef; box-shadow: 9px 10px 0 #8e1739; gap: 40px; }

.dashboard-footer { display: flex; justify-content: space-between; width: min(1280px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 40px; border-top: 1px solid var(--line); color: var(--muted); font: 700 .7rem "Azeret Mono", monospace; }
.dashboard-footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.dashboard-footer a:hover { color: var(--violet-deep); }

@media (max-width: 900px) {
  .login-layout, .settings-grid, .danger-panel, .icon-panel { grid-template-columns: 1fr; }
  .login-layout { padding-top: 40px; }
  .project-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-hero, .project-hero { align-items: start; flex-direction: column; }
  .capacity-card { align-self: stretch; border-radius: 18px; }
  .dashboard-header nav .account-chip { display: none; }
}

@media (max-width: 620px) {
  .dashboard-header { top: 8px; width: calc(100% - 16px); margin-top: 8px; }
  .dashboard-brand span, .dashboard-header nav > a:nth-child(2) { display: none; }
  .dashboard-brand b { display: inline; }
  .nav-link { padding: 9px 7px; font-size: .62rem; }
  .dashboard-shell { width: calc(100% - 24px); padding-top: 48px; }
  .project-grid, .form-grid, .credential-grid { grid-template-columns: 1fr; }
  .credential-wide { grid-column: auto; }
  .section-heading, .panel-heading { align-items: start; flex-direction: column; }
  .login-story h1, .dashboard-hero h1, .project-hero h1 { font-size: 3.2rem; }
  .copy-field { flex-wrap: wrap; }
  .copy-field input { flex: 1 0 100%; border-radius: 12px 12px 0 0; }
  .copy-field button { min-height: 40px; flex: 1; border-top: 0; border-left: 2px solid var(--ink); }
  .copy-field button:last-child { border-radius: 0 0 12px 0; }
  .icon-editor { grid-template-columns: 1fr; }
  .icon-preview { width: 150px; height: 150px; }
  .dashboard-footer { align-items: start; flex-direction: column; gap: 8px; }
}
