:root {
  color-scheme: light;
  --primary: #7939bd;
  --primary-dark: #62299e;
  --primary-light: #f0e6fa;
  --sidebar: #20142e;
  --background: #f7f7fb;
  --surface: #ffffff;
  --text: #292134;
  --muted: #81788b;
  --border: #e9e4ee;
  --success: #16834b;
  --danger: #bc303d;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select {
  font: inherit;
}

button, a, input {
  -webkit-tap-highlight-color: transparent;
}

button, .button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid #b38ee2;
  outline-offset: 3px;
}

.brand {
  font-size: 21px;
  font-weight: 750;
  letter-spacing: -1px;
}

.brand span {
  color: #b88aee;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.login-brand {
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(32px, 8vw, 100px);
  background:
    radial-gradient(
      circle at 80% 20%,
      #7732a9,
      transparent 45%
    ),
    #20142e;
}

.login-brand h1 {
  font-size: clamp(34px, 4vw, 56px);
  line-height: 1.1;
  letter-spacing: -2px;
  margin: 40px 0 16px;
}

.login-brand p {
  color: #d8cbe6;
  max-width: 440px;
  font-size: 17px;
}

.login-content {
  display: grid;
  place-items: center;
  padding: 30px;
}

.login-card {
  width: 100%;
  max-width: 410px;
}

.login-card h2 {
  font-size: 30px;
  margin: 0;
  letter-spacing: -1px;
}

.muted {
  color: var(--muted);
}

.field {
  margin: 20px 0;
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.field input {
  display: block;
  width: 100%;
  padding: 13px 14px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: white;
}

.field input:focus {
  border-color: var(--primary);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  background: var(--primary);
  color: white;
  border: 0;
  border-radius: 9px;
  font-weight: 600;
}

.button:hover {
  background: var(--primary-dark);
}

.button.full {
  width: 100%;
}

.button.secondary {
  background: #f0eaf7;
  color: var(--primary-dark);
}

.alert {
  padding: 13px;
  border-radius: 9px;
  background: #fff0f1;
  color: var(--danger);
  margin: 20px 0;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 28px 16px 18px;
  background: var(--sidebar);
  color: #fff;
}

.sidebar .brand {
  padding-left: 12px;
}

.nav-label {
  color: #9d88b2;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  margin: 34px 12px 12px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  color: #d2c4e0;
  border-radius: 9px;
  margin-bottom: 4px;
}

.nav-link svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}

.nav-link:hover {
  background: #ffffff10;
  color: white;
}

.nav-link.active {
  background: #7438ad;
  color: white;
  font-weight: 600;
}

.sidebar-bottom {
  margin-top: auto;
}

.profile {
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid #ffffff18;
  padding: 18px 10px;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #7746a6;
  color: white;
  font-weight: 700;
  flex-shrink: 0;
}

.profile small {
  display: block;
  color: #b6a3c9;
}

.logout {
  width: 100%;
  color: #e4d9ed;
  background: transparent;
  border: 1px solid #ffffff20;
  border-radius: 8px;
  padding: 10px;
}

.workspace {
  min-width: 0;
}

.topbar {
  min-height: 72px;
  background: white;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  gap: 15px;
}

.content {
  max-width: 1500px;
  margin: auto;
  padding: 32px;
}

.page-heading {
  margin-bottom: 28px;
}

.page-heading h1 {
  font-size: 29px;
  letter-spacing: -1px;
  margin: 0 0 5px;
}

.page-heading p {
  margin: 0;
  color: var(--muted);
}

.stats {
  display: grid;
  grid-template-columns:
    repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 22px;
  box-shadow: 0 3px 12px #30204004;
}

.stat {
  margin: 0;
}

.stat-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--primary);
  background: var(--primary-light);
  margin-bottom: 16px;
}

.stat-icon svg {
  width: 20px;
  height: 20px;
}

.stat-label {
  color: var(--muted);
}

.stat-value {
  font-size: 32px;
  font-weight: 750;
  letter-spacing: -1px;
  margin-top: 4px;
}

.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.card-heading h2 {
  font-size: 17px;
  margin: 0;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  white-space: nowrap;
}

th {
  padding: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: #faf9fc;
}

td {
  padding: 16px 12px;
  border-bottom: 1px solid var(--border);
}

tr:last-child td {
  border-bottom: 0;
}

.cell-title {
  font-weight: 650;
}

.cell-detail {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 20px;
  background: #efedf2;
  color: #736780;
  font-size: 11px;
  font-weight: 650;
}

.badge.success {
  background: #e6f6ec;
  color: var(--success);
}

.badge.warning {
  background: #fff4dc;
  color: #99620e;
}

.badge.danger {
  background: #ffebee;
  color: var(--danger);
}

.two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.status-row {
  padding: 12px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.status-row:last-child {
  border-bottom: 0;
}

.empty {
  padding: 30px;
  text-align: center;
  color: var(--muted);
}

.footer {
  color: var(--muted);
  font-size: 12px;
  margin-top: 25px;
}

.mobile-menu {
  display: none;
}

@media (max-width: 1050px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .two-columns {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

@media (max-width: 760px) {
  .login-page {
    grid-template-columns: 1fr;
  }

  .login-brand {
    padding: 32px;
  }

  .login-brand h1 {
    font-size: 32px;
    margin-top: 24px;
  }

  .login-brand p {
    font-size: 14px;
  }

  .login-content {
    padding: 34px 24px;
  }

  .app {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .mobile-menu {
    display: block;
    background: white;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
  }

  .mobile-menu summary {
    cursor: pointer;
    font-weight: 650;
  }

  .mobile-menu .nav-link {
    color: var(--text);
    margin-top: 4px;
  }

  .mobile-menu .nav-link.active {
    background: var(--primary-light);
    color: var(--primary);
  }

  .mobile-menu .logout {
    color: var(--text);
    border-color: var(--border);
  }

  .topbar {
    min-height: 58px;
    padding: 12px 18px;
  }

  .content {
    padding: 20px 14px;
  }

  .stats {
    gap: 10px;
  }

  .card {
    padding: 16px;
  }

  .stat-value {
    font-size: 26px;
  }

  .page-heading h1 {
    font-size: 24px;
  }
}


/* KEVIBE MANAGEMENT V1 */

.management-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.project-card {
  margin: 0;
  transition: box-shadow .2s, border-color .2s;
}

.project-card:hover {
  border-color: #cbb4df;
  box-shadow: 0 8px 28px #4020600c;
}

.project-card h2 {
  font-size: 20px;
  margin: 8px 0;
}

.project-symbol,
.upload-symbol {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 750;
  font-size: 20px;
  color: var(--primary);
  background: var(--primary-light);
}

.project-domain {
  overflow-wrap: anywhere;
  font-size: 12px;
}

.project-info {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.project-info span {
  color: var(--muted);
}

.project-card .button {
  margin-top: 15px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 22px;
}

.management-form .field {
  margin: 10px 0 18px;
}

.field select,
.field textarea {
  display: block;
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
  border-radius: 9px;
  font: inherit;
}

.field textarea {
  resize: vertical;
}

.field input[readonly] {
  background: #f7f6fa;
  color: var(--muted);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin-top: 24px;
}

.domain-input {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
}

.domain-input input {
  min-width: 0;
  flex: 1;
  border: 0;
  border-radius: 0;
}

.domain-input span {
  padding: 12px;
  background: #f4f1f7;
  font-size: 12px;
  color: var(--muted);
}

.notice {
  padding: 14px 18px;
  border-radius: 10px;
  color: #16834b;
  background: #e6f6ec;
  margin-bottom: 20px;
}

.detail-stat {
  font-size: 23px;
  font-weight: 750;
  margin-top: 8px;
  overflow-wrap: anywhere;
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 35px 18px;
  gap: 10px;
  border: 2px dashed #d7c8e5;
  border-radius: 12px;
  background: #fcfaff;
}

.button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.status-row strong {
  text-align: right;
  overflow-wrap: anywhere;
  min-width: 0;
}

@media (max-width: 760px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .management-bar {
    flex-wrap: wrap;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-wrap: wrap;
  }

  .detail-stat {
    font-size: 19px;
  }
}

/* KEVIBE STORAGE V1 */

.upload-placeholder input[type="file"] {
  display: block;
  max-width: 100%;
  padding: 12px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 9px;
}

.upload-placeholder progress {
  width: 100%;
  max-width: 440px;
  height: 12px;
  accent-color: var(--primary);
}

[data-upload-message] {
  overflow-wrap: anywhere;
  color: var(--muted);
}

.file-path {
  font-family: ui-monospace, monospace;
  font-size: 12px;
}


/* KEVIBE FILE MANAGER V2 */

.file-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.file-toolbar input {
  flex: 1;
  min-width: 150px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
}

.file-breadcrumb {
  background: #f7f5fa;
  color: var(--primary-dark);
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-family: ui-monospace, monospace;
  overflow-wrap: anywhere;
}

.file-entry {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  color: var(--text);
  background: transparent;
  border: 0;
  font-weight: 550;
}

button.file-entry:hover {
  color: var(--primary);
}

.folder-icon {
  font-size: 20px;
}

.document-icon {
  font-size: 20px;
  color: var(--primary);
}

.file-table tbody tr:hover {
  background: #faf8fc;
}

.file-table tr[hidden] {
  display: none;
}

.technology-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

@media (max-width: 760px) {
  .file-toolbar input {
    flex-basis: 100%;
  }
}


/* KEVIBE DEPLOYMENTS V1 */

.deployment-node {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(128,128,128,.20);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}

.deployment-node-symbol {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 12px;
  background: rgba(124,58,237,.12);
  color: #8b5cf6;
  font-size: 12px;
  font-weight: 800;
}

.deployment-node-info {
  flex: 1;
  min-width: 0;
}

.deployment-node-info strong,
.deployment-node-info small {
  display: block;
}

.deployment-node-info small {
  opacity: .65;
  margin-top: 4px;
}

.deployment-state {
  display: inline-flex;
  align-items: center;
  border-radius: 20px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.deployment-state.positive {
  background: rgba(22,163,74,.12);
  color: #16a34a;
}

.deployment-state.neutral {
  background: rgba(128,128,128,.12);
}

.deployment-state.negative {
  background: rgba(220,38,38,.12);
  color: #dc2626;
}

.deployment-privacy {
  background: rgba(124,58,237,.06);
  border: 1px solid rgba(124,58,237,.18);
  padding: 16px;
  border-radius: 10px;
  margin: 16px 0;
}

.deployment-privacy p {
  font-size: 13px;
  line-height: 1.6;
  margin: 6px 0 0;
  opacity: .8;
}

.deployment-form button:disabled {
  opacity: .45;
  cursor: not-allowed;
}
