:root {
  --bg: #07111f;
  --panel: rgba(12, 26, 44, .82);
  --panel-strong: #10233b;
  --line: rgba(156, 190, 224, .17);
  --text: #f4f8fc;
  --muted: #9db0c4;
  --cyan: #35c9ff;
  --blue: #4c79ff;
  --amber: #ffae42;
  --danger: #ff718b;
  --radius: 24px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: radial-gradient(circle at 50% -20%, #173657 0, #07111f 48%, #050b14 100%); overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.ambient { position: fixed; border-radius: 999px; filter: blur(110px); opacity: .16; pointer-events: none; }
.ambient-one { width: 420px; height: 420px; background: var(--blue); top: -180px; left: -100px; }
.ambient-two { width: 360px; height: 360px; background: var(--cyan); right: -180px; bottom: -160px; }

.auth-shell, .settings-shell { min-height: 100vh; display: grid; place-items: center; padding: 32px 18px; position: relative; }
.auth-card, .settings-card { width: min(100%, 480px); padding: 42px; border: 1px solid var(--line); border-radius: 30px; background: linear-gradient(145deg, rgba(17, 38, 64, .92), rgba(7, 17, 31, .94)); box-shadow: 0 35px 90px rgba(0, 0, 0, .42); backdrop-filter: blur(24px); }
.brand-mark { width: 66px; height: 66px; display: grid; place-items: center; border-radius: 20px; margin-bottom: 30px; background: linear-gradient(135deg, var(--cyan), var(--blue)); box-shadow: 0 15px 38px rgba(53, 201, 255, .24); color: #04111d; font-weight: 900; letter-spacing: -.04em; }
.eyebrow { color: #62d5ff; font-size: .76rem; letter-spacing: .2em; font-weight: 800; }
h1 { margin: 12px 0 10px; font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.02; letter-spacing: -.045em; }
.auth-card h1, .settings-card h1 { font-size: clamp(2rem, 7vw, 2.8rem); }
.lead, .hero-copy p { margin: 0; color: var(--muted); line-height: 1.65; }
.auth-form { display: grid; gap: 18px; margin-top: 30px; }
.auth-form label { display: grid; gap: 8px; color: #c7d6e5; font-size: .86rem; font-weight: 700; }
.auth-form input { width: 100%; border: 1px solid var(--line); border-radius: 14px; background: rgba(3, 12, 23, .72); color: var(--text); padding: 14px 15px; outline: none; transition: border-color .2s, box-shadow .2s; }
.auth-form input:focus { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(53, 201, 255, .12); }
.primary-button { border: 0; border-radius: 14px; padding: 15px 18px; color: #04111d; background: linear-gradient(135deg, #69ddff, #6685ff); font-weight: 900; cursor: pointer; box-shadow: 0 16px 35px rgba(62, 157, 255, .22); }
.security-note { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 9px; font-size: .8rem; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #48e1a0; box-shadow: 0 0 0 5px rgba(72, 225, 160, .1); }
.alert { border-radius: 13px; padding: 12px 14px; margin-top: 20px; font-size: .86rem; }
.alert-error { color: #ffdce3; border: 1px solid rgba(255, 113, 139, .28); background: rgba(255, 113, 139, .1); }
.alert-success { color: #c9ffe8; border: 1px solid rgba(72, 225, 160, .28); background: rgba(72, 225, 160, .1); }
.back-link { text-align: center; color: var(--muted); font-size: .86rem; }

.topbar { height: 76px; max-width: 1240px; margin: 0 auto; padding: 0 26px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); position: relative; z-index: 2; }
.brand-inline { display: flex; align-items: center; gap: 11px; }
.brand-mini { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: linear-gradient(135deg, var(--cyan), var(--blue)); color: #05111e; font-size: .72rem; font-weight: 950; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.topbar-actions form { margin: 0; }
.user-chip { color: var(--muted); font-size: .84rem; margin-right: 5px; }
.ghost-button { border: 1px solid var(--line); background: rgba(255,255,255,.025); color: #d9e5f0; padding: 9px 13px; border-radius: 11px; cursor: pointer; font-size: .82rem; }

.dashboard-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 76px 0 54px; position: relative; z-index: 1; }
.hero-copy { max-width: 720px; margin: 0 auto 44px; text-align: center; }
.hero-copy p { font-size: 1.02rem; max-width: 620px; margin: 0 auto; }
.app-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.app-card { min-height: 330px; padding: 25px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(155deg, rgba(19, 42, 69, .9), rgba(7, 17, 31, .88)); position: relative; overflow: hidden; transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease; }
.app-card::after { content: ""; position: absolute; width: 210px; height: 210px; border-radius: 50%; right: -100px; top: -100px; background: var(--card-accent, var(--blue)); filter: blur(45px); opacity: .13; }
.app-card[href]:hover { transform: translateY(-6px); border-color: rgba(106, 208, 255, .45); box-shadow: 0 26px 60px rgba(0, 0, 0, .3); }
.tone-blue { --card-accent: var(--cyan); }
.tone-amber { --card-accent: var(--amber); }
.app-card-placeholder { --card-accent: #64758a; border-style: dashed; }
.app-card-top { display: flex; justify-content: space-between; align-items: flex-start; position: relative; z-index: 1; }
.app-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; background: rgba(67, 167, 255, .13); border: 1px solid rgba(98, 213, 255, .18); color: #a9e8ff; font-weight: 900; letter-spacing: -.04em; }
.tone-amber .app-icon { background: rgba(255, 174, 66, .12); border-color: rgba(255, 174, 66, .2); color: #ffd494; }
.app-status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .72rem; }
.app-status .status-dot { width: 6px; height: 6px; box-shadow: none; }
.app-card-copy { margin-top: auto; position: relative; z-index: 1; }
.app-card h2 { margin: 0 0 10px; font-size: 1.55rem; letter-spacing: -.025em; }
.app-card p { margin: 0; color: var(--muted); line-height: 1.58; font-size: .92rem; }
.app-open { margin-top: 24px; color: #a9e8ff; font-size: .85rem; font-weight: 800; position: relative; z-index: 1; }
.app-open.muted { color: #73869a; }
.info-strip { margin-top: 22px; padding: 20px 24px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; border: 1px solid var(--line); border-radius: 18px; background: rgba(5, 14, 26, .55); }
.info-strip div { display: grid; gap: 3px; text-align: center; }
.info-strip strong { font-size: .82rem; }
.info-strip span { color: var(--muted); font-size: .74rem; }

.admin-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 58px 0 70px; position: relative; z-index: 1; }
.admin-heading { max-width: 700px; margin-bottom: 30px; }
.admin-heading h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); }
.admin-heading p { margin: 0; color: var(--muted); line-height: 1.6; }
.admin-shell > .alert { margin: 0 0 20px; }
.admin-grid { display: grid; grid-template-columns: minmax(300px, .7fr) minmax(520px, 1.3fr); gap: 20px; align-items: start; }
.panel-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; background: linear-gradient(155deg, rgba(19, 42, 69, .9), rgba(7, 17, 31, .9)); box-shadow: 0 24px 60px rgba(0, 0, 0, .2); }
.panel-title { display: flex; gap: 15px; align-items: center; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.panel-title h2 { margin: 0 0 4px; font-size: 1.18rem; }
.panel-title p { margin: 0; color: var(--muted); font-size: .8rem; }
.check-row { display: flex !important; grid-template-columns: auto 1fr; align-items: center; gap: 10px !important; }
.check-row input { width: 18px; height: 18px; accent-color: var(--cyan); }
.users-list { display: grid; gap: 14px; margin-top: 20px; }
.user-row { padding: 17px; border: 1px solid var(--line); border-radius: 17px; background: rgba(3, 12, 23, .42); }
.user-summary { display: grid; grid-template-columns: auto minmax(120px, 1fr) auto; align-items: center; gap: 12px; }
.user-avatar { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: #061320; background: linear-gradient(135deg, #69ddff, #6685ff); font-weight: 950; }
.user-meta { display: grid; gap: 2px; min-width: 0; }
.user-meta strong, .user-meta span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta span { color: var(--muted); font-size: .78rem; }
.user-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.badge { border: 1px solid var(--line); border-radius: 999px; padding: 5px 8px; color: var(--muted); font-size: .66rem; font-weight: 800; }
.badge-admin { color: #b9ecff; border-color: rgba(53, 201, 255, .28); background: rgba(53, 201, 255, .08); }
.badge-on { color: #aaf6d1; border-color: rgba(72, 225, 160, .25); background: rgba(72, 225, 160, .08); }
.badge-off { color: #ffc5d0; border-color: rgba(255, 113, 139, .25); background: rgba(255, 113, 139, .08); }
.user-controls { margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 9px; }
.inline-form { display: flex; flex: 1; gap: 8px; }
.compact-input { min-width: 0; flex: 1; border: 1px solid var(--line); border-radius: 10px; background: rgba(3, 12, 23, .72); color: var(--text); padding: 9px 10px; outline: none; font-size: .78rem; }
.compact-input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(53, 201, 255, .1); }
.small-button { border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: rgba(53, 201, 255, .08); color: #cbeeff; cursor: pointer; font-size: .73rem; font-weight: 800; }
.danger-button { color: #ffc5d0; background: rgba(255, 113, 139, .08); border-color: rgba(255, 113, 139, .2); }
.current-account { color: var(--muted); font-size: .7rem; white-space: nowrap; }

@media (max-width: 880px) {
  .app-grid { grid-template-columns: 1fr 1fr; }
  .app-card-placeholder { grid-column: 1 / -1; min-height: 210px; }
  .admin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .auth-card, .settings-card { padding: 30px 22px; border-radius: 24px; }
  .topbar { padding: 0 16px; }
  .user-chip { display: none; }
  .dashboard-shell { width: min(100% - 28px, 1180px); padding-top: 54px; }
  .app-grid { grid-template-columns: 1fr; }
  .app-card { min-height: 285px; }
  .app-card-placeholder { grid-column: auto; }
  .info-strip { grid-template-columns: 1fr; }
  .admin-shell { width: min(100% - 28px, 1180px); padding-top: 40px; }
  .panel-card { padding: 20px 16px; }
  .user-summary { grid-template-columns: auto 1fr; }
  .user-badges { grid-column: 1 / -1; justify-content: flex-start; }
  .user-controls { align-items: stretch; flex-direction: column; }
  .inline-form { width: 100%; }
  .current-account { padding: 4px 0; }
}

/* Dashboard visual refresh */
.dashboard-shell { padding-top: 64px; }
.hero-copy { max-width: 760px; margin-bottom: 38px; }
.hero-copy h1 { font-size: clamp(2.8rem, 6vw, 5rem); background: linear-gradient(105deg, #fff 15%, #a9e8ff 55%, #b9c8ff); -webkit-background-clip: text; color: transparent; }
.hero-status { width: max-content; margin: 24px auto 0; padding: 8px 12px; display: flex; gap: 18px; border: 1px solid var(--line); border-radius: 999px; background: rgba(5, 14, 26, .5); color: var(--muted); font-size: .7rem; }
.hero-status span { display: flex; align-items: center; gap: 7px; }
.hero-status i { width: 7px; height: 7px; border-radius: 50%; background: #48e1a0; box-shadow: 0 0 0 5px rgba(72,225,160,.08); }
.app-card { min-height: 350px; padding: 27px; }
.app-card::before { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, rgba(255,255,255,.035), transparent 36%); pointer-events: none; }
.app-icon { width: 58px; height: 58px; }
.app-icon svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.app-card-copy { max-width: 90%; }
.app-card h2 { font-size: 1.65rem; }
.app-open { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.app-open > span { width: 31px; height: 31px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; }
.card-watermark { position: absolute; right: 22px; bottom: 48px; color: rgba(255,255,255,.025); font-size: 5.5rem; font-weight: 950; letter-spacing: -.12em; pointer-events: none; }
.info-strip { padding: 15px 20px; }
.info-strip>div { grid-template-columns: auto 1fr; align-items: center; gap: 11px; text-align: left; justify-self: center; }
.info-strip p { margin: 0; display: grid; gap: 3px; }
.strip-icon { width: 35px; height: 35px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 11px; background: rgba(53,201,255,.06); color: #91ddfa; font-weight: 900; }
@media(max-width:620px){.hero-status{width:100%;justify-content:center}.hero-status span:last-child{display:none}.app-card{min-height:300px}.info-strip>div{justify-self:start;width:100%}}

