/* ═══════════════════════════════════════════════════════
   MyAlumin™ v2 — Dashboard Styles
   Light professional theme — inspired by StarAdmin
═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=Sora:wght@600;700;800&display=swap');

:root {
  --bg:         #f0f2f7;
  --bg-2:       #ffffff;
  --bg-3:       #f7f8fc;
  --bg-card:    #ffffff;
  --border:     #e4e8f0;
  --accent:     #2563eb;
  --accent-dim: rgba(37,99,235,0.08);
  --accent-2:   #0ea5e9;
  --text-1:     #1e2a3b;
  --text-2:     #4b5a6e;
  --text-3:     #8fa0b3;
  --red:        #ef4444;
  --green:      #16a34a;
  --radius:     12px;
  --sidebar-w:  240px;
  --shadow-sm:  0 1px 3px rgba(30,42,59,0.07), 0 1px 2px rgba(30,42,59,0.04);
  --shadow-md:  0 4px 16px rgba(30,42,59,0.09);

  /* status colors */
  --s-enquiry:    #64748b;
  --s-quoted:     #2563eb;
  --s-progress:   #d97706;
  --s-fitting:    #7c3aed;
  --s-completed:  #16a34a;
}

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

html, body {
  background: var(--bg);
  color: var(--text-1);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Layout ─────────────────────────────────────────── */

#ma-app {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────── */

.ma-sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  box-shadow: var(--shadow-sm);
}

.ma-sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 22px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}

.ma-logo-mark {
  width: 34px; height: 34px;
  background: var(--accent);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 17px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(37,99,235,0.35);
}

.ma-logo-text {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--text-1);
  letter-spacing: -0.02em;
}
.ma-logo-text sup { font-size: 9px; color: var(--text-3); }

.ma-sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  padding: 10px 20px 4px;
}

.ma-sidebar-nav { flex: 1; padding: 0 12px; }

.ma-nav-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%; padding: 8px 11px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.13s, color 0.13s;
  margin-bottom: 1px;
}
.ma-nav-item:hover { background: var(--bg-3); color: var(--text-1); }
.ma-nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
}
.ma-nav-item svg {
  width: 15px; height: 15px;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
  opacity: 0.85;
}
.ma-nav-item.active svg { opacity: 1; }

.ma-nav-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; margin-left: 5px;
}
.dot-enquiry   { background: var(--s-enquiry); }
.dot-quoted    { background: var(--s-quoted); }
.dot-progress  { background: var(--s-progress); }
.dot-fitting   { background: var(--s-fitting); }
.dot-completed { background: var(--s-completed); }

.ma-sidebar-footer {
  padding: 14px 14px 0;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
}

.ma-btn-new {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--accent); color: #fff;
  font-weight: 600; font-size: 13px;
  padding: 9px 14px; border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}
.ma-btn-new:hover { background: #1d4ed8; box-shadow: 0 4px 14px rgba(37,99,235,0.35); }

.ma-logout {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  color: var(--text-3); font-size: 12px; text-decoration: none;
  padding: 5px; border-radius: 6px;
  transition: color 0.13s;
}
.ma-logout:hover { color: var(--red); }

/* ── Main ────────────────────────────────────────────── */

.ma-main {
  flex: 1;
  padding: 28px 32px;
  overflow-y: auto;
  max-width: 1300px;
}

.ma-view { display: none; }
.ma-view.active { display: block; }

.ma-view-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.ma-view-header h1 {
  font-family: 'Sora', sans-serif;
  font-size: 20px; font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.02em;
}
.ma-date {
  color: var(--text-3); font-size: 13px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
}

/* ── KPI cards ───────────────────────────────────────── */

.ma-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
@media (max-width: 1100px) { .ma-kpi-grid { grid-template-columns: repeat(3,1fr); } }
@media (max-width: 700px)  { .ma-kpi-grid { grid-template-columns: repeat(2,1fr); } }

.ma-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.12s, border-color 0.15s;
  box-shadow: var(--shadow-sm);
}
.ma-kpi-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--accent);
}
.ma-kpi-card.kpi-completed { border-left: 3px solid var(--s-completed); }

.ma-kpi-label {
  font-size: 11px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 7px;
}
.ma-kpi-value {
  font-family: 'Sora', sans-serif;
  font-size: 26px; font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.02em;
}

/* ── Overview row ────────────────────────────────────── */

.ma-overview-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 24px;
}
@media (max-width: 800px) { .ma-overview-row { grid-template-columns: 1fr; } }

.ma-chart-card, .ma-upcoming-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.ma-chart-card h3, .ma-upcoming-card h3 {
  font-family: 'Sora', sans-serif;
  font-size: 13px; font-weight: 700;
  color: var(--text-1);
  margin-bottom: 18px;
  letter-spacing: -0.01em;
}

.ma-donut-wrap { display: flex; align-items: center; gap: 28px; }
.ma-donut { width: 120px; height: 120px; flex-shrink: 0; }

.ma-donut-legend { display: flex; flex-direction: column; gap: 7px; }
.ma-legend-item { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }
.ma-legend-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

.ma-fitting-list { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.ma-fitting-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}
.ma-fitting-date {
  color: var(--accent); font-weight: 700; font-size: 12px;
  background: var(--accent-dim);
  padding: 2px 8px; border-radius: 99px;
}
.ma-loading { color: var(--text-3); font-style: italic; font-size: 13px; }

/* ── Table ───────────────────────────────────────────── */

.ma-section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 0 12px;
}
.ma-section-header h3 {
  font-family: 'Sora', sans-serif;
  font-size: 13px; font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.01em;
}
.ma-section-sub { color: var(--text-3); font-size: 12px; }

.ma-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  background: var(--bg-card);
}
.ma-table { width: 100%; border-collapse: collapse; }
.ma-table th {
  text-align: left; padding: 11px 16px;
  background: var(--bg-3); color: var(--text-3);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
}
.ma-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: 13px;
  color: var(--text-1);
}
.ma-table tr:last-child td { border-bottom: none; }
.ma-table tbody tr:hover td { background: var(--bg-3); cursor: pointer; }
.ma-table code {
  font-size: 12px; background: var(--accent-dim);
  color: var(--accent); padding: 2px 7px; border-radius: 5px;
  font-family: 'Plus Jakarta Sans', monospace; font-weight: 600;
}

/* ── Status badges ───────────────────────────────────── */

.ma-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  text-transform: capitalize;
  letter-spacing: 0.02em;
}
.badge-enquiry    { background: rgba(100,116,139,.1); color: var(--s-enquiry); }
.badge-quoted     { background: rgba(37,99,235,.1);   color: var(--s-quoted); }
.badge-in_progress{ background: rgba(217,119,6,.1);   color: var(--s-progress); }
.badge-fitting    { background: rgba(124,58,237,.1);  color: var(--s-fitting); }
.badge-completed  { background: rgba(22,163,74,.1);   color: var(--s-completed); }
.badge-archived   { background: rgba(100,116,139,.1); color: #64748b; }

/* ── Edit drawer ─────────────────────────────────────── */

.ma-drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(30,42,59,0.3);
  backdrop-filter: blur(3px);
  z-index: 100;
  display: none;
}
.ma-drawer-overlay.open { display: block; }

.ma-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 500px; max-width: 100vw;
  background: var(--bg-2);
  border-left: 1px solid var(--border);
  z-index: 101;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
  display: flex; flex-direction: column;
  box-shadow: -8px 0 40px rgba(30,42,59,0.12);
}
.ma-drawer.open { transform: translateX(0); }

.ma-drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-3);
}
.ma-drawer-header h2 {
  font-family: 'Sora', sans-serif;
  font-size: 15px; font-weight: 700;
  color: var(--text-1);
}
.ma-drawer-close {
  background: var(--bg-2); border: 1px solid var(--border);
  color: var(--text-2); font-size: 16px; cursor: pointer;
  width: 30px; height: 30px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.12s;
}
.ma-drawer-close:hover { background: var(--border); color: var(--text-1); }

.ma-drawer-body { flex: 1; overflow-y: auto; padding: 22px; }

/* ── Search ──────────────────────────────────────────── */

.ma-search-wrap { position: relative; }
.ma-search-wrap input {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text-1);
  padding: 8px 14px 8px 36px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  width: 260px;
  box-shadow: var(--shadow-sm);
}
.ma-search-wrap input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.ma-search-wrap::before {
  content: '';
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238fa0b3' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
  pointer-events: none;
}

/* ── Forms ───────────────────────────────────────────── */

.ma-form { max-width: 840px; }

.ma-form-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.ma-form-section-title {
  font-family: 'Sora', sans-serif;
  font-size: 12px; font-weight: 700;
  color: var(--text-1);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 16px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--border);
}

.ma-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 12px; }
.ma-form-row:last-child { margin-bottom: 0; }
.ma-field.full { grid-column: 1/-1; }

.ma-field { display: flex; flex-direction: column; gap: 5px; }
.ma-field label {
  font-size: 11px; font-weight: 700; color: var(--text-2);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.req { color: var(--accent); }
.ma-field-hint { font-size: 11px; color: var(--text-3); }

.ma-field input, .ma-field select, .ma-field textarea {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-1);
  padding: 9px 12px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  transition: border-color 0.13s, box-shadow 0.13s;
}
.ma-field input:focus, .ma-field select:focus, .ma-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
  background: #fff;
}
.ma-field select { appearance: none; cursor: pointer; }
.ma-field textarea { resize: vertical; min-height: 80px; }

/* ── File drop zones ─────────────────────────────────── */

.ma-file-drop {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: 9px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-3);
  overflow: visible;
}
.ma-file-drop:hover { border-color: var(--accent); background: var(--accent-dim); }
.ma-file-drop.has-file { border-color: var(--green); background: rgba(22,163,74,0.06); border-style: solid; }
.ma-file-drop input[type="file"] {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
  pointer-events: all;
  margin: 0;
  padding: 0;
}
.ma-file-label {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
  position: relative;
  z-index: 1;
  pointer-events: none;
  user-select: none;
}
.ma-file-drop.has-file .ma-file-label { color: var(--green); font-weight: 600; }

/* ── Photo group lock — only .locked class disables, default groups are fully active ── */
.ma-photo-group { margin-bottom: 18px; }
.ma-photo-group h4 { font-size: 12px; color: var(--text-2); margin-bottom: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.ma-photo-group.locked { position: relative; }
.ma-photo-group.locked .ma-photo-slots { opacity: 0.4; pointer-events: none; }
.ma-photo-group.locked::after {
  content: 'Available on fitting date';
  position: absolute;
  inset: 28px 0 0 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: var(--text-3);
  background: rgba(247,248,252,0.85);
  border-radius: 8px;
  z-index: 3;
  pointer-events: none;
}


.ma-photo-slots { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }

/* ── Form actions ────────────────────────────────────── */

.ma-form-actions { display: flex; gap: 12px; padding-top: 8px; }

.ma-btn-primary {
  background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius);
  padding: 10px 26px; font-weight: 700; font-size: 13px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}
.ma-btn-primary:hover { background: #1d4ed8; box-shadow: 0 4px 14px rgba(37,99,235,0.35); }
.ma-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

.ma-btn-ghost {
  background: transparent; color: var(--text-2);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 24px; font-weight: 600; font-size: 13px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center;
  transition: border-color 0.13s, color 0.13s, background 0.13s;
}
.ma-btn-ghost:hover { border-color: var(--text-2); color: var(--text-1); background: var(--bg-3); }

/* ── Alert ───────────────────────────────────────────── */

.ma-alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
  margin-bottom: 18px;
  border-left: 3px solid;
}
.ma-alert.success { background: rgba(22,163,74,.07); border-color: var(--green); color: #166534; }
.ma-alert.error   { background: rgba(239,68,68,.07); border-color: var(--red);   color: #991b1b; }

/* ── Client / Presales dashboards ────────────────────── */

.ma-client-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
  box-shadow: var(--shadow-sm);
}
.ma-client-logo { display: flex; align-items: center; gap: 10px; }
.ma-client-user {
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; color: var(--text-2); font-weight: 500;
}
.ma-logout-btn {
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text-2); padding: 5px 13px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: border-color 0.13s, color 0.13s;
}
.ma-logout-btn:hover { border-color: var(--red); color: var(--red); }

.ma-client-main { max-width: 960px; margin: 0 auto; padding: 28px 24px; }
.ma-presales-main { max-width: 1100px; }

.ma-status-banner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.ma-status-label { color: var(--text-2); font-size: 13px; font-weight: 600; }
.ma-status-badge { font-family: 'Sora', sans-serif; font-size: 16px; font-weight: 700; }

.ma-client-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px; margin-bottom: 24px;
}

.ma-info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.ma-info-card h3 {
  font-family: 'Sora', sans-serif;
  font-size: 12px; font-weight: 700;
  color: var(--text-1); text-transform: uppercase; letter-spacing: 0.07em;
  margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
}

.ma-details { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; }
.ma-details dt { color: var(--text-3); font-size: 12px; font-weight: 600; }
.ma-details dd { color: var(--text-1); font-size: 13px; font-weight: 500; }

/* ── Documents ───────────────────────────────────────── */

.ma-docs-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 200px));
  gap: 12px; margin-bottom: 24px;
}
.ma-doc-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, transform 0.12s;
}
.ma-doc-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.ma-doc-icon { color: var(--accent); }
.ma-doc-icon svg { width: 32px; height: 32px; stroke: currentColor; fill: none; stroke-width: 1.5; }
.ma-doc-label { font-size: 12px; font-weight: 700; color: var(--text-1); }
.ma-doc-link {
  display: inline-block;
  background: var(--accent-dim); color: var(--accent);
  border: 1px solid rgba(37,99,235,.2);
  border-radius: 6px; padding: 5px 14px;
  font-size: 12px; font-weight: 700; text-decoration: none;
}
.ma-doc-link:hover { background: rgba(37,99,235,.15); }
.ma-doc-none { font-size: 11px; color: var(--text-3); }

/* ── Photos ──────────────────────────────────────────── */

.ma-photos-wrap { display: flex; flex-direction: column; gap: 18px; margin-bottom: 24px; }
.ma-photo-category h4 {
  font-size: 12px; font-weight: 700; color: var(--text-1);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 10px;
}
.ma-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.ma-photo-grid img {
  width: 100%; aspect-ratio: 4/3; object-fit: cover;
  border-radius: 9px; border: 1px solid var(--border);
  cursor: pointer; transition: box-shadow 0.15s, transform 0.12s;
  box-shadow: var(--shadow-sm);
}
.ma-photo-grid img:hover { box-shadow: var(--shadow-md); transform: scale(1.02); }
.ma-no-photos { color: var(--text-3); font-size: 12px; font-style: italic; }

/* ── Gallery (presales) ──────────────────────────────── */

.ma-gallery-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px; margin-bottom: 24px;
}
.ma-gallery-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, transform 0.12s;
}
.ma-gallery-item:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.ma-gallery-thumb {
  width: 100%; aspect-ratio: 4/3; object-fit: cover;
  border-bottom: 1px solid var(--border);
  display: block;
}
.ma-gallery-thumb.placeholder {
  background: var(--bg-3); display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
}
.ma-gallery-thumb.placeholder svg { width: 36px; height: 36px; stroke: var(--text-3); fill: none; stroke-width: 1.5; }
.ma-gallery-info { padding: 12px; }
.ma-gallery-name { font-weight: 700; font-size: 13px; margin-bottom: 2px; color: var(--text-1); }
.ma-gallery-loc  { font-size: 11px; color: var(--text-3); }
.ma-gallery-loading { color: var(--text-3); font-style: italic; padding: 20px 0; }

/* ── Presales quote hero ─────────────────────────────── */

.ma-quote-hero {
  margin-bottom: 24px;
  padding: 24px;
  background: linear-gradient(135deg, var(--accent) 0%, #1d4ed8 100%);
  border-radius: var(--radius);
  color: #fff;
}
.ma-quote-hero h2 {
  font-family: 'Sora', sans-serif;
  font-size: 20px; font-weight: 800;
  margin-bottom: 6px; letter-spacing: -0.02em;
}
.ma-quote-hero p { color: rgba(255,255,255,0.8); font-size: 14px; }

/* ── PIN Gate ────────────────────────────────────────── */

.myalumin-gate-page {
  background: var(--bg);
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.gate-wrap { width: 100%; max-width: 380px; }
.gate-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 32px;
  box-shadow: var(--shadow-md);
}
.gate-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.gate-logo-mark {
  width: 38px; height: 38px;
  background: var(--accent); color: #fff;
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-family: 'Sora', sans-serif; font-weight: 800; font-size: 20px;
  box-shadow: 0 4px 12px rgba(37,99,235,0.35);
}
.gate-logo-text {
  font-family: 'Sora', sans-serif; font-weight: 700; font-size: 18px; color: var(--text-1);
}
.gate-logo-text sup { font-size: 10px; color: var(--text-3); }
.gate-subtitle { font-size: 13px; color: var(--text-3); margin-bottom: 26px; }

.gate-error {
  background: rgba(239,68,68,.07); border: 1px solid rgba(239,68,68,.25);
  color: #991b1b; border-radius: 8px; padding: 10px 14px;
  font-size: 13px; margin-bottom: 14px; font-weight: 500;
}
.gate-fields { display: flex; flex-direction: column; gap: 14px; }
.gate-field { display: flex; flex-direction: column; gap: 5px; }
.gate-field label {
  font-size: 11px; font-weight: 700; color: var(--text-2);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.gate-field input {
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: 9px; color: var(--text-1);
  padding: 10px 14px; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 14px;
}
.gate-field input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
  background: #fff;
}
.gate-btn {
  background: var(--accent); color: #fff;
  border: none; border-radius: 9px;
  padding: 11px; font-weight: 700; font-size: 14px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(37,99,235,0.25);
  margin-top: 4px;
}
.gate-btn:hover { background: #1d4ed8; box-shadow: 0 4px 14px rgba(37,99,235,0.35); }
.gate-btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

/* ── Lightbox ───────────────────────────────────────────────────────────── */
#ma-lightbox {
  display: none;
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.93);
  align-items: center; justify-content: center;
  flex-direction: column;
}
#ma-lightbox.show { display: flex; }
#ma-lb-img-wrap { max-width: 92vw; max-height: 82vh; display: flex; align-items: center; justify-content: center; }
#ma-lb-img { max-width: 100%; max-height: 82vh; border-radius: 8px; object-fit: contain; box-shadow: 0 8px 48px rgba(0,0,0,.6); }
#ma-lb-close {
  position: absolute; top: 16px; right: 20px;
  background: rgba(255,255,255,.12); border: none; color: #fff;
  font-size: 20px; width: 38px; height: 38px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
#ma-lb-close:hover { background: rgba(255,255,255,.25); }
#ma-lb-prev, #ma-lb-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.1); border: none; color: #fff;
  font-size: 36px; width: 48px; height: 72px; border-radius: 8px;
  cursor: pointer; transition: background .15s; display: flex; align-items: center; justify-content: center;
}
#ma-lb-prev { left: 12px; }
#ma-lb-next { right: 12px; }
#ma-lb-prev:hover, #ma-lb-next:hover { background: rgba(255,255,255,.22); }
#ma-lb-counter { position: absolute; bottom: 18px; color: rgba(255,255,255,.6); font-size: 13px; font-weight: 600; }

/* ── Thumbnail wrap (500×500 square, lightbox on click) ─────────────────── */
.ma-thumb-wrap {
  position: relative; width: 120px; height: 120px;
  border-radius: 8px; overflow: hidden; cursor: pointer;
  border: 1px solid var(--border); flex-shrink: 0;
}
.ma-thumb-wrap:hover .ma-thumb-zoom { opacity: 1; }
.ma-gallery-thumb, .ma-portal-thumb {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.ma-thumb-zoom {
  position: absolute; inset: 0; background: rgba(30,42,59,.45);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; opacity: 0; transition: opacity .18s;
}

/* Client portal photo grid */
.ma-photo-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.ma-portal-thumb { width: 120px; height: 120px; object-fit: cover; border-radius: 8px; }

/* ── Completed projects widget ──────────────────────────────────────────── */
.ma-completed-widget {
  background: linear-gradient(160deg, #1e3a8a 0%, #1d4ed8 45%, #0284c7 100%);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 6px 24px rgba(29,78,216,.35);
  display: flex; flex-direction: column;
}
.cw-header {
  display: flex; align-items: center; gap: 8px;
  font-family: 'Sora', sans-serif; font-size: 11px; font-weight: 700;
  color: rgba(255,255,255,.8); text-transform: uppercase; letter-spacing: .08em;
  padding: 14px 16px 12px; border-bottom: 1px solid rgba(255,255,255,.12);
}
.cw-list { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 16px; }

/* Project card inside widget */
.cw-project-card { display: flex; flex-direction: column; gap: 8px; }
.cw-project-info { display: flex; flex-direction: column; gap: 2px; }
.cw-project-name {
  font-family: 'Sora', sans-serif; font-size: 13px; font-weight: 700;
  color: #fff; line-height: 1.2;
}
.cw-project-meta {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; color: rgba(255,255,255,.65);
}
.cw-photo-row { display: flex; gap: 6px; flex-wrap: wrap; }
.cw-photo-thumb {
  width: 500px; max-width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover; border-radius: 8px;
  border: 2px solid rgba(255,255,255,.15);
  display: block;
}
/* When multiple thumbs, shrink to fit side by side */
.cw-photo-row:has(.cw-photo-thumb:nth-child(2)) .cw-photo-thumb { width: calc(50% - 3px); }
.cw-photo-row:has(.cw-photo-thumb:nth-child(3)) .cw-photo-thumb { width: calc(33.33% - 4px); }
.cw-no-photo {
  font-size: 11px; color: rgba(255,255,255,.45); padding: 6px 0;
  font-style: italic;
}
/* Divider between project cards */
.cw-project-card + .cw-project-card {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 14px;
}

