* {
  box-sizing: border-box;
}

:root {
  --navy: #10233f;
  --blue: #2867d8;
  --blue-light: #eef5ff;
  --bg: #f5f7fb;
  --border: #e4e9f1;
  --text: #172033;
  --muted: #738096;
  --white: #ffffff;
  --danger: #c43d4b;
}

body {
  margin: 0;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: var(--bg);
  color: var(--text);
}

.hidden {
  display: none !important;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

/* LOGIN */

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top right, #dbeaff, transparent 35%),
    linear-gradient(135deg, #f8fbff, #eef3fa);
}

.login-card {
  width: 100%;
  max-width: 430px;
  background: white;
  padding: 38px;
  border-radius: 22px;
  box-shadow: 0 20px 60px rgba(24, 45, 80, .12);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--blue);
  color: white;
  font-size: 23px;
  font-weight: 800;
}

.brand h1 {
  margin: 0;
  font-size: 23px;
}

.brand span {
  font-size: 12px;
  color: var(--muted);
}

.login-card h2 {
  margin-top: 40px;
  margin-bottom: 6px;
}

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

label {
  display: block;
  margin: 20px 0 7px;
  font-size: 13px;
  font-weight: 600;
}

input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
}

input:focus {
  border-color: var(--blue);
}

.primary {
  border: 0;
  border-radius: 10px;
  background: var(--blue);
  color: white;
  font-weight: 600;
  padding: 13px 18px;
}

.login-card .primary {
  width: 100%;
  margin-top: 24px;
}

.error {
  color: var(--danger);
  margin-top: 15px;
  font-size: 14px;
}

/* DASHBOARD */

.dashboard {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  width: 245px;
  height: 100vh;
  background: var(--navy);
  color: white;
  padding: 26px 18px;
  display: flex;
  flex-direction: column;
}

.sidebar-brand .logo {
  background: white;
  color: var(--blue);
}

.sidebar-brand span {
  color: #9fb0c7;
}

nav {
  margin-top: 45px;
}

.nav-item {
  width: 100%;
  text-align: left;
  padding: 13px;
  border: 0;
  border-radius: 9px;
  color: #cbd7e7;
  background: transparent;
}

.nav-item.active {
  color: white;
  background: rgba(255,255,255,.10);
}

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

.user-email {
  font-size: 12px;
  color: #aebed2;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logout {
  margin-top: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: white;
}

.main {
  margin-left: 245px;
  width: calc(100% - 245px);
  padding: 38px 45px;
  max-width: 1500px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar h2 {
  margin: 0;
}

.topbar p {
  color: var(--muted);
  margin: 5px 0 0;
}

.storage-card {
  margin-top: 35px;
  padding: 25px;
  background: white;
  border-radius: 15px;
  border: 1px solid var(--border);
}

.storage-header {
  display: flex;
  justify-content: space-between;
}

.storage-title {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 5px;
}

.storage-percent {
  color: var(--blue);
  font-weight: 700;
}

.progress {
  height: 8px;
  margin-top: 18px;
  background: #edf1f7;
  border-radius: 20px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: var(--blue);
  transition: width .3s;
}

.drop-zone {
  margin-top: 25px;
  padding: 40px;
  border: 2px dashed #ccd6e4;
  border-radius: 15px;
  text-align: center;
  background: rgba(255,255,255,.55);
  transition: .2s;
  cursor: pointer;
}

.drop-zone.drag {
  border-color: var(--blue);
  background: var(--blue-light);
}

.cloud-icon {
  font-size: 38px;
}

.drop-zone h3 {
  margin-bottom: 4px;
}

.drop-zone p {
  color: var(--muted);
  margin-top: 0;
}

.files-section {
  margin-top: 35px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-header span {
  color: var(--muted);
  font-size: 13px;
}

.files-list {
  margin-top: 15px;
}

.file-row {
  display: grid;
  grid-template-columns: 1fr 130px 160px;
  gap: 15px;
  align-items: center;
  padding: 17px 20px;
  background: white;
  border-bottom: 1px solid var(--border);
}

.file-row:first-child {
  border-radius: 12px 12px 0 0;
}

.file-row:last-child {
  border-radius: 0 0 12px 12px;
  border-bottom: 0;
}

.file-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-size {
  color: var(--muted);
  font-size: 13px;
}

.file-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.action {
  border: 1px solid var(--border);
  background: white;
  border-radius: 8px;
  padding: 7px 10px;
}

.delete {
  color: var(--danger);
}

.empty-state {
  margin-top: 15px;
  padding: 60px 20px;
  background: white;
  border-radius: 15px;
  text-align: center;
  color: var(--muted);
}

.empty-icon {
  font-size: 42px;
}

.empty-state h3 {
  color: var(--text);
}

.toast {
  position: fixed;
  right: 25px;
  bottom: 25px;
  padding: 14px 18px;
  background: var(--navy);
  color: white;
  border-radius: 10px;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: .2s;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 800px) {
  .sidebar {
    display: none;
  }

  .main {
    margin-left: 0;
    width: 100%;
    padding: 24px 18px;
  }

  .topbar {
    align-items: flex-start;
    gap: 15px;
  }

  .upload-button {
    white-space: nowrap;
  }

  .file-row {
    grid-template-columns: 1fr;
  }

  .file-actions {
    justify-content: flex-start;
  }
}

/* NextData BETA */
.app-brand-name {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-brand-name h1 {
  margin: 0;
}

.beta-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: .08em;
  color: #fff;
  background: #f59e0b;
}

/* ----------------------------------------------------------
   NextData Security / 2FA
---------------------------------------------------------- */

.security-card {
  max-width: 720px;
  background: #fff;
  border: 1px solid #e6eaf0;
  border-radius: 18px;
  padding: 28px;
  margin-top: 24px;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.05);
}

.security-heading {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 26px;
}

.security-heading h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.security-heading p {
  margin: 0;
  color: #64748b;
  line-height: 1.6;
}

.security-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #eef4ff;
  font-size: 24px;
}

.security-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0;
  margin-bottom: 20px;
  border-top: 1px solid #edf0f4;
  border-bottom: 1px solid #edf0f4;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
}

.status-on {
  background: #e8f7ee;
  color: #18743b;
}

.status-off {
  background: #f1f3f6;
  color: #667085;
}

.security-description {
  color: #64748b;
  line-height: 1.6;
  margin-bottom: 20px;
}

.security-success {
  padding: 16px 18px;
  border-radius: 12px;
  background: #edf9f1;
  color: #176b38;
  font-weight: 600;
  line-height: 1.5;
}

.setup-divider {
  height: 1px;
  background: #edf0f4;
  margin: 28px 0;
}

.qr-wrapper {
  display: inline-flex;
  padding: 16px;
  background: #fff;
  border: 1px solid #e1e6ed;
  border-radius: 16px;
  margin: 8px 0 20px;
}

.totp-qr {
  display: block;
  width: 220px;
  max-width: 100%;
  height: auto;
}

.manual-key-label {
  color: #64748b;
  margin-bottom: 8px;
}

.totp-secret {
  display: block;
  max-width: 100%;
  padding: 12px 14px;
  margin-bottom: 22px;
  border-radius: 10px;
  background: #f5f7fa;
  border: 1px solid #e4e8ee;
  font-family: monospace;
  font-size: 14px;
  letter-spacing: .06em;
  overflow-wrap: anywhere;
  user-select: all;
}

.totp-code-input {
  max-width: 220px;
  font-size: 22px;
  letter-spacing: .25em;
  text-align: center;
}

.security-card label {
  display: block;
  margin: 16px 0 7px;
  font-weight: 600;
}

.security-card input {
  width: 100%;
  box-sizing: border-box;
}

.security-card .primary,
.security-card .secondary,
.security-card .danger-button {
  margin-top: 14px;
  margin-right: 8px;
}

.danger-button {
  border: 0;
  border-radius: 10px;
  padding: 11px 18px;
  background: #b42318;
  color: white;
  cursor: pointer;
  font-weight: 600;
}

.danger-button:hover {
  opacity: .92;
}

.danger-button:disabled,
.primary:disabled {
  opacity: .55;
  cursor: wait;
}

@media (max-width: 700px) {
  .security-card {
    padding: 20px;
  }

  .security-heading {
    flex-direction: column;
  }

  .totp-qr {
    width: 190px;
  }
}

