:root {
  color-scheme: dark;
  --bg: #07101f;
  --surface: #0d182b;
  --surface-2: #111f36;
  --surface-3: #172943;
  --border: #223757;
  --text: #edf4ff;
  --muted: #91a6c3;
  --primary: #21a6ff;
  --primary-2: #087ed0;
  --green: #2dd4a2;
  --orange: #ff9e4a;
  --purple: #9b7cff;
  --danger: #ff6379;
  --shadow: 0 24px 60px rgba(0, 0, 0, .28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: radial-gradient(circle at 80% 0, #102950 0, transparent 32%), var(--bg); color: var(--text); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }

.app-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 26px 20px; background: rgba(8, 19, 36, .94); border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 20; backdrop-filter: blur(18px); }
.brand, .login-brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; color: white; font-weight: 900; font-size: 22px; background: linear-gradient(145deg, #19b6ff, #655cff); box-shadow: 0 10px 26px rgba(33, 166, 255, .27); }
.brand strong { display: block; font-size: 19px; letter-spacing: .01em; }
.brand small, .sidebar-footer small, .user-copy small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.nav-list { display: grid; gap: 8px; margin-top: 40px; }
.nav-list a, .nav-disabled { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 13px; border-radius: 12px; color: #c7d5e8; }
.nav-list a:hover { background: var(--surface-3); color: white; }
.nav-list a span, .nav-disabled span { width: 24px; text-align: center; color: var(--primary); }
.nav-disabled { color: #667a98; cursor: not-allowed; }
.nav-disabled small { margin-left: auto; padding: 3px 7px; border-radius: 999px; background: #18263c; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.sidebar-footer { margin-top: auto; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px; padding: 15px; border: 1px solid var(--border); border-radius: 13px; color: #b8cae2; font-size: 12px; }
.sidebar-footer small { grid-column: 2; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(45, 212, 162, .1); }
.main-area { min-width: 0; }
.topbar { height: 92px; padding: 0 34px; display: flex; align-items: center; gap: 16px; border-bottom: 1px solid rgba(34, 55, 87, .75); background: rgba(7, 16, 31, .68); backdrop-filter: blur(16px); }
.topbar h1 { font-size: 23px; margin: 1px 0 0; }
.eyebrow { margin: 0; color: var(--primary); font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.user-menu { margin-left: auto; display: flex; align-items: center; gap: 11px; }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(145deg, #193658, #254c77); font-weight: 800; }
.user-copy strong { display: block; font-size: 13px; }
.page-content { padding: 30px 34px 50px; }
.mobile-menu { display: none; }
.button, .icon-button, .table-action { border: 0; cursor: pointer; transition: .18s ease; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 10px; font-weight: 750; font-size: 13px; }
.button-primary { color: white; background: linear-gradient(145deg, var(--primary), var(--primary-2)); box-shadow: 0 10px 24px rgba(21, 137, 219, .22); }
.button-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.button-ghost { color: #c6d7ec; background: var(--surface-2); border: 1px solid var(--border); }
.button-ghost:hover { color: white; border-color: #3d5f8d; }
.button-block { width: 100%; }
.icon-button { width: 38px; height: 38px; border-radius: 10px; color: var(--text); background: transparent; font-size: 21px; }
.icon-button:hover { background: var(--surface-3); }
.welcome-panel { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 27px 28px; border: 1px solid var(--border); border-radius: 18px; background: linear-gradient(120deg, rgba(22, 54, 91, .82), rgba(13, 24, 43, .88)); box-shadow: var(--shadow); }
.welcome-panel h2 { margin: 8px 0 7px; font-size: clamp(22px, 3vw, 32px); }
.muted { color: var(--muted); }
.welcome-panel .muted { margin: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.stat-card { position: relative; overflow: hidden; padding: 21px; min-height: 135px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.stat-card::after { content: ""; position: absolute; right: -20px; top: -30px; width: 90px; height: 90px; border-radius: 50%; background: currentColor; opacity: .08; }
.stat-card span { display: block; color: var(--muted); font-size: 12px; }
.stat-card strong { display: block; margin: 18px 0 6px; font-size: 23px; overflow-wrap: anywhere; }
.stat-card small { color: #a9bdd7; }
.accent-blue { color: var(--primary); } .accent-purple { color: var(--purple); } .accent-green { color: var(--green); } .accent-orange { color: var(--orange); }
.panel-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 20px; margin-top: 20px; }
.panel { padding: 24px; border: 1px solid var(--border); border-radius: 16px; background: rgba(13, 24, 43, .88); }
.panel-heading h2 { margin: 6px 0 18px; font-size: 19px; }
.feature-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.feature-list > div, .roadmap-list li { display: flex; gap: 12px; padding: 14px; border-radius: 12px; background: var(--surface-2); }
.feature-list p, .roadmap-list p { margin: 0; }
.feature-list strong, .roadmap-list strong { display: block; font-size: 13px; }
.feature-list small, .roadmap-list small { display: block; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.feature-icon { display: grid; place-items: center; flex: 0 0 27px; height: 27px; border-radius: 8px; color: var(--green); background: rgba(45, 212, 162, .11); }
.roadmap-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.roadmap-list li > span { display: grid; place-items: center; flex: 0 0 29px; height: 29px; border-radius: 9px; color: var(--primary); background: rgba(33, 166, 255, .1); font-weight: 800; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(440px, 100%); padding: 38px; border: 1px solid var(--border); border-radius: 22px; background: rgba(12, 25, 45, .94); box-shadow: var(--shadow); }
.login-brand { margin-bottom: 35px; font-size: 22px; }
.login-card h1 { margin: 7px 0; font-size: 31px; }
.login-card > .muted { margin-top: 0; }
.login-form { display: grid; gap: 17px; margin-top: 26px; }
.login-form label { display: grid; gap: 8px; color: #cbd9ec; font-size: 12px; font-weight: 700; }
.login-form input { width: 100%; height: 47px; padding: 0 13px; color: var(--text); background: #081528; border: 1px solid var(--border); border-radius: 10px; outline: none; }
.login-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(33, 166, 255, .11); }
.alert { margin-top: 20px; padding: 12px 14px; border-radius: 10px; font-size: 13px; }
.alert-error { color: #ffd4da; background: rgba(255, 99, 121, .12); border: 1px solid rgba(255, 99, 121, .28); }
.login-footnote { color: #6f86a5; font-size: 11px; text-align: center; margin: 21px 0 0; }

.file-manager { border: 1px solid var(--border); border-radius: 17px; background: rgba(13, 24, 43, .92); overflow: hidden; box-shadow: var(--shadow); }
.file-toolbar, .pathbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 15px 17px; border-bottom: 1px solid var(--border); }
.toolbar-group { display: flex; align-items: center; gap: 8px; }
.file-root-label { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.file-root-select { height: 40px; min-width: 210px; padding: 0 34px 0 11px; color: var(--text); background: #0b1930; border: 1px solid var(--border); border-radius: 10px; outline: none; }
.file-root-select:focus { border-color: var(--primary); }
.pathbar { min-height: 56px; background: #0a1628; }
.breadcrumbs { display: flex; align-items: center; gap: 7px; overflow-x: auto; }
.breadcrumbs button { border: 0; color: #b9cbe3; background: none; cursor: pointer; padding: 5px; }
.breadcrumbs button:hover { color: var(--primary); }
.breadcrumbs span { color: #49607e; }
.storage-summary { color: var(--muted); font-size: 12px; white-space: nowrap; }
.file-table-wrap { overflow-x: auto; }
.file-table { width: 100%; border-collapse: collapse; min-width: 840px; }
.file-table th { padding: 12px 15px; color: #7690b1; background: #0a1628; text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.file-table td { padding: 12px 15px; border-top: 1px solid rgba(34, 55, 87, .66); color: #aebfd6; font-size: 12px; }
.file-table tbody tr:hover { background: rgba(24, 45, 74, .46); }
.file-name { display: flex; align-items: center; gap: 10px; min-width: 220px; max-width: 430px; padding: 0; color: #e5effc; background: none; border: 0; cursor: default; text-align: left; }
.file-name span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-icon { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 8px; background: #162942; color: #8eabd0; }
.file-icon-directory { color: var(--orange); background: rgba(255, 158, 74, .1); }
.file-icon-symlink { color: var(--purple); }
.file-table code { color: #a9c4e6; background: #071424; padding: 4px 7px; border-radius: 6px; }
.actions-column { width: 290px; }
.row-actions { display: flex; align-items: center; gap: 5px; }
.table-action { padding: 6px 8px; border-radius: 7px; color: #acc2dc; background: #142641; font-size: 10px; }
.table-action:hover { color: white; background: #20436a; }
.table-action.danger:hover { color: #ffdce1; background: rgba(255, 99, 121, .2); }
.empty-state { padding: 55px 20px !important; text-align: center !important; color: var(--muted) !important; }
.error-text { color: #ff9baa !important; }
.file-manager-note { margin: 0; padding: 12px 17px; border-top: 1px solid var(--border); color: #6f86a5; font-size: 11px; }
.editor-dialog { width: min(960px, calc(100vw - 30px)); padding: 0; border: 1px solid var(--border); border-radius: 17px; color: var(--text); background: var(--surface); box-shadow: var(--shadow); }
.editor-dialog::backdrop { background: rgba(0, 6, 15, .75); backdrop-filter: blur(4px); }
.dialog-card header, .dialog-card footer { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; }
.dialog-card header { border-bottom: 1px solid var(--border); }
.dialog-card footer { justify-content: flex-end; gap: 9px; border-top: 1px solid var(--border); }
.dialog-card h2 { margin: 5px 0 0; font-size: 16px; max-width: 760px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#editor-content { display: block; width: 100%; height: min(62vh, 620px); padding: 18px; resize: vertical; border: 0; outline: 0; color: #dbe9fb; background: #07111f; font: 13px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; tab-size: 4; }
.toast { position: fixed; right: 25px; bottom: 25px; z-index: 100; max-width: 360px; padding: 12px 16px; border-radius: 11px; color: white; background: #193453; border: 1px solid #365b86; box-shadow: var(--shadow); opacity: 0; transform: translateY(15px); pointer-events: none; transition: .2s ease; }
.toast-visible { opacity: 1; transform: translateY(0); }
.toast-error { background: #4a1824; border-color: #833044; }

.websites-app { display: grid; gap: 20px; }
.website-create-panel, .website-list-panel { padding: 24px; }
.website-create-panel .panel-heading, .website-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.website-create-panel .panel-heading h2, .website-list-heading h2 { margin-bottom: 0; }
.security-badge { padding: 6px 10px; border-radius: 999px; color: #a7edd8; background: rgba(45, 212, 162, .1); border: 1px solid rgba(45, 212, 162, .22); font-size: 10px; font-weight: 750; }
.website-intro { margin: 14px 0 20px; font-size: 13px; }
.website-intro code, .website-table code { color: #a9c4e6; background: #071424; padding: 4px 7px; border-radius: 6px; }
.website-form { display: grid; grid-template-columns: 1.2fr .8fr auto; align-items: end; gap: 14px; }
.website-form label { display: grid; gap: 7px; color: #cbd9ec; font-size: 12px; font-weight: 700; }
.website-form label small { color: var(--muted); font-size: 10px; font-weight: 400; }
.website-form input { width: 100%; height: 44px; padding: 0 13px; color: var(--text); background: #081528; border: 1px solid var(--border); border-radius: 10px; outline: none; }
.website-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(33, 166, 255, .11); }
.website-submit { min-height: 44px; }
.website-submit:disabled { opacity: .55; cursor: wait; }
.inline-message { margin-top: 16px; padding: 11px 13px; border-radius: 10px; font-size: 12px; }
.inline-message-success { color: #b8f5e3; background: rgba(45, 212, 162, .09); border: 1px solid rgba(45, 212, 162, .22); }
.inline-message-error { color: #ffd4da; background: rgba(255, 99, 121, .1); border: 1px solid rgba(255, 99, 121, .25); }
.website-table-wrap { overflow-x: auto; margin-top: 18px; border: 1px solid var(--border); border-radius: 12px; }
.website-table { width: 100%; border-collapse: collapse; min-width: 820px; }
.website-table th { padding: 12px 14px; color: #7690b1; background: #0a1628; text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.website-table td { padding: 14px; border-top: 1px solid rgba(34, 55, 87, .66); color: #b5c7dd; font-size: 12px; }
.website-table td:first-child a { color: #ddebff; font-weight: 700; }
.website-table td:first-child a:hover { color: var(--primary); }
.status-badge { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.status-pending { color: #ffcc96; background: rgba(255, 158, 74, .12); }
.status-provisioning { color: #a8dfff; background: rgba(33, 166, 255, .12); }
.status-active { color: #9befd6; background: rgba(45, 212, 162, .12); }
.status-failed { color: #ffb1bd; background: rgba(255, 99, 121, .14); }

@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .panel-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: -280px; width: 260px; transition: left .2s ease; }
  .sidebar.sidebar-open { left: 0; box-shadow: var(--shadow); }
  .mobile-menu { display: grid; place-items: center; }
  .topbar { height: 78px; padding: 0 17px; }
  .topbar h1 { font-size: 19px; }
  .user-copy { display: none; }
  .user-menu .button { padding: 0 10px; }
  .page-content { padding: 18px 14px 35px; }
  .welcome-panel, .file-toolbar, .pathbar { align-items: stretch; flex-direction: column; }
  .stat-grid, .feature-list { grid-template-columns: 1fr; }
  .toolbar-group { flex-wrap: wrap; }
  .storage-summary { white-space: normal; }
  .login-card { padding: 28px 22px; }
  .website-form { grid-template-columns: 1fr; }
  .website-create-panel .panel-heading, .website-list-heading { align-items: flex-start; }
}
