/* ── StockAxis Design System ─────────────────────────── */
:root {
    /* Color Palette — Base */
    --bg:             #0f1117;
    --bg-card:        #181c27;
    --bg-input:       #1e2235;
    --bg-dark:        #1a365d;
    --bg-subtle:      #f5f5f5;
    --bg-light:       #fafbfc;
    --bg-light2:      #f0f4f8;

    /* Color Palette — Borders & Text */
    --border:         #2a2f45;
    --border-light:   #ddd;
    --text:           #e8eaf0;
    --text-sub:       #8892a4;
    --text-muted:     #4a5168;
    --text-secondary: #333;

    /* Color Palette — Semantic */
    --accent:         #2563eb;
    --accent-dim:     #1d4ed8;
    --success:        #3ecf6c;
    --success-bg:     #d4edda;
    --danger:         #e85555;
    --warning:        #e8a83b;
    --warning-bg:     #fff3cd;

    /* Layout & Spacing */
    --sidebar-w:      240px;
    --radius:         10px;
    --radius-sm:      6px;
    --shadow:         0 4px 24px rgba(0,0,0,0.4);
}

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

body {
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.6;
}

/* ── Language toggle — body class controls visibility ─── */
body.lang-en .hindi     { display: none !important; }
body.lang-en .hindi-sub { display: none !important; }
body.lang-en .action-hindi { display: none !important; }
body.lang-hi .hindi     { display: inline !important; }
body.lang-hi .hindi-sub { display: block !important; }
body.lang-hi .action-hindi { display: block !important; }

/* ── Demo Banner ──────────────────────────────────────── */
.demo-banner {
  background: #e8a83b;
  color: #0f1117;
  padding: 6px 20px;
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: nowrap;
  font-size: 12px;
  font-weight: 600;
  min-height: 36px;
}
.demo-banner-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-shrink: 1;
}
.demo-mode-label {
  background: rgba(0,0,0,0.15);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  flex-shrink: 0;
}
.demo-industry-name { font-weight: 700; white-space: nowrap; }
.demo-separator { opacity: 0.5; flex-shrink: 0; }
.demo-days { opacity: 0.8; font-size: 11px; font-weight: 500; white-space: nowrap; }
.demo-banner-center { position: relative; flex-shrink: 0; }
.industry-switch-btn {
  background: rgba(0,0,0,0.15);
  border: none;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #0f1117;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.industry-switch-btn:hover { background: rgba(0,0,0,0.25); }
.industry-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #181c27;
  border: 1px solid #2a2f45;
  border-radius: 10px;
  min-width: 260px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  z-index: 300;
  overflow: hidden;
  padding: 6px;
}
.industry-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 7px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: #e8eaf0;
  transition: background 0.15s;
  margin-bottom: 2px;
  font-family: inherit;
}
.industry-option:hover:not(.disabled) { background: #1e2235; }
.industry-option.active { background: rgba(37,99,235,0.15); }
.industry-option.disabled { opacity: 0.45; cursor: not-allowed; }
.ind-icon { font-size: 20px; flex-shrink: 0; }
.ind-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.ind-name { font-size: 13px; font-weight: 600; color: #e8eaf0; }
.ind-desc { font-size: 11px; color: #8892a4; margin-top: 1px; }
.ind-active-dot { color: #3ecf6c; font-size: 10px; flex-shrink: 0; }
.ind-coming-soon {
  font-size: 10px;
  background: rgba(255,255,255,0.1);
  padding: 2px 7px;
  border-radius: 10px;
  color: #8892a4;
  flex-shrink: 0;
}
.demo-banner-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.demo-banner-btn {
  background: rgba(0,0,0,0.15);
  border: none;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #0f1117;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background 0.15s;
  white-space: nowrap;
  font-family: inherit;
}
.demo-banner-btn:hover { background: rgba(0,0,0,0.25); color: #0f1117; }
.demo-banner-btn-cta { background: #0f1117; color: #e8a83b; }
.demo-banner-btn-cta:hover { background: #1e2235; color: #e8a83b; }
@media (max-width: 768px) {
  .demo-banner { padding: 6px 10px; flex-wrap: nowrap; }
  .demo-days { display: none; }
  .demo-separator { display: none; }
  .demo-industry-name { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .demo-banner-right .demo-banner-btn:first-child { display: none; }
}

/* ── Typography ───────────────────────────────────────── */
h1, h2, h3, h4 { font-family: Arial, Helvetica, sans-serif; font-weight: 700; }
.hindi { font-size: 0.78em; color: var(--text-sub); margin-left: 4px; font-family: Arial, Helvetica, sans-serif; }
.hindi-sub { display: block; font-size: 0.65em; color: var(--text-sub); font-weight: 400; margin-top: 2px; }

/* ── Layout ───────────────────────────────────────────── */
.sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 0;
    z-index: 100;
}

.sidebar-brand {
    padding: 12px 12px 0;
    border-bottom: 1px solid var(--border);
}

/* ── Logo box — light grey container for all 3 logos ──── */
.logo-box {
    background: #d9d9d9;
    border-radius: 8px;
    padding: 10px 12px 8px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.logo-box-login {
    padding: 14px 18px 12px;
    margin-bottom: 24px;
    display: inline-flex;
}

.brand-logos {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 28px;
}
.brand-logo {
    height: 26px;
    width: auto;
    object-fit: contain;
}
.brand-logo-main {
    height: 20px;
    width: auto;
    object-fit: contain;
}
.brand-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.brand-version {
    font-size: 11px;
    color: #666;
    background: rgba(0,0,0,0.08);
    padding: 2px 6px;
    border-radius: 20px;
}

/* Language toggle */
.lang-toggle-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    border-bottom: 1px solid var(--border);
}
.lang-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    width: 16px;
}
.lang-toggle {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 18px;
}
.lang-toggle input { opacity: 0; width: 0; height: 0; }
.lang-slider {
    position: absolute;
    inset: 0;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    transition: 0.2s;
}
.lang-slider:before {
    content: '';
    position: absolute;
    width: 12px; height: 12px;
    left: 2px; top: 2px;
    background: var(--accent);
    border-radius: 50%;
    transition: 0.2s;
}
.lang-toggle input:checked + .lang-slider:before {
    transform: translateX(16px);
}

.nav-section-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    padding: 16px 20px 8px;
}

.nav-links { list-style: none; flex: 1; overflow-y: auto; }
.nav-links li { margin: 2px 8px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-sub);
    text-decoration: none;
    font-size: 13.5px;
    transition: all 0.15s;
}
.nav-item:hover { background: var(--bg-input); color: var(--text); }
.nav-item.active {
    background: rgba(232, 184, 75, 0.12);
    color: var(--accent);
    font-weight: 500;
}
.nav-icon { font-size: 14px; width: 18px; text-align: center; }
.nav-text { flex: 1; }

/* Submenu Styles */
.nav-submenu {
    list-style: none;
    margin: 6px 0 0 0;
    padding: 6px 0;
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid var(--accent);
    display: none;
}
.nav-submenu li {
    margin: 0;
}
.nav-submenu .nav-item {
    padding: 10px 16px;
    padding-left: 28px;
    font-size: 13px;
    color: var(--text-sub);
    font-weight: 400;
    display: block;
    width: 100%;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}
.nav-submenu .nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
    border-left-color: var(--accent);
    padding-left: 32px;
}
.nav-submenu .nav-item.active {
    background: rgba(232, 184, 75, 0.15);
    color: var(--accent);
    border-left-color: var(--accent);
    font-weight: 600;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
}
.user-info { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.user-avatar {
    width: 32px; height: 32px;
    background: var(--accent);
    color: var(--bg);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 500; color: var(--text); }
.user-role { font-size: 11px; color: var(--text-muted); }
.logout-btn {
    display: block;
    text-align: center;
    padding: 7px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    color: var(--text-sub);
    text-decoration: none;
    font-size: 12px;
    transition: all 0.15s;
}
.logout-btn:hover { border-color: var(--danger); color: var(--danger); }

.main-content {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    padding: 32px;
}
.content-inner { max-width: 1200px; }

/* ── Page header ──────────────────────────────────────── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
}
.page-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.5px;
}
.page-sub { color: var(--text-sub); font-size: 13.5px; margin-top: 3px; }
.section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-sub);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

/* ── Dashboard cards ──────────────────────────────────── */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}
.dash-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.dash-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.dash-icon { font-size: 20px; margin-bottom: 10px; color: var(--accent); }
.dash-value {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 36px;
    font-weight: 500;
    color: var(--text);
    line-height: 1;
    margin-bottom: 6px;
    letter-spacing: -1px;
}
.dash-label { font-size: 12px; color: var(--text-sub); line-height: 1.4; }

/* ── Quick actions ────────────────────────────────────── */
.quick-actions { margin-top: 8px; }
.action-row { display: flex; gap: 12px; flex-wrap: wrap; }
.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 28px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    gap: 3px;
    transition: all 0.15s;
}
.action-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.action-btn .hindi { font-size: 11px; color: var(--text-muted); }

/* ── Cards ────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 20px;
}

/* ── Tables ───────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    background: var(--bg-input);
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-sub);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 1px solid var(--border);
}
.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13.5px;
    vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,0.02); }
.row-inactive td { opacity: 0.45; }
.rate-higher td { color: var(--danger); }
.rate-lower td { color: #2da254; }
.actions-cell { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ── Table scrolling ──────────────────────────────────── */
.table-scroll {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

/* ── Badges ───────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-admin { background: rgba(232,184,75,0.15); color: var(--accent); }
.badge-staff { background: rgba(62,207,108,0.12); color: var(--success); }
.badge-vendor { background: rgba(232,168,59,0.12); color: var(--warning); }

/* ── Status dots ──────────────────────────────────────── */
.status-dot {
    display: inline-block;
    width: 7px; height: 7px;
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: middle;
}
.status-dot.active { background: var(--success); }
.status-dot.inactive { background: var(--text-muted); }

/* ── Buttons ──────────────────────────────────────────── */
.btn-primary {
    background: var(--accent);
    color: var(--bg);
    border: none;
    padding: 9px 18px;
    min-height: 40px;
    border-radius: var(--radius-sm);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    display: inline-block;
}
.btn-primary:hover { background: var(--accent-dim); }

.btn-outline {
    background: transparent;
    color: var(--text-sub);
    border: 1px solid var(--border);
    padding: 8px 16px;
    min-height: 40px;
    border-radius: var(--radius-sm);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    display: inline-block;
}
.btn-outline:hover { border-color: var(--text-sub); color: var(--text); }

.btn-secondary {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 9px 18px;
    min-height: 40px;
    border-radius: var(--radius-sm);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    display: inline-block;
}
.btn-secondary:hover { background: var(--bg); border-color: var(--text-sub); }

.btn-danger {
    background: rgba(232,85,85,0.15);
    color: var(--danger);
    border: 1px solid var(--border);
    padding: 9px 18px;
    min-height: 40px;
    border-radius: var(--radius-sm);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    display: inline-block;
}
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

.btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    font-size: 20px;
    line-height: 1;
    transition: color 0.15s;
}
.btn-close:hover { color: var(--text); }

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 500;
    transition: all 0.15s;
}
.btn-sm.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-sub);
}
.btn-sm.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm.btn-danger { background: rgba(232,85,85,0.15); color: var(--danger); }
.btn-sm.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm.btn-success { background: rgba(62,207,108,0.15); color: var(--success); }
.btn-sm.btn-success:hover { background: var(--success); color: #fff; }

/* ── Forms ────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-label {
    display: block;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-sub);
    margin-bottom: 6px;
}
.form-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13.5px;
    transition: border-color 0.15s;
    outline: none;
}
.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--text-muted); }
.form-input option { background: var(--bg-card); }

/* ── Modals ───────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 600px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
}
.modal-wide { max-width: 900px; }
.modal-sm { max-width: 400px; }
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}
.modal-close:hover { color: var(--text); }
.modal-form {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin: 0;
    padding: 16px 24px 24px;
    border-top: 1px solid var(--border);
    position: sticky;
    bottom: 0;
    background: var(--bg-card);
    flex-shrink: 0;
}

/* ── Permissions grid ─────────────────────────────────── */
.permissions-title {
    font-size: 14px;
    font-weight: 600;
    margin: 16px 0 4px;
    color: var(--text);
}
.permissions-note { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; }
.permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}
.perm-group {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
}
.perm-group-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}
.perm-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--text-sub);
    cursor: pointer;
    padding: 3px 0;
}
.perm-item:hover { color: var(--text); }
.perm-checkbox { accent-color: var(--accent); width: 13px; height: 13px; cursor: pointer; }

/* ── Alerts ───────────────────────────────────────────── */
.alert {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 13.5px;
}
.alert-success { background: rgba(62,207,108,0.1); border: 1px solid rgba(62,207,108,0.3); color: var(--success); }
.alert-error   { background: rgba(232,85,85,0.1);  border: 1px solid rgba(232,85,85,0.3);  color: var(--danger); }
.alert-close { background: none; border: none; color: inherit; font-size: 18px; cursor: pointer; padding: 0; }

/* ── Text utilities ───────────────────────────────────── */
.text-muted { color: var(--text-muted); font-size: 12px; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-accent { color: var(--accent); }
.text-secondary { color: var(--text-secondary); }

/* ── Spacing utilities ────────────────────────────────── */
.mt-4 { margin-top: 4px; }
.mt-6 { margin-top: 6px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-4 { margin-bottom: 4px; }
.mb-6 { margin-bottom: 6px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.p-4 { padding: 4px; }
.p-8 { padding: 8px; }
.p-12 { padding: 12px; }
.p-16 { padding: 16px; }
.p-24 { padding: 24px; }
.px-4 { padding-left: 4px; padding-right: 4px; }
.px-8 { padding-left: 8px; padding-right: 8px; }
.px-16 { padding-left: 16px; padding-right: 16px; }
.py-4 { padding-top: 4px; padding-bottom: 4px; }
.py-8 { padding-top: 8px; padding-bottom: 8px; }
.py-12 { padding-top: 12px; padding-bottom: 12px; }

/* ── Flex utilities ───────────────────────────────────── */
.flex { display: flex; }
.flex-row { display: flex; flex-direction: row; }
.flex-col { display: flex; flex-direction: column; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 4px; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }

/* ── Grid utilities ───────────────────────────────────── */
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: 1fr 1fr; }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ── Border & styling utilities ──────────────────────── */
.border { border: 1px solid var(--border); }
.border-b { border-bottom: 1px solid var(--border); }
.border-t { border-top: 1px solid var(--border); }
.border-l { border-left: 1px solid var(--border); }
.border-r { border-right: 1px solid var(--border); }
.border-2 { border: 2px solid var(--border); }
.border-dashed { border-style: dashed; }
.rounded { border-radius: var(--radius); }
.rounded-sm { border-radius: var(--radius-sm); }

/* ── Coming soon ──────────────────────────────────────── */
.coming-soon-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    gap: 16px;
}
.coming-soon-icon { font-size: 48px; }
.coming-soon-page h1 { font-size: 24px; }
.coming-soon-page p { color: var(--text-sub); max-width: 380px; }
.coming-soon-box {
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    color: var(--text-sub);
}

/* ── Login page ───────────────────────────────────────── */
.login-body { background: var(--bg); }
.login-page { display: flex; min-height: 100vh; }

.login-brand-panel {
    width: 420px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 48px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}
.login-brand-content { position: relative; z-index: 2; }
.login-logos {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}
.login-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
}
.login-stockaxis-logo {
    display: flex;
    align-items: center;
}
.login-logo-main {
    height: 36px;
    width: auto;
    object-fit: contain;
}

/* Language toggle on login form panel */
.lang-toggle-login {
    position: absolute;
    top: 24px;
    right: 32px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.login-tagline {
    font-size: 16px;
    color: var(--text-sub);
    line-height: 1.5;
    margin-bottom: 32px;
}
.login-version {
    display: inline-block;
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-input);
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid var(--border);
}
.login-brand-decoration {
    position: absolute;
    width: 300px; height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(232,184,75,0.06) 0%, transparent 70%);
    bottom: -80px; right: -80px;
}

.login-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
}
.login-form-container { width: 100%; max-width: 400px; }
.login-heading {
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 6px;
}
.login-sub { color: var(--text-sub); font-size: 14px; margin-bottom: 32px; }
.login-error {
    background: rgba(232,85,85,0.1);
    border: 1px solid rgba(232,85,85,0.3);
    color: var(--danger);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 20px;
}
.login-form { display: flex; flex-direction: column; gap: 20px; }
.btn-login {
    background: var(--accent);
    color: var(--bg);
    border: none;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    width: 100%;
    letter-spacing: 0.3px;
}
.btn-login:hover { background: var(--accent-dim); }
.login-help { color: var(--text-muted); font-size: 12px; margin-top: 20px; text-align: center; }

/* ── Vendor portal ────────────────────────────────────── */
.vendor-portal { min-height: 100vh; }
.vendor-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.vendor-content { padding: 40px 32px; max-width: 900px; }
.vendor-content h1 { font-size: 24px; margin-bottom: 12px; }
.vendor-note { color: var(--text-sub); margin-bottom: 24px; }
.logout-link { color: var(--text-muted); text-decoration: none; font-size: 13px; margin-left: 16px; }
.logout-link:hover { color: var(--danger); }

/* ── Parts Master ─────────────────────────────────────── */
.search-filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.search-input { min-width: 240px; flex: 1; }
.filter-select { width: auto; min-width: 130px; }

.inactive-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
}
.inactive-toggle input { accent-color: var(--accent); cursor: pointer; }

.parts-count {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    margin-left: auto;
}

/* Part thumbnail */
.part-thumb {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid var(--border);
    display: block;
    filter: none;
    -webkit-filter: none;
    background: white;
    padding: 2px;
}
.part-thumb-placeholder {
    width: 40px;
    height: 40px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 700;
    font-size: 15px;
    color: var(--text-muted);
}
.part-sku-name { font-size: 13.5px; font-weight: 500; color: var(--text); }
.text-sub-cell { color: var(--text-sub); font-size: 13px; }

/* Part type badges */
.badge-pt-standard      { background: rgba(136,146,164,0.12); color: var(--text-sub); }
.badge-pt-sub_assembly  { background: rgba(232,168,59,0.12);  color: var(--warning); }
.badge-pt-finished_good { background: rgba(62,207,108,0.12);  color: var(--success); }

/* Small flags on SKU name */
.part-flag {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    background: rgba(136,146,164,0.1);
    color: var(--text-muted);
    letter-spacing: 0.4px;
}
.part-flag-metal { background: rgba(232,168,59,0.1);  color: var(--warning); }
.part-flag-paint { background: rgba(232,184,75,0.12); color: var(--accent); }

/* Photo upload area */
.photo-upload-area {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 80px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color 0.15s;
    overflow: hidden;
    text-align: center;
}
.photo-upload-area:hover { border-color: var(--accent); }

/* Flags box inside modal */
.flags-box {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 16px;
}

/* Material spec rows */
.spec-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px solid var(--border);
}
.spec-row:last-child { border-bottom: none; }
.spec-tag {
    flex: 1;
    font-size: 13px;
    color: var(--text);
}
.spec-edit-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    transition: color 0.15s;
}
.spec-edit-btn:hover { color: var(--accent); }
.spec-remove-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    transition: color 0.15s;
}
.spec-remove-btn:hover { color: var(--danger); }

/* Part detail pop-up */
.detail-top {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
}
.detail-photo-wrap { flex-shrink: 0; }
.detail-photo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid var(--border);
    display: block;
    filter: none;
    -webkit-filter: none;
    background: white;
    padding: 4px;
}
.detail-photo-placeholder {
    width: 120px;
    height: 120px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 700;
    font-size: 36px;
    color: var(--text-muted);
}
.detail-fields {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 28px;
    align-content: start;
}
.detail-field-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 2px;
}
.detail-field-value { font-size: 13.5px; color: var(--text); }
.detail-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
.detail-stat-box {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
}
.detail-stat-label { font-size: 11px; color: var(--text-muted); margin-bottom: 5px; }
.detail-stat-value { font-size: 22px; font-weight: 500; color: var(--text); letter-spacing: -0.5px; }
.detail-flags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.detail-flag {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(136,146,164,0.1);
    color: var(--text-sub);
}
.detail-flag-metal { background: rgba(232,168,59,0.12); color: var(--warning); }
.detail-flag-paint { background: rgba(232,184,75,0.12); color: var(--accent); }
.detail-bom-note {
    padding-top: 14px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
}

/* ── Column header filters (Excel-style) ─────────────── */
.col-filterable { position: relative; overflow: visible; }
.col-header-wrap {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}

/* Type segmented filter */
.type-seg-wrap {
    display: flex;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}
.type-seg {
    background: transparent;
    border: none;
    border-right: 1px solid var(--border);
    color: var(--text-muted);
    padding: 6px 12px;
    font-size: 12.5px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: Arial, Helvetica, sans-serif;
    white-space: nowrap;
}
.type-seg:last-child { border-right: none; }
.type-seg:hover  { background: var(--bg-input); color: var(--text); }
.type-seg.active { background: var(--accent); color: #fff; font-weight: 600; }
.col-filter-btn {
    background: none;
    border: 1px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 11px;
    padding: 2px 5px;
    border-radius: 3px;
    line-height: 1;
    flex-shrink: 0;
    transition: all 0.15s;
}
.col-filter-btn:hover,
.col-filter-btn.open-state { color: var(--accent); background: rgba(37,99,235,0.1); border-color: rgba(37,99,235,0.2); }
.col-filter-btn.active      { color: var(--accent); font-weight: 700; }
.col-filter-panel {
    display: none;
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    min-width: 160px;
    max-height: 220px;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    z-index: 300;
}
.col-filter-panel.open { display: block; }
.cf-option {
    padding: 8px 14px;
    font-size: 12.5px;
    font-weight: 400;
    color: var(--text-sub);
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
}
.cf-option:last-child { border-bottom: none; }
.cf-option:hover { background: var(--bg-input); color: var(--text); }
.cf-selected { color: var(--accent) !important; font-weight: 600; }
.cf-clear { color: var(--text-muted); font-style: italic; }

/* ── Vendors ──────────────────────────────────────────── */
.vendor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}
.vendor-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all 0.2s;
}
.vendor-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.vendor-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}
.vendor-card-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}
.vendor-card-contact { font-size: 12.5px; color: var(--text-sub); }
.vendor-card-details {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
    min-height: 20px;
}
.vendor-detail-item { font-size: 12px; color: var(--text-muted); }
.vendor-card-actions { display: flex; gap: 8px; }

.badge-vtype-active    { background: rgba(37,99,235,0.12); color: var(--accent); }
.badge-vtype-potential { background: rgba(136,146,164,0.12); color: var(--text-sub); }

/* Vendor profile detail grid */
.vp-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 24px;
}
.vp-detail-row { display: flex; flex-direction: column; gap: 2px; }
.vp-full { grid-column: 1 / -1; }
.vp-detail-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
.vp-detail-value { font-size: 13.5px; color: var(--text); }

/* Costing template table tweaks */
.template-row td { padding: 8px 16px; }
.template-row input.form-input,
.template-row select.form-input { padding: 6px 10px; font-size: 13px; }

/* ── Costing matrix scrollable container ───────────── */
.costing-scroll-wrap {
    max-height: 520px;
    overflow-y: auto;
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
}
.costing-sticky-hdr {
    position: sticky;
    top: 0;
    z-index: 4;
    background: var(--bg-card);
}
.costing-sticky-col {
    position: sticky;
    left: 0;
    z-index: 3;
    background: var(--bg-card);
    border-right: 2px solid var(--border);
}
/* Both sticky (top-left corner cell) */
.costing-sticky-col.costing-sticky-hdr { z-index: 5; }

/* ── Parts tag picker (moulds linked parts) ─────────── */
.parts-tag-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
    min-height: 0;
}
.parts-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(37,99,235,0.15);
    color: var(--accent);
    border: 1px solid rgba(37,99,235,0.3);
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 12px;
}
.parts-tag button {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
}

.parts-search-results {
    border: none;
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
}
.parts-search-results:empty {
    display: none;
}
.parts-search-result-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
}
.parts-search-result-item:hover {
    background: var(--bg-card);
}
.parts-search-result-group {
    padding: 6px 12px 2px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-sub);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ── Error Page ────────────────────────────────────────── */
.error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    gap: 16px;
}
.error-code {
    font-family: 'Syne', sans-serif;
    font-size: 96px;
    font-weight: 800;
    color: var(--accent);
    opacity: 0.3;
    line-height: 1;
}

/* ── Hamburger Menu ────────────────────────────────────────── */
.hamburger-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 200;
}
.hamburger-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.3s;
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}
.sidebar-overlay.active {
    display: block;
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 1024px) {
    .dashboard-grid { grid-template-columns: repeat(3, 1fr); }
    .detail-fields { grid-template-columns: 1fr; }
    .detail-stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .hamburger-btn {
        display: flex;
    }
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 100;
    }
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        padding: 16px;
        padding-top: 56px;
    }
    .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
    .login-brand-panel { display: none; }
    .form-row { grid-template-columns: 1fr; }
    .search-filter-bar { flex-direction: column; align-items: stretch; }
    .search-input, .filter-select { width: 100%; }
    .detail-top { flex-direction: column; }
    .detail-stats { grid-template-columns: 1fr; }
}

/* ── Top Loading Bar ────────────────────────── */
#top-loader {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--accent);
    z-index: 9999;
    width: 0;
    transition: width 0.8s ease;
    box-shadow: 0 0 8px var(--accent);
    border-radius: 0 2px 2px 0;
}

/* ── Image Lightbox ─────────────────────────────────────── */
.image-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 90vw;
    height: 90vh;
}

.lightbox-image {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius);
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: var(--text);
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.lightbox-close:hover {
    color: var(--accent);
}

@media (max-width: 768px) {
    .lightbox-close {
        top: 10px;
        right: 10px;
        background: rgba(0, 0, 0, 0.5);
        border-radius: 50%;
    }
}
