/* veen Cloud dashboard layout. Loaded after cloud.css, scoped to body.dash so the landing page is untouched.
   Layout (RTL): fixed sidebar on the right, page header + content on the left. Below 900px the sidebar becomes a drawer. */

.dash {
  --bg: #F5F6F3; --surface: #fff; --line: #E4E7E2; --ink: #0F1F1E; --sub: #5F6F6D;
  --brand: #113B3A; --brand-2: #1D5553; --lime: #D8F36A; --soft: #EEF3E4;
  --warn-bg: #FFF7E0; --warn-line: #F2D98A; --warn-ink: #7A5A00;
  --radius: 14px;
  background: var(--bg);
  color: var(--ink);
}
.dash .ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.dash .muted { color: var(--sub); }
.dash .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; padding: 20px; margin: 0 0 16px; }
.dash .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.dash .btn.btn-sm { padding: 6px 12px; font-size: .82rem; }
.dash .btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.dash .btn.primary:hover { background: var(--brand-2); }

/* ---------- shell ---------- */
.d-app { display: flex; min-height: 100vh; }
.d-side {
  width: 252px; flex: none; background: var(--brand); color: #fff; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; z-index: 60;
}
.d-side-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 18px 14px; }
.d-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.d-brand-logo { height: 24px; filter: brightness(0) invert(1); display: block; }
.d-brand-tag { font-size: .66rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--brand); background: var(--lime); padding: 2px 7px; border-radius: 6px; }

.d-nav { flex: 1; overflow-y: auto; padding: 6px 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.d-nav-title { margin: 16px 10px 6px; font-size: .7rem; font-weight: 700; letter-spacing: .04em; color: rgba(255,255,255,.4); }
.d-nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px;
  background: none; color: rgba(255,255,255,.78); font: inherit; font-size: .93rem; text-align: start; cursor: pointer; text-decoration: none;
  transition: background .15s, color .15s;
}
.d-nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.d-nav-item.active { background: rgba(216,243,106,.14); color: var(--lime); font-weight: 700; }
.d-nav-pill { margin-inline-start: auto; font-style: normal; font-size: .68rem; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.12); color: rgba(255,255,255,.8); }
.d-nav-ext { margin-inline-start: auto; width: 14px; height: 14px; opacity: .6; }

.d-side-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.1); display: flex; flex-direction: column; gap: 12px; }
.d-quota { padding: 0 6px; }
.d-quota-row { display: flex; justify-content: space-between; font-size: .78rem; color: rgba(255,255,255,.7); margin-bottom: 6px; }
.d-quota .bar { height: 5px; background: rgba(255,255,255,.14); }
.d-quota .bar-fill { background: var(--lime); }
.d-user { display: flex; align-items: center; gap: 10px; padding: 6px; }
.d-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--lime); color: var(--brand); font-weight: 800; font-size: .8rem; display: grid; place-items: center; flex: none; }
.d-user-meta { min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.d-user-meta strong { font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-user-meta span { font-size: .72rem; color: rgba(255,255,255,.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.d-icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 0; background: none; color: inherit; display: grid; place-items: center; cursor: pointer; flex: none; }
.d-icon-btn:hover { background: rgba(127,127,127,.15); }
.d-only-mobile { display: none; }
.d-scrim { display: none; }

.d-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.d-top {
  display: flex; align-items: center; gap: 12px; padding: 16px 28px; background: var(--surface);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40;
}
.d-top-title { flex: 1; min-width: 0; }
.d-top-title h1 { margin: 0; font-size: 1.25rem; line-height: 1.3; color: var(--ink); }
.d-top-title p { margin: 2px 0 0; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-top-actions { display: flex; align-items: center; gap: 10px; }
.d-plan-chip { font-size: .78rem; font-weight: 700; padding: 5px 12px; border-radius: 999px; background: var(--soft); color: var(--brand); border: 1px solid #D9E3C2; white-space: nowrap; }
.d-content { padding: 24px 28px 48px; width: 100%; max-width: 1200px; margin: 0 auto; }

/* ---------- overview ---------- */
.d-welcome { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.d-welcome h2 { margin: 0; font-size: 1.5rem; color: var(--brand); }
.d-welcome p { margin: 2px 0 0; }
.d-welcome-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.d-alert { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 16px; border-radius: 12px; background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-ink); }
.d-alert p { margin: 0; flex: 1; font-size: .9rem; }
.d-alert.bad { background: #FDECEA; border-color: #F3B8B0; color: #8E2A20; }

.d-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.d-kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.d-kpi-head { display: flex; align-items: center; gap: 10px; font-size: .85rem; color: var(--sub); }
.d-kpi-icon { width: 32px; height: 32px; border-radius: 9px; background: var(--soft); color: var(--brand); display: grid; place-items: center; }
.d-kpi-icon .ic { width: 16px; height: 16px; }
.d-kpi-val { font-size: 1.55rem; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.d-kpi small { font-size: .78rem; }
.dash .bar { height: 7px; background: #E8ECE6; border-radius: 99px; overflow: hidden; }
.dash .bar-fill { height: 100%; width: 0; background: var(--brand); border-radius: 99px; transition: width .4s ease; }
.dash .bar-fill.high { background: #E0A526; }
.dash .bar-fill.full { background: #D4503F; }

.d-cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; }
.d-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.d-panel-head h2 { margin: 0; font-size: 1.05rem; color: var(--brand); }
.d-panel > .muted { margin: -6px 0 14px; font-size: .88rem; }
.d-link { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--brand); font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; padding: 0; }
.d-link:hover { text-decoration: underline; }
.d-link .ic { width: 14px; height: 14px; }

.d-recent { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.d-recent-item { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; cursor: pointer; padding: 0; font: inherit; text-align: start; display: block; width: 100%; transition: border-color .15s, box-shadow .15s; }
.d-recent-item:hover { border-color: var(--brand); box-shadow: 0 2px 10px rgba(17,59,58,.1); }
.d-recent-thumb { aspect-ratio: 4 / 3; background: #EEF1EC; display: grid; place-items: center; color: var(--sub); }
.d-recent-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.d-recent-name { padding: 6px 8px 7px; font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.d-empty { text-align: center; padding: 28px 12px; color: var(--sub); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.d-empty .ic { width: 34px; height: 34px; opacity: .45; }
.d-empty p { margin: 0; }

.d-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.d-steps button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border: 1px solid transparent; border-radius: 11px; background: none; font: inherit; text-align: start; cursor: pointer; color: inherit; }
.d-steps button:hover { background: var(--soft); border-color: #D9E3C2; }
.d-step-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.d-steps strong { display: block; font-size: .92rem; }
.d-steps small { display: block; color: var(--sub); font-size: .78rem; margin-top: 1px; }

.d-services { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 10px; }
.d-service { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.d-service > div { flex: 1; min-width: 0; line-height: 1.35; }
.d-service strong { display: block; font-size: .92rem; }
.d-service small { color: var(--sub); font-size: .78rem; }
.d-service-icon { width: 38px; height: 38px; border-radius: 10px; background: #EEF1EC; color: var(--brand); display: grid; place-items: center; flex: none; }
.d-service.on .d-service-icon { background: var(--brand); color: var(--lime); }
.d-service.soon { opacity: .7; }
.d-status { font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: #EEF1EC; color: var(--sub); white-space: nowrap; }
.d-status.ok { background: #E3F4E8; color: #1E7A43; }

/* ---------- files ---------- */
.dash .drop { padding: 28px 16px; border-radius: 12px; }
.dash .drop-icon { color: var(--brand); margin-bottom: 4px; display: flex; justify-content: center; }
.d-check { margin-top: 10px; display: inline-flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--sub); }
.d-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.d-spacer { flex: 1; }
.d-search { position: relative; flex: 1 1 220px; max-width: 340px; }
.d-search .ic { position: absolute; top: 50%; inset-inline-start: 12px; transform: translateY(-50%); width: 16px; height: 16px; color: var(--sub); pointer-events: none; }
.d-search input { width: 100%; padding: 9px 12px; padding-inline-start: 36px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: #fff; }
.d-search input:focus { outline: 2px solid rgba(17,59,58,.18); border-color: var(--brand); }

/* ---------- developers ---------- */
.d-form-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; align-items: stretch; }
.d-form-row input { flex: 1 1 200px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; }
.d-form-row .custom-select-wrap { min-width: 170px; }
.dash .code { direction: ltr; text-align: left; overflow-x: auto; }

/* ---------- billing ---------- */
.dash .plans-current-box { margin: 0; }
.d-trust { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 4px; }
.d-trust > div { display: flex; gap: 11px; align-items: flex-start; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.d-trust .ic { color: var(--brand); margin-top: 2px; }
.d-trust strong { display: block; font-size: .88rem; }
.d-trust small { color: var(--sub); font-size: .76rem; }
.dash .billing-icon-box .ic { width: 22px; height: 22px; }

/* ---------- settings ---------- */
.dash .settings-container { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.dash .settings-card { margin: 0; }
.dash .danger-card { grid-column: 1 / -1; }
.dash .settings-card-header h3, .dash .settings-card h3 { margin: 0 0 3px; font-size: 1.05rem; color: var(--brand); }
.dash .settings-card-header p { margin: 0; font-size: .84rem; }
.dash .danger-info-wrap h3 { color: #C0392B; }
.dash .danger-info-wrap p { margin: 0; font-size: .85rem; color: #7F1D1D; }
.dash .settings-icon-badge .ic { width: 20px; height: 20px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .d-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .d-cols { grid-template-columns: 1fr; }
  .d-trust { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .d-only-mobile { display: grid; }
  .d-side { position: fixed; top: 0; bottom: 0; right: 0; transform: translateX(100%); transition: transform .25s ease; width: 280px; }
  .d-side.open { transform: none; box-shadow: -10px 0 40px rgba(0,0,0,.25); }
  .d-scrim { display: block; position: fixed; inset: 0; background: rgba(8,24,23,.5); z-index: 55; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .d-scrim.show { opacity: 1; pointer-events: auto; }
  .d-top { padding: 12px 16px; }
  .d-top .d-icon-btn { color: var(--brand); }
  .d-plan-chip { display: none; }
  .d-content { padding: 18px 16px 40px; }
  .dash .settings-container { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .d-kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .d-kpi { padding: 14px; }
  .d-kpi-val { font-size: 1.25rem; }
  .d-trust { grid-template-columns: 1fr; }
  .d-top-actions .btn span { display: none; }
  .d-top-actions .btn { padding: 9px 12px; }
  .d-welcome-actions { width: 100%; }
  .d-welcome-actions .btn { flex: 1; }
}

/* ---------- small fixes ---------- */
.dash .files { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-top: 0; }
.dash .file { border-radius: 12px; box-shadow: none; }
.dash .file:hover { border-color: var(--brand); box-shadow: 0 4px 14px rgba(17,59,58,.1); }
.d-quota-row small { direction: ltr; unicode-bidi: isolate; }

.dash .acct-info { margin: 0; display: grid; gap: 12px; }
.dash .acct-info > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border, #e5e7eb); }
.dash .acct-info > div:last-child { border-bottom: 0; padding-bottom: 0; }
.dash .acct-info dt { color: #64748b; font-size: .88rem; }
.dash .acct-info dd { margin: 0; font-weight: 600; display: flex; align-items: center; gap: 8px; min-width: 0; }
.dash .acct-info code { font-size: .8rem; overflow-wrap: anywhere; }
.dash .acct-copy { padding: 4px 10px; font-size: .8rem; }
@media (max-width: 600px) { .dash .acct-info > div { flex-direction: column; align-items: flex-start; } }
.dash .pref-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; cursor: pointer; }
.dash .pref-row input { margin-top: 4px; width: 18px; height: 18px; accent-color: #113b3a; flex: none; }
.dash .pref-row span { display: flex; flex-direction: column; gap: 2px; }
.dash .health-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.dash .health-list li { display: flex; align-items: center; gap: 10px; font-size: .9rem; }
.dash .health-list li > span:nth-child(2) { flex: 1; }
.dash .health-mark { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; flex: none; }
.dash .health-list .ok .health-mark { background: #dcfce7; color: #15803d; }
.dash .health-list .todo .health-mark { background: #fef3c7; color: #b45309; }
.dash .key-reveal { padding: 4px 10px; font-size: .8rem; }
.dash .prefix.shown { direction: ltr; overflow-wrap: anywhere; user-select: all; }
