/* ============================================================
   POD OS — application styles
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html, body { height: 100%; }

body {
  font-family: var(--font);
  font-size: var(--fs);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }
::selection { background: rgba(99, 102, 241, 0.3); }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-xs); }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--text-muted); background-clip: content-box; }

/* ---------------- App shell ---------------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  min-height: 0;
  z-index: 30;
}
.sidebar__brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 14px;
  font-weight: 800; font-size: var(--fs-lg); letter-spacing: -0.02em;
}
.sidebar__logo {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--brand-gradient);
  display: grid; place-items: center; color: #fff; font-weight: 800;
  box-shadow: var(--shadow-glow);
}
.sidebar__nav { padding: 6px 12px; overflow-y: auto; flex: 1; min-height: 0; }
.nav-section { margin: 14px 8px 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: var(--r-sm);
  color: var(--text-2); font-weight: 500;
  transition: background var(--speed) var(--ease), color var(--speed) var(--ease);
  position: relative; width: 100%; text-align: left; border: none; background: none;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: var(--surface-hover); color: var(--text); transform: translateX(3px); }
.nav-item.active { background: var(--brand-soft); color: var(--brand-strong); font-weight: 600; box-shadow: inset 3px 0 0 var(--brand); }
[data-theme='dark'] .nav-item.active { color: #c7cdff; }
.nav-item.active::before {
  display: none;
}
.nav-badge { margin-left: auto; font-size: 11px; background: var(--bg-elev); color: var(--text-2); padding: 1px 7px; border-radius: var(--r-pill); font-weight: 600; }

.sidebar__foot { padding: 12px; border-top: 1px solid var(--border); }
.credit-card {
  background: var(--surface-glass);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-strong);
  color: var(--text); border-radius: var(--r); padding: 14px 16px;
  box-shadow: var(--shadow);
}
[data-theme='dark'] .credit-card {
  background: rgba(255,255,255,0.03); border: 1px solid rgba(168, 85, 247, 0.3); color: #fff; box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.credit-card__label { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent); opacity: 0.8; }
[data-theme='dark'] .credit-card__label { color: #d8b4fe; }
.credit-card__value { font-size: 26px; font-weight: 800; line-height: 1.15; margin-top: 2px; text-shadow: 0 2px 10px rgba(0,0,0,0.5); }
.credit-card__bar { height: 4px; background: var(--bg-elev); border-radius: 999px; margin-top: 10px; overflow: hidden; }
[data-theme='dark'] .credit-card__bar { background: rgba(255,255,255,0.1); }
.credit-card__bar > i { display: block; height: 100%; background: linear-gradient(90deg, #ec4899, #8b5cf6); border-radius: 999px; box-shadow: 0 0 10px rgba(139, 92, 246, 0.5); }
.credit-card__btn { margin-top: 14px; width: 100%; background: var(--surface-hover); color: var(--text); border: 1px solid var(--border); padding: 8px; border-radius: var(--r-sm); font-weight: 600; font-size: var(--fs-sm); transition: all var(--speed); cursor: pointer; }
[data-theme='dark'] .credit-card__btn { background: rgba(255,255,255,0.05); color: #fff; border: 1px solid rgba(255,255,255,0.1); }
.credit-card__btn:hover { background: var(--border); border-color: var(--border-strong); transform: translateY(-1px); }
[data-theme='dark'] .credit-card__btn:hover { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.3); }

/* Main column */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.topbar {
  height: var(--topbar-h); flex-shrink: 0;
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px; border-bottom: 1px solid var(--border-glass);
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky; top: 0; z-index: 20;
}
.topbar__title { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -0.02em; }
.topbar__sub { font-size: var(--fs-sm); color: var(--text-muted); font-weight: 500; }
.topbar__spacer { flex: 1; }
.topbar__actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: var(--r-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); display: grid; place-items: center;
  transition: all var(--speed) var(--ease);
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text); border-color: var(--border-strong); }
.icon-btn svg { width: 18px; height: 18px; }
.credit-pill {
  display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px;
  border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--border);
  font-weight: 700; font-size: var(--fs-sm); transition: all var(--speed);
}
.credit-pill:hover { border-color: var(--brand); }
.credit-pill svg { width: 15px; height: 15px; color: var(--brand); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: var(--fs-sm); }

.menu-toggle { display: none; }

/* Content area */
.content { flex: 1; overflow-y: auto; min-height: 0; scroll-behavior: smooth; }
.view { padding: 26px 28px 60px; max-width: 1320px; margin: 0 auto; animation: viewIn 280ms var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.section { margin-top: 30px; }
.section__head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.section__title { font-size: var(--fs-lg); font-weight: 700; letter-spacing: -0.01em; }
.section__head .btn, .section__head a.link { margin-left: auto; }
.link { color: var(--brand); font-weight: 600; font-size: var(--fs-sm); }
.muted { color: var(--text-muted); }
.text-2 { color: var(--text-2); }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--r-sm);
  border: 1px solid var(--border-glass); background: var(--surface-glass); color: var(--text);
  font-weight: 600; font-size: var(--fs); white-space: nowrap;
  transition: all var(--speed) var(--ease);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
[data-theme='dark'] .btn { background: rgba(255,255,255,0.05); }
.btn svg { width: 17px; height: 17px; }
.btn:hover { background: var(--surface-hover); border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
[data-theme='dark'] .btn:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); box-shadow: 0 4px 15px rgba(0,0,0,0.2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary { 
  background: linear-gradient(135deg, rgba(99,102,241,0.8), rgba(168,85,247,0.8)); 
  border: 1px solid rgba(255,255,255,0.2); color: #fff; 
  box-shadow: 0 4px 20px rgba(99,102,241,0.4); 
}
.btn-primary:hover { background: linear-gradient(135deg, rgba(99,102,241,0.9), rgba(168,85,247,0.9)); border-color: rgba(255,255,255,0.4); box-shadow: 0 8px 25px rgba(99,102,241,0.5); transform: translateY(-2px); }
.btn-accent { background: linear-gradient(135deg, rgba(168,85,247,0.8), rgba(236,72,153,0.8)); border: 1px solid rgba(255,255,255,0.2); color: #fff; box-shadow: 0 4px 20px rgba(168,85,247,0.4); }
.btn-accent:hover { background: linear-gradient(135deg, rgba(168,85,247,0.9), rgba(236,72,153,0.9)); border-color: rgba(255,255,255,0.4); box-shadow: 0 8px 25px rgba(168,85,247,0.5); transform: translateY(-2px); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-hover); }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 16%, var(--surface)); }
.btn-sm { height: 32px; padding: 0 11px; font-size: var(--fs-sm); border-radius: var(--r-xs); }
.btn-sm svg { width: 15px; height: 15px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: var(--fs-md); }
.btn-block { width: 100%; }

/* ---------------- Cards ---------------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  box-shadow: var(--shadow-sm); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.card-pad { padding: 18px; }
.card-hover { transition: transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease), border-color var(--speed); }
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--brand); }

.grid { display: grid; gap: 16px; }
.grid-stats { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid-tiles { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }

/* Stat card */
.stat { display: flex; flex-direction: column; gap: 6px; padding: 18px; }
.stat__top { display: flex; align-items: center; justify-content: space-between; }
.stat__icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-strong); box-shadow: var(--shadow-glow); }
[data-theme='dark'] .stat__icon { color: #c7cdff; box-shadow: var(--shadow-glow); }
.stat__icon svg { width: 19px; height: 19px; }
.stat__value { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -0.02em; }
.stat__label { font-size: var(--fs-sm); color: var(--text-muted); font-weight: 500; }

/* Quick action tiles */
.qa { display: flex; align-items: center; gap: 14px; padding: 16px 18px; text-align: left; width: 100%; }
.qa__icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.qa__icon svg { width: 21px; height: 21px; }
.qa__title { font-weight: 700; font-size: var(--fs-md); }
.qa__desc { font-size: var(--fs-sm); color: var(--text-muted); }
.qa__arrow { margin-left: auto; color: var(--text-muted); transition: transform var(--speed); }
.qa:hover .qa__arrow { transform: translateX(5px); color: var(--brand); }

/* ---------------- Inputs ---------------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 13px; font: inherit; font-size: var(--fs);
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  transition: border-color var(--speed), box-shadow var(--speed), transform var(--speed);
}
.textarea { height: auto; padding: 10px 13px; resize: vertical; min-height: 84px; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: var(--ring); outline: none; transform: translateY(-1px); }
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
input[type='range'] { -webkit-appearance: none; appearance: none; width: 100%; height: 5px; border-radius: 999px; background: var(--border-strong); outline: none; }
input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: 17px; height: 17px; border-radius: 50%; background: var(--brand); cursor: pointer; box-shadow: var(--shadow-sm); border: 2px solid var(--surface); }
input[type='color'] { -webkit-appearance: none; appearance: none; width: 40px; height: 40px; padding: 0; border: 1px solid var(--border); border-radius: var(--r-sm); background: none; cursor: pointer; }
input[type='color']::-webkit-color-swatch-wrapper { padding: 4px; }
input[type='color']::-webkit-color-swatch { border: none; border-radius: 7px; }

/* Segmented control */
.segmented { display: inline-flex; background: var(--bg-elev); border-radius: var(--r-sm); padding: 3px; gap: 2px; flex-wrap: wrap; }
.segmented button { padding: 7px 13px; border-radius: var(--r-xs); border: none; background: none; font-weight: 600; font-size: var(--fs-sm); color: var(--text-2); transition: all var(--speed); }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* Chips */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--surface); font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); transition: all var(--speed); cursor: pointer; user-select: none; }
.chip:hover { border-color: var(--border-strong); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: var(--r-pill); font-size: 11px; font-weight: 700; letter-spacing: 0.02em; }
.badge-success { background: color-mix(in srgb, var(--success) 16%, transparent); color: var(--success); }
.badge-warning { background: color-mix(in srgb, var(--warning) 18%, transparent); color: var(--warning); }
.badge-muted { background: var(--bg-elev); color: var(--text-muted); }
.badge-brand { background: var(--brand-soft); color: var(--brand-strong); }
.badge-danger { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------------- Asset tiles / gallery ---------------- */
.tile {
  position: relative; border-radius: var(--r); overflow: hidden; border: 1px solid var(--border);
  background: var(--surface); transition: all var(--speed) var(--ease); cursor: pointer;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.tile:hover { border-color: var(--brand); box-shadow: var(--shadow-lg); transform: translateY(-4px) scale(1.01); }
.tile__img { aspect-ratio: 1; background: var(--checker), var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.tile__img img { width: 100%; height: 100%; object-fit: contain; }
.tile__meta { padding: 9px 11px; display: flex; align-items: center; gap: 8px; }
.tile__name { font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile__kind { font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); font-weight: 700; }
.tile__actions { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; opacity: 0; transform: translateY(-4px); transition: all var(--speed); }
.tile:hover .tile__actions { opacity: 1; transform: none; }
.tile__act { width: 30px; height: 30px; border-radius: 8px; background: rgba(15,23,42,0.7); color: #fff; display: grid; place-items: center; border: none; backdrop-filter: blur(4px); }
.tile__act:hover { background: var(--brand); }
.tile__act svg { width: 15px; height: 15px; }
.tile__check { position: absolute; top: 8px; left: 8px; width: 24px; height: 24px; border-radius: 7px; border: 2px solid #fff; background: rgba(15,23,42,0.4); display: grid; place-items: center; opacity: 0; transition: all var(--speed); }
.tile:hover .tile__check, .tile.selected .tile__check { opacity: 1; }
.tile.selected { border-color: var(--brand); box-shadow: var(--ring); }
.tile.selected .tile__check { background: var(--brand); border-color: var(--brand); }
.tile__check svg { width: 14px; height: 14px; color: #fff; }

/* ---------------- Dropzone ---------------- */
.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--r-lg); padding: 38px 24px;
  text-align: center; background: var(--surface-2); transition: all var(--speed) var(--ease); cursor: pointer;
}
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: var(--brand-soft); box-shadow: var(--shadow-glow); transform: scale(1.02); }
.dropzone__icon { width: 54px; height: 54px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); display: grid; place-items: center; margin: 0 auto 14px; color: var(--brand); box-shadow: var(--shadow-sm); }
.dropzone__icon svg { width: 24px; height: 24px; }
.dropzone__title { font-weight: 700; font-size: var(--fs-md); }
.dropzone__hint { color: var(--text-muted); font-size: var(--fs-sm); margin-top: 4px; }

/* ---------------- Empty state ---------------- */
.empty { text-align: center; padding: 52px 24px; color: var(--text-muted); }
.empty__icon { width: 60px; height: 60px; border-radius: 18px; background: var(--bg-elev); display: grid; place-items: center; margin: 0 auto 16px; color: var(--text-muted); }
.empty__icon svg { width: 28px; height: 28px; }
.empty__title { font-size: var(--fs-lg); font-weight: 700; color: var(--text); }
.empty__text { margin: 6px auto 18px; max-width: 380px; font-size: var(--fs); }

/* ---------------- Progress / spinner ---------------- */
.progress { height: 8px; background: var(--bg-elev); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); border-radius: 999px; transition: width 300ms var(--ease); }
.spinner { width: 18px; height: 18px; border: 2.5px solid var(--border-strong); border-top-color: var(--brand); border-radius: 50%; animation: spin 0.7s linear infinite; }
.spinner-lg { width: 34px; height: 34px; border-width: 3.5px; }
@keyframes spin { to { transform: rotate(360deg); } }
.shimmer { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-hover) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--r-sm); }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ---------------- Modal ---------------- */
.overlay { position: fixed; inset: 0; background: rgba(8, 11, 18, 0.4); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); display: grid; place-items: center; z-index: 100; padding: 20px; animation: fade 160ms var(--ease); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { background: var(--surface-glass); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid var(--border-glass); border-radius: var(--r-lg); width: 100%; max-width: 520px; max-height: 88vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg), 0 0 40px rgba(0,0,0,0.1); animation: pop 250ms var(--ease); overflow: hidden; }
.modal-lg { max-width: 860px; }
.modal-xl { max-width: 1100px; }
@keyframes pop { from { opacity: 0; transform: scale(0.92) translateY(12px); } to { opacity: 1; transform: none; } }
.modal__head { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal__title { font-size: var(--fs-lg); font-weight: 700; }
.modal__body { padding: 20px; overflow-y: auto; }
.modal__foot { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }
.modal__x { margin-left: auto; }

/* ---------------- Toasts ---------------- */
#toasts { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.toast { display: flex; align-items: flex-start; gap: 11px; padding: 13px 15px; background: var(--surface-glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--border-glass); border-radius: var(--r); box-shadow: var(--shadow-lg); animation: toastIn 300ms var(--ease); }
.toast.out { animation: toastOut 220ms var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }
.toast__icon { width: 22px; height: 22px; flex-shrink: 0; display: grid; place-items: center; border-radius: 6px; }
.toast__icon svg { width: 16px; height: 16px; }
.toast--success .toast__icon { color: var(--success); }
.toast--error .toast__icon { color: var(--danger); }
.toast--info .toast__icon { color: var(--info); }
.toast__msg { font-size: var(--fs-sm); font-weight: 500; padding-top: 1px; }
.toast__title { font-weight: 700; font-size: var(--fs-sm); }

/* ---------------- Dropdown menu ---------------- */
.menu { position: absolute; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 6px; min-width: 200px; z-index: 120; animation: pop 140ms var(--ease); }
.menu__item { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: var(--r-xs); font-size: var(--fs); font-weight: 500; width: 100%; border: none; background: none; text-align: left; color: var(--text); }
.menu__item:hover { background: var(--surface-hover); }
.menu__item svg { width: 16px; height: 16px; color: var(--text-2); }
.menu__sep { height: 1px; background: var(--border); margin: 5px 0; }

/* ---------------- Tabs ---------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.tab { padding: 10px 14px; font-weight: 600; font-size: var(--fs-sm); color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; border-top: none; border-left: none; border-right: none; }
.tab.active { color: var(--brand-strong); border-bottom-color: var(--brand); }
[data-theme='dark'] .tab.active { color: #c7cdff; }

/* ============================================================
   Editor
   ============================================================ */
.editor { position: fixed; inset: 0; display: grid; grid-template-rows: 56px 1fr; background: var(--bg); z-index: 5; }
.editor__bar { display: flex; align-items: center; gap: 10px; padding: 0 14px; background: var(--surface); border-bottom: 1px solid var(--border); }
.editor__name { font-weight: 700; font-size: var(--fs-md); border: 1px solid transparent; background: none; color: var(--text); padding: 5px 8px; border-radius: var(--r-xs); max-width: 240px; }
.editor__name:hover { border-color: var(--border); }
.editor__name:focus { border-color: var(--brand); background: var(--surface); outline: none; }
.editor__save { font-size: var(--fs-xs); color: var(--text-muted); display: flex; align-items: center; gap: 6px; font-weight: 600; }
.editor__body { display: grid; grid-template-columns: 220px 1fr 296px; min-height: 0; }

/* ---- Left elements panel ---- */
.ed-left { background: var(--surface); border-right: 1px solid var(--border); overflow-y: auto; display: flex; flex-direction: column; min-height: 0; }
.ed-left__section { padding: 14px 12px; border-bottom: 1px solid var(--border); }
.ed-left__title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; color: var(--text-muted); margin-bottom: 10px; }
.ed-tools-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ed-tool-btn { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 12px 6px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface-2); font: inherit; font-size: 11px; font-weight: 600; color: var(--text-2); cursor: pointer; transition: all var(--speed) var(--ease); }
.ed-tool-btn:hover { background: var(--brand-soft); color: var(--brand-strong); border-color: var(--brand); }
.ed-tool-btn svg { width: 20px; height: 20px; }
.ed-photo-tray { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 8px; }
.ed-photo-tile { aspect-ratio: 1; border-radius: var(--r-xs); overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; padding: 0; transition: border-color var(--speed); }
.ed-photo-tile:hover { border-color: var(--brand); }
.ed-photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.ed-font-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.ed-font-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: var(--r-xs); background: var(--surface-2); border: 1px solid var(--border); font-size: var(--fs-sm); }

/* ---- Center canvas area ---- */
.ed-center { display: flex; flex-direction: column; background: var(--bg-elev); overflow: hidden; min-height: 0; position: relative; }
.artboard-tabs { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: var(--surface-glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--border-glass); overflow-x: auto; flex-shrink: 0; }
.ab-tab { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: var(--r-xs); border: 1px solid var(--border); background: var(--surface); font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); white-space: nowrap; }
.ab-tab.active { background: var(--brand-soft); color: var(--brand-strong); border-color: var(--brand); }
.ab-tab__del { opacity: 0.5; }
.ab-tab__del:hover { opacity: 1; color: var(--danger); }
.ed-canvas-wrap { flex: 1; overflow: hidden; position: relative; min-height: 0; }
.ed-canvas-wrap canvas { background: transparent !important; }
.ed-canvas-wrap .canvas-container { position: absolute !important; top: 0; left: 0; width: 100% !important; height: 100% !important; }
.zoom-bar { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; z-index: 10; background: var(--surface-glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--border-glass); border-radius: var(--r-pill); padding: 5px 10px; box-shadow: var(--shadow-lg); white-space: nowrap; }
.zoom-btn { display: flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: var(--r-xs); border: none; background: none; color: var(--text-2); font: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; transition: all var(--speed); }
.zoom-btn:hover { background: var(--surface-hover); color: var(--text); }
.zoom-btn svg { width: 16px; height: 16px; }
.zoom-pct { font-size: var(--fs-sm); font-weight: 700; color: var(--text); min-width: 48px; text-align: center; }

/* ---- Right properties/layers panel ---- */
.ed-right { background: var(--surface); border-left: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.ed-layers-wrap, .ed-props-wrap { flex: 1; overflow-y: auto; min-height: 0; }
.ed-layers-empty { padding: 20px; text-align: center; color: var(--text-muted); font-size: var(--fs-sm); }
.ed-layer-list { padding: 6px; }
.panel-sec { padding: 14px 15px; border-bottom: 1px solid var(--border); }
.panel-sec__title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; color: var(--text-muted); margin-bottom: 11px; display: flex; align-items: center; gap: 8px; }
.panel-row { display: flex; gap: 8px; align-items: center; margin-bottom: 9px; }
.panel-row .field { flex: 1; }
.mini-label { font-size: 11px; color: var(--text-muted); font-weight: 600; margin-bottom: 3px; }
.input-mini { height: 34px; font-size: var(--fs-sm); padding: 0 9px; }
.layer-item { display: flex; align-items: center; gap: 9px; padding: 8px 9px; border-radius: var(--r-xs); cursor: pointer; transition: background var(--speed); }
.layer-item:hover { background: var(--surface-hover); }
.layer-item.active { background: var(--brand-soft); }
.layer-item__thumb { width: 30px; height: 30px; border-radius: 6px; background: var(--checker), var(--bg-elev); display: grid; place-items: center; overflow: hidden; flex-shrink: 0; color: var(--text-muted); }
.layer-item__thumb img { width: 100%; height: 100%; object-fit: contain; }
.layer-item__thumb svg { width: 15px; height: 15px; }
.layer-item__name { flex: 1; font-size: var(--fs-sm); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.layer-item__btn { color: var(--text-muted); padding: 3px; border: none; background: none; border-radius: 5px; }
.layer-item__btn:hover { color: var(--text); background: var(--bg-elev); }
.layer-item__btn svg { width: 15px; height: 15px; display: block; }

/* Utility */
.row { display: flex; gap: 10px; align-items: center; }
.col { display: flex; flex-direction: column; gap: 10px; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.center { align-items: center; }
.gap-sm { gap: 6px; }
.mt { margin-top: 16px; }
.mt-sm { margin-top: 8px; }
.hide { display: none !important; }
.scroll-x { overflow-x: auto; }
.text-c { text-align: center; }
.fade-in { animation: viewIn 280ms var(--ease); }

/* ---------------- Responsive ---------------- */
@media (max-width: 1024px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); transform: translateX(-100%); transition: transform var(--speed) var(--ease); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .menu-toggle { display: grid; }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 25; animation: fade 160ms; }
  .editor__body { grid-template-columns: 0 1fr 0; }
  .ed-left { display: none; }
  .ed-right { position: fixed; right: 0; top: 56px; bottom: 0; width: 296px; transform: translateX(100%); transition: transform var(--speed); z-index: 8; box-shadow: var(--shadow-lg); }
  .ed-right.open { transform: none; }
}
@media (max-width: 640px) {
  .view { padding: 18px 16px 50px; }
  .topbar { padding: 0 14px; gap: 10px; }
  .topbar__title { font-size: var(--fs-lg); }
  .grid { gap: 12px; }
}

/* ---------------- Collapsible Sidebar ---------------- */
.app:has(.sidebar--collapsed) { grid-template-columns: 60px 1fr; }

.sidebar--collapsed .sidebar__brand { justify-content: center; padding: 18px 0 14px; }
.sidebar--collapsed .sidebar__brand > span:not(.sidebar__logo) { display: none; }
.sidebar--collapsed .nav-section { display: none; }
.sidebar--collapsed .nav-item { justify-content: center; padding: 10px 0; }
.sidebar--collapsed .nav-item span { display: none; }
.sidebar--collapsed .nav-item.active::before { display: none; }
.sidebar--collapsed .sidebar__nav { padding: 6px 4px; }
.sidebar--collapsed .credit-card { display: none; }
.sidebar--collapsed .sidebar__collapse-btn span { display: none; }
.sidebar--collapsed .sidebar__collapse-btn { justify-content: center; padding: 9px 0; }
.sidebar--collapsed .sidebar__collapse-btn svg { transform: rotate(180deg); }
.sidebar--collapsed .sidebar__collapse-wrap { padding: 8px 4px 4px; }
.sidebar--collapsed .sidebar__legal-links { display: none; }

.sidebar__collapse-wrap { padding: 8px 12px 4px; border-top: 1px solid var(--border); margin-top: 8px; }
.sidebar__collapse-btn {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 12px; border-radius: var(--r-sm); border: none; background: none;
  color: var(--text-muted); font: inherit; font-size: var(--fs-sm); font-weight: 600;
  transition: background var(--speed) var(--ease), color var(--speed) var(--ease); cursor: pointer;
}
.sidebar__collapse-btn:hover { background: var(--surface-hover); color: var(--text); }
.sidebar__collapse-btn svg { flex-shrink: 0; transition: transform var(--speed) var(--ease); }

/* ---------------- Credit Warnings ---------------- */
.credit-pill--warn { border-color: var(--warning) !important; }
.credit-pill--warn svg { color: var(--warning) !important; }
.credit-pill--danger { border-color: var(--danger) !important; animation: creditPulse 1.8s ease infinite; }
.credit-pill--danger svg { color: var(--danger) !important; }
@keyframes creditPulse {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25); }
}
.credit-card--warn { background: linear-gradient(135deg, var(--warning), #f97316) !important; }
.credit-card--danger { background: linear-gradient(135deg, var(--danger), #dc2626) !important; }

/* ---------------- Keyboard Shortcuts Modal ---------------- */
.shortcuts-grid { display: flex; flex-direction: column; gap: 10px; }
.shortcut-row { display: flex; align-items: center; gap: 14px; }
.shortcut-key {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 28px; padding: 0 8px;
  background: var(--bg-elev); border: 1px solid var(--border-strong);
  border-bottom-width: 2px; border-radius: var(--r-xs);
  font-size: var(--fs-sm); font-weight: 700; font-family: monospace; color: var(--text-2);
}

/* ============================================================
   Settings page — s-card, theme-opts, credits, AI, integrations
   ============================================================ */

/* Card with icon header */
.s-card { 
  padding: 0; overflow: hidden; 
  background: var(--surface-glass);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}
[data-theme='dark'] .s-card { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.05); box-shadow: 0 8px 30px rgba(0,0,0,0.2); }
.s-card__head {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 22px 16px; border-bottom: 1px solid var(--border-glass);
  background: var(--surface);
}
[data-theme='dark'] .s-card__head { border-bottom: 1px solid rgba(255,255,255,0.05); background: rgba(255,255,255,0.01); }
.s-card__icon {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  color: #fff; flex-shrink: 0; box-shadow: var(--shadow-sm);
}
[data-theme='dark'] .s-card__icon { box-shadow: 0 4px 14px rgba(0,0,0,.2); }
.s-card__icon svg { width: 20px; height: 20px; }
.s-card__title { font-size: var(--fs-lg); font-weight: 700; letter-spacing: -.015em; }
.s-card__sub { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 3px; line-height: 1.5; }
.s-card__body { padding: 22px; display: flex; flex-direction: column; gap: 18px; }

/* Theme selector */
.theme-opts { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.theme-opt {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 18px 12px; border-radius: var(--r); border: 2px solid var(--border);
  background: var(--surface-2); cursor: pointer; font: inherit; text-align: center;
  transition: all var(--speed) var(--ease);
}
.theme-opt:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.theme-opt.active { border-color: rgba(168,85,247,0.5); background: rgba(168,85,247,0.15); box-shadow: 0 4px 20px rgba(168,85,247,0.2); }
.theme-opt__preview { width: 52px; height: 34px; border-radius: 8px; border: 1px solid var(--border-strong); }
[data-theme='dark'] .theme-opt__preview { border: 1px solid rgba(255,255,255,0.1); }
.tp--light  { background: linear-gradient(135deg,#f6f7f9 50%,#e2e8f0 50%); }
.tp--dark   { background: linear-gradient(135deg,#0a0c11 50%,#1a1f2a 50%); }
.tp--system { background: linear-gradient(135deg,#f6f7f9 50%,#0a0c11 50%); }
.theme-opt__label { font-size: var(--fs-sm); font-weight: 700; color: var(--text); }
[data-theme='dark'] .theme-opt__label { color: #fff; }
.theme-opt__hint  { font-size: var(--fs-xs); color: var(--text-muted); }
[data-theme='dark'] .theme-opt__hint { color: rgba(255,255,255,0.6); }

/* Credit hero */
.credit-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.credit-hero__num { font-size: 44px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; color: var(--brand); }
.credit-hero__label { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 6px; }

.buy-grid { display: flex; flex-direction: column; gap: 8px; min-width: 152px; }
.buy-btn {
  position: relative; display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--r-sm); border: 1px solid var(--border-glass);
  background: var(--surface-glass); font: inherit; font-weight: 600; font-size: var(--fs-sm);
  color: var(--text); cursor: pointer; transition: all var(--speed) var(--ease); overflow: hidden;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
[data-theme='dark'] .buy-btn { border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.03); }
.buy-btn:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); box-shadow: var(--shadow-sm); }
[data-theme='dark'] .buy-btn:hover { border-color: rgba(168,85,247,0.4); background: rgba(168,85,247,0.1); color: #fff; box-shadow: 0 4px 15px rgba(0,0,0,0.3); }
.buy-btn svg { color: var(--brand); flex-shrink: 0; }
.buy-btn--pop { border-color: var(--accent); background: var(--brand-soft); color: var(--brand-strong); box-shadow: var(--shadow); }
[data-theme='dark'] .buy-btn--pop { border-color: rgba(168,85,247,0.5); background: rgba(168,85,247,0.15); color: #fff; box-shadow: 0 4px 20px rgba(168,85,247,0.3); }
.buy-btn--pop svg { color: var(--accent); }
[data-theme='dark'] .buy-btn--pop svg { color: #d8b4fe; }
.buy-pop-badge {
  position: absolute; top: 0; right: 0; background: var(--brand); color: #fff;
  font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 0 var(--r-sm) 0 var(--r-xs);
}

/* Section divider with label */
.s-divider {
  display: flex; align-items: center; gap: 12px;
  font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted);
}
.s-divider::before, .s-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* Ledger rows */
.ledger { display: flex; flex-direction: column; }
.ledger-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-top: 1px solid var(--border);
}
.ledger-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ldot--green { background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb,var(--success) 20%,transparent); }
.ldot--red   { background: var(--danger);  box-shadow: 0 0 0 3px color-mix(in srgb,var(--danger)  20%,transparent); }
.ledger-row__reason { font-size: var(--fs-sm); color: var(--text-2); }

/* Cost chips */
.cost-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cost-chip {
  padding: 4px 11px; background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted);
}

/* Provider hint (mock mode) */
.provider-hint {
  display: flex; align-items: center; gap: 8px; padding: 11px 14px;
  background: color-mix(in srgb,var(--success) 10%,transparent);
  border: 1px solid color-mix(in srgb,var(--success) 25%,transparent);
  border-radius: var(--r-sm); font-size: var(--fs-sm); color: var(--success); font-weight: 600;
}
.provider-hint svg { flex-shrink: 0; }

/* Integration cards */
.integ-list { display: flex; flex-direction: column; gap: 14px; }
.integ-item { border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; transition: border-color var(--speed); }
.integ-item:hover { border-color: var(--border-strong); }
.integ-item__head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.integ-item__logo { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.integ-item__logo svg { width: 17px; height: 17px; }
.integ-item__name { font-weight: 700; font-size: var(--fs-md); }
.integ-item__head .badge { margin-left: auto; }
.integ-item__fields { display: flex; flex-wrap: wrap; gap: 12px; padding: 16px 16px 4px; }
.integ-item__foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 16px; border-top: 1px solid var(--border); margin-top: 12px;
}

/* ============================================================
   Dashboard
   ============================================================ */

/* Per-stat accent colour */
.stat--ac { border-top: 3px solid var(--sac, var(--brand)); }
.stat--ac .stat__icon {
  background: color-mix(in srgb, var(--sac, var(--brand)) 13%, var(--bg-elev));
  color: var(--sac, var(--brand-strong));
}
[data-theme='dark'] .stat--ac .stat__icon { color: var(--sac, #c7cdff); filter: brightness(1.2); }

/* Side-by-side section columns */
.db-2col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 28px;
}

/* Design / template card */
.db-dcard { padding: 0; overflow: hidden; text-align: left; }
.db-dcard__img { aspect-ratio: 4/3; }
.db-dcard__empty {
  width: 100%; height: 100%; display: grid; place-items: center;
  color: var(--border-strong);
}
.db-dcard__meta { padding: 11px 14px; }
.db-dcard__name { font-weight: 700; font-size: var(--fs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-dcard__time { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; }

/* Empty note */
.db-empty {
  padding: 22px; text-align: center;
  background: var(--surface-2); border: 1px dashed var(--border-strong);
  border-radius: var(--r); color: var(--text-muted); font-size: var(--fs-sm);
}

/* Connected account row */
.acct-card {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface-2); transition: border-color var(--speed);
}
.acct-card:hover { border-color: var(--border-strong); }
.acct-logo { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.acct-logo svg { width: 16px; height: 16px; }
.acct-name { font-weight: 600; font-size: var(--fs-sm); flex: 1; }

/* Activity feed */
.activity-list { padding: 0 !important; overflow: hidden; }
.activity-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-ic {
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center; background: var(--bg-elev); flex-shrink: 0;
}
.activity-ic svg { width: 15px; height: 15px; color: var(--text-2); }
.activity-name { font-size: var(--fs-sm); font-weight: 600; text-transform: capitalize; }
.activity-time { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 1px; }
.activity-empty { padding: 20px; text-align: center; color: var(--text-muted); font-size: var(--fs-sm); }

/* ============================================================
   Immersive Dashboard Redesign
   ============================================================ */

.dash-container {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--text);
  z-index: 10; /* Below topbar to allow clicking topbar items */
  overflow: hidden;
}
[data-theme='dark'] .dash-container { color: #fff; }

.dash-bg-effect {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 85% 30%, rgba(168, 85, 247, 0.15) 0%, transparent 50%);
  pointer-events: none;
}
.dash-content {
  position: relative;
  text-align: center;
  max-width: 1000px;
  width: 100%;
  padding: 0 20px;
  margin-top: -40px;
}
.dash-title {
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 24px;
  background: linear-gradient(to right, var(--text), var(--brand));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
[data-theme='dark'] .dash-title {
  background: linear-gradient(to right, #ffffff, #d8b4fe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.dash-sub {
  font-size: 26px;
  color: var(--text-2);
  margin-bottom: 60px;
  max-width: 700px;
  margin-left: auto; margin-right: auto;
}
[data-theme='dark'] .dash-sub { color: rgba(255, 255, 255, 0.7); }

.dash-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--text);
  color: var(--bg);
  padding: 12px 28px;
  border-radius: 999px;
  font-size: 16px; font-weight: 700;
  border: none; cursor: pointer;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}
[data-theme='dark'] .dash-btn {
  background: #ffffff; color: #0f172a; box-shadow: 0 4px 15px rgba(255,255,255,0.2);
}
.dash-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}
[data-theme='dark'] .dash-btn:hover { box-shadow: 0 8px 25px rgba(255,255,255,0.3); }

.dash-cards-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  margin-top: 40px;
  perspective: 1000px;
}
.dash-fcard {
  position: relative;
  width: 180px; height: 180px;
  border-radius: 40px;
  background: var(--surface-glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-glass);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: scale 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.4s;
  cursor: pointer;
  animation: float 6s ease-in-out infinite;
  flex-shrink: 0;
}
[data-theme='dark'] .dash-fcard {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: #fff; box-shadow: 0 15px 40px rgba(0,0,0,0.6);
}
.dash-fcard:hover {
  background: var(--surface);
  border-color: var(--border-strong);
  scale: 1.1;
  filter: brightness(1.05);
  z-index: 10;
  animation-play-state: paused;
}
[data-theme='dark'] .dash-fcard:hover {
  background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.4); filter: brightness(1.2);
}
.dash-fcard-label {
  font-size: 15px; font-weight: 700; opacity: 0.95; text-align: center; letter-spacing: 0.02em;
}

/* Flexbox Positions for 3 cards */
.dash-fcard:nth-child(1) { margin-top: 40px; animation-delay: 0s; background: linear-gradient(135deg, rgba(236,72,153,0.3), rgba(236,72,153,0.1)); border-color: rgba(236,72,153,0.4); }
.dash-fcard:nth-child(2) { margin-top: 0px; animation-delay: -1s; background: linear-gradient(135deg, rgba(168,85,247,0.3), rgba(168,85,247,0.1)); border-color: rgba(168,85,247,0.4); z-index: 5; }
.dash-fcard:nth-child(3) { margin-top: 40px; animation-delay: -2s; background: linear-gradient(135deg, rgba(99,102,241,0.3), rgba(99,102,241,0.1)); border-color: rgba(99,102,241,0.4); }

@keyframes float {
  0% { translate: 0px 0px; }
  50% { translate: 0px -15px; }
  100% { translate: 0px 0px; }
}

.dash-dock {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  padding: 8px;
  border-radius: 999px;
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-lg);
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s;
}
[data-theme='dark'] .dash-dock {
  background: rgba(20, 20, 30, 0.6); border: 1px solid rgba(255,255,255,0.08); box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}
.dash-dock.exit {
  transform: translateX(-50%) translateY(100px);
  opacity: 0;
  pointer-events: none;
}
.dash-dock-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  color: var(--text-2);
  background: transparent;
  font-weight: 600; font-size: 15px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}
[data-theme='dark'] .dash-dock-item { color: rgba(255,255,255,0.7); }
.dash-dock-item:hover { color: var(--text); background: var(--surface-hover); }
[data-theme='dark'] .dash-dock-item:hover { color: #fff; background: rgba(255,255,255,0.1); }
.dash-dock-item.active { color: var(--brand-strong); background: var(--brand-soft); border: 1px solid var(--brand); }
[data-theme='dark'] .dash-dock-item.active { color: #fff; background: rgba(99, 102, 241, 0.2); border: 1px solid rgba(99, 102, 241, 0.3); }
.dash-dock-item svg { width: 18px; height: 18px; }

.dash-dock-highlight {
  background: linear-gradient(135deg, var(--accent), var(--brand));
  color: #fff; border: none; box-shadow: var(--shadow-glow-accent);
}
[data-theme='dark'] .dash-dock-highlight {
  background: linear-gradient(135deg, #a855f7, #6366f1);
  box-shadow: 0 0 15px rgba(168,85,247,0.4);
}
.dash-dock-highlight:hover { background: linear-gradient(135deg, var(--brand), var(--brand-strong)); }
[data-theme='dark'] .dash-dock-highlight:hover { background: linear-gradient(135deg, #c084fc, #818cf8); }

.dash-overlay {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  width: 600px;
  max-width: 90vw;
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 20;
}
[data-theme='dark'] .dash-overlay {
  background: rgba(20, 20, 30, 0.85); border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 20px 50px rgba(0,0,0,0.8);
}
.dash-overlay.open {
  opacity: 1; pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.dash-overlay-close {
  position: absolute; top: 16px; right: 16px;
  color: var(--text-muted); cursor: pointer;
  background: none; border: none; padding: 4px; border-radius: 50%;
}
[data-theme='dark'] .dash-overlay-close { color: rgba(255,255,255,0.5); }
.dash-overlay-close:hover { color: var(--text); background: var(--surface-hover); }
[data-theme='dark'] .dash-overlay-close:hover { color: #fff; background: rgba(255,255,255,0.1); }

/* Dashboard Topbar Styling */
.topbar--dashboard {
  background: transparent !important;
  border-bottom: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
}
.topbar--dashboard #theme-btn {
  display: none !important;
}
