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

    body {
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
      background: #0A0A0A;
      min-height: 100vh;
      color: #fff;
      display: flex;
      flex-direction: column;
    }

    /* ---- NAV ---- */
    .topnav {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 2.5rem;
      height: 60px;
      background: #000;
      border-bottom: 3px solid #CC1F1F;
      position: sticky;
      top: 0;
      z-index: 100;
    }

    .topnav-left {
      display: flex;
      align-items: center;
      gap: 2.5rem;
    }

    .logo {
      font-size: 22px;
      font-weight: 700;
      color: #fff;
      letter-spacing: -0.5px;
      text-transform: uppercase;
      text-decoration: none;
    }

    .logo span {
      color: #CC1F1F;
    }

    .back-btn {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 8px 14px;
      font-size: 13px;
      font-weight: 600;
      color: rgba(255, 255, 255, 0.5);
      text-decoration: none;
      border-radius: 6px;
      transition: color 0.15s, background 0.15s;
    }

    .back-btn:hover {
      color: #fff;
      background: rgba(255, 255, 255, 0.05);
    }

    .back-btn i {
      font-size: 17px;
    }

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

    .nav-icon-btn {
      width: 36px;
      height: 36px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 6px;
      color: rgba(255, 255, 255, 0.5);
      font-size: 20px;
      cursor: pointer;
      transition: color 0.15s, background 0.15s;
      border: none;
      background: none;
      text-decoration: none;
    }

    .nav-icon-btn:hover {
      color: #fff;
      background: rgba(255, 255, 255, 0.05);
    }

    /* ---- LAYOUT ---- */
    .main {
      max-width: 900px;
      margin: 0 auto;
      padding: 2.5rem 2rem 4rem;
      flex: 1;
      width: 100%;
    }

    /* ---- HERO ---- */
    .profile-hero {
      background: linear-gradient(135deg, #111 0%, #1A1A1A 100%);
      border: 1px solid rgba(255, 255, 255, 0.07);
      border-radius: 14px;
      padding: 2rem 2rem 1.75rem;
      margin-bottom: 1.5rem;
      position: relative;
      overflow: visible;
    }

    .profile-hero::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 4px;
      background: linear-gradient(90deg, #CC1F1F, #FF4444);
      border-radius: 12px 12px 0 0;
    }

    .hero-body {
      display: flex;
      align-items: flex-start;
      gap: 1.5rem;
    }

    .hero-avatar {
      width: 88px;
      height: 88px;
      border-radius: 50%;
      background: linear-gradient(135deg, #CC1F1F, #A81818);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 32px;
      font-weight: 700;
      flex-shrink: 0;
      letter-spacing: -1px;
      border: 3px solid rgba(255, 255, 255, 0.1);
      transition: background 0.3s;
      overflow: hidden;
      position: relative;
    }

    .hero-avatar img {
      width: 100%; height: 100%; object-fit: cover; display: block;
      position: absolute; top: 0; left: 0; border-radius: 50%;
    }
    .hero-avatar-wrap { position: relative; flex-shrink: 0; }
    .hero-avatar-edit {
      display: none; position: absolute; bottom: 0; right: 0; width: 28px; height: 28px;
      border-radius: 50%; background: #333; border: 2px solid #111; color: #fff;
      align-items: center; justify-content: center; cursor: pointer; font-size: 13px;
      transition: background 0.15s; z-index: 2;
    }
    .hero-avatar-edit:hover { background: #555; }
    body.is-editing .hero-avatar-edit { display: flex; }
    body.light.is-editing .hero-avatar-edit { display: flex; background: #e5e7eb; border-color: #fff; color: #333; }
    body.light .hero-avatar-edit:hover { background: #d1d5db; }
    .hero-avatar-menu {
      position: absolute; top: 100%; left: 0; margin-top: 6px; background: #1a1a1a;
      border: 1px solid #333; border-radius: 8px; padding: 4px 0; z-index: 50;
      min-width: 150px; display: none;
    }
    .hero-avatar-menu.open { display: block; }
    .hero-avatar-menu-item {
      display: flex; align-items: center; gap: 8px; padding: 8px 14px; font-size: 13px;
      color: rgba(255,255,255,0.8); cursor: pointer; border: none; background: none; width: 100%;
    }
    .hero-avatar-menu-item:hover { background: rgba(255,255,255,0.05); }
    .hero-avatar-menu-item.danger { color: #ef4444; }
    body.light .hero-avatar-menu { background: #fff; border-color: #e5e7eb; }
    body.light .hero-avatar-menu-item { color: #333; }
    body.light .hero-avatar-menu-item:hover { background: rgba(0,0,0,0.04); }

    .hero-info {
      flex: 1;
      min-width: 0;
    }

    .hero-name-row {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 4px;
      flex-wrap: wrap;
    }

    .hero-name {
      font-size: 26px;
      font-weight: 700;
      letter-spacing: -0.5px;
    }

    .role-badge {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 3px 10px;
      border-radius: 20px;
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.06em;
    }

    .role-badge.admin {
      background: rgba(204, 31, 31, 0.2);
      color: #FF6B6B;
      border: 1px solid rgba(204, 31, 31, 0.3);
    }

    .role-badge.dealer {
      background: rgba(59, 130, 246, 0.15);
      color: #60A5FA;
      border: 1px solid rgba(59, 130, 246, 0.25);
    }

    .hero-dealership {
      font-size: 14px;
      color: rgba(255, 255, 255, 0.45);
      margin-bottom: 8px;
    }

    .hero-email {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      font-size: 13px;
      color: rgba(255, 255, 255, 0.3);
    }

    .hero-email i {
      font-size: 14px;
    }

    .hero-actions {
      display: flex;
      gap: 8px;
      align-items: center;
      margin-left: auto;
      flex-shrink: 0;
    }

    /* ---- BUTTONS ---- */
    .btn {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 9px 16px;
      font-size: 13px;
      font-weight: 700;
      letter-spacing: 0.03em;
      border-radius: 7px;
      border: none;
      cursor: pointer;
      transition: background 0.15s, opacity 0.15s;
      white-space: nowrap;
    }

    .btn i {
      font-size: 15px;
    }

    .btn-primary {
      background: #CC1F1F;
      color: #fff;
    }

    .btn-primary:hover {
      background: #A81818;
    }

    .btn-outline {
      background: transparent;
      color: rgba(255, 255, 255, 0.65);
      border: 1.5px solid rgba(255, 255, 255, 0.15);
    }

    .btn-outline:hover {
      color: #fff;
      border-color: rgba(255, 255, 255, 0.3);
      background: rgba(255, 255, 255, 0.04);
    }

    .btn-ghost {
      background: rgba(255, 255, 255, 0.06);
      color: rgba(255, 255, 255, 0.7);
    }

    .btn-ghost:hover {
      background: rgba(255, 255, 255, 0.1);
      color: #fff;
    }

    /* Edit mode button visibility */
    .edit-btn {}

    .save-btn,
    .cancel-btn {
      display: none;
    }

    body.is-editing .edit-btn {
      display: none;
    }

    body.is-editing .save-btn {
      display: inline-flex;
    }

    body.is-editing .cancel-btn {
      display: inline-flex;
    }

    /* ---- CARDS GRID ---- */
    .cards-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 1.25rem;
      margin-bottom: 1.25rem;
    }

    .card {
      background: #111;
      border: 1px solid rgba(255, 255, 255, 0.06);
      border-radius: 12px;
      overflow: hidden;
    }

    .card-header {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 1rem 1.25rem;
      border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .card-icon {
      width: 32px;
      height: 32px;
      border-radius: 8px;
      background: rgba(204, 31, 31, 0.12);
      display: flex;
      align-items: center;
      justify-content: center;
      color: #CC1F1F;
      font-size: 16px;
      flex-shrink: 0;
    }

    .card-title {
      font-size: 14px;
      font-weight: 700;
    }

    .card-body {
      padding: 1.25rem;
    }

    .card-full {
      grid-column: 1 / -1;
    }

    /* ---- FIELD ROWS ---- */
    .field-row {
      display: flex;
      flex-direction: column;
      gap: 3px;
      margin-bottom: 14px;
    }

    .field-row:last-child {
      margin-bottom: 0;
    }

    .field-label {
      font-size: 10px;
      font-weight: 700;
      letter-spacing: 0.07em;
      text-transform: uppercase;
      color: rgba(255, 255, 255, 0.3);
    }

    /* View mode: styled text */
    .field-view {
      font-size: 14px;
      color: rgba(255, 255, 255, 0.85);
      padding: 2px 0;
      min-height: 22px;
    }

    .field-view.empty {
      color: rgba(255, 255, 255, 0.25);
      font-style: italic;
    }

    /* Edit mode: inputs */
    .field-edit {
      display: none;
    }

    .field-edit input,
    .field-edit textarea,
    .field-edit select {
      width: 100%;
      padding: 8px 11px;
      font-size: 14px;
      border: 1.5px solid rgba(255, 255, 255, 0.1);
      border-radius: 6px;
      background: rgba(255, 255, 255, 0.05);
      color: #fff;
      outline: none;
      font-family: inherit;
      transition: border-color 0.15s;
    }

    .field-edit input:focus,
    .field-edit textarea:focus,
    .field-edit select:focus {
      border-color: #CC1F1F;
    }

    .field-edit input::placeholder,
    .field-edit textarea::placeholder {
      color: rgba(255, 255, 255, 0.2);
    }

    .field-edit textarea {
      resize: vertical;
      min-height: 72px;
      line-height: 1.5;
    }

    .field-edit select {
      appearance: none;
      cursor: pointer;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 12px center;
    }

    .field-edit select option {
      background: #1A1A1A;
    }

    .field-hint {
      font-size: 11px;
      color: rgba(255, 255, 255, 0.2);
      margin-top: 3px;
      display: none;
    }

    body.is-editing .field-view {
      display: none;
    }

    body.is-editing .field-edit {
      display: block;
    }

    body.is-editing .field-hint {
      display: block;
    }

    /* Edit mode highlight: subtle glow on cards */
    body.is-editing .card {
      border-color: rgba(204, 31, 31, 0.2);
    }

    body.is-editing .profile-hero {
      border-color: rgba(204, 31, 31, 0.25);
    }

    /* Editing banner */
    .editing-banner {
      display: none;
      align-items: center;
      gap: 10px;
      background: rgba(204, 31, 31, 0.08);
      border: 1px solid rgba(204, 31, 31, 0.2);
      border-radius: 8px;
      padding: 10px 16px;
      margin-bottom: 1.25rem;
      font-size: 13px;
      color: rgba(255, 255, 255, 0.65);
    }

    .editing-banner i {
      color: #CC1F1F;
      font-size: 16px;
      flex-shrink: 0;
    }

    body.is-editing .editing-banner {
      display: flex;
    }

    /* ---- TAGS (brands / states) ---- */
    .tag-list {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }

    .tag {
      display: inline-flex;
      align-items: center;
      padding: 4px 10px;
      border-radius: 20px;
      font-size: 12px;
      font-weight: 600;
      background: rgba(255, 255, 255, 0.07);
      color: rgba(255, 255, 255, 0.6);
      border: 1px solid rgba(255, 255, 255, 0.08);
    }

    .tag.brand {
      background: rgba(59, 130, 246, 0.1);
      color: #93C5FD;
      border-color: rgba(59, 130, 246, 0.2);
    }

    .tag.state {
      background: rgba(34, 197, 94, 0.1);
      color: #86EFAC;
      border-color: rgba(34, 197, 94, 0.2);
    }

    .tag-empty {
      font-size: 13px;
      color: rgba(255, 255, 255, 0.25);
      font-style: italic;
    }

    /* Checkbox grid for brands/states in edit mode */
    .check-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
      gap: 6px;
      display: none;
    }

    body.is-editing .check-grid {
      display: grid;
    }

    body.is-editing .tag-list {
      display: none;
    }

    .check-item {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 13px;
      color: rgba(255, 255, 255, 0.65);
      cursor: pointer;
      padding: 6px 8px;
      border-radius: 6px;
      border: 1px solid rgba(255, 255, 255, 0.07);
      transition: background 0.12s;
    }

    .check-item:hover {
      background: rgba(255, 255, 255, 0.04);
    }

    .check-item input[type=checkbox] {
      accent-color: #CC1F1F;
      width: 14px;
      height: 14px;
      flex-shrink: 0;
    }

    /* ---- ADMIN-ONLY FIELDS (brands) ---- */
    .admin-only-note {
      display: none;
      font-size: 11px;
      color: rgba(255, 255, 255, 0.3);
      margin-top: 5px;
      display: flex;
      align-items: center;
      gap: 4px;
    }

    .admin-only-note i {
      font-size: 13px;
    }

    body:not(.is-dealer) .admin-only-note {
      display: none;
    }

    body.is-dealer .admin-only-note {
      display: flex;
    }

    /* In edit mode, keep brands as view-only tags for dealers */
    body.is-dealer.is-editing .admin-only-edit .check-grid {
      display: none !important;
    }

    body.is-dealer.is-editing .admin-only-edit .tag-list {
      display: flex !important;
    }

    /* ---- TOAST ---- */
    .toast {
      position: fixed;
      bottom: 24px;
      left: 50%;
      transform: translateX(-50%) translateY(16px);
      background: #1A1A1A;
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 8px;
      padding: 10px 18px;
      font-size: 13px;
      font-weight: 600;
      color: #fff;
      opacity: 0;
      transition: opacity 0.2s, transform 0.2s;
      pointer-events: none;
      z-index: 9999;
      white-space: nowrap;
    }

    .toast.visible {
      opacity: 1;
      transform: translateX(-50%) translateY(0);
    }

    .toast i {
      margin-right: 6px;
      color: #22C55E;
    }

    /* ---- LIGHT MODE ---- */
    body.light {
      background: #F5F5F5;
      color: #111;
    }

    body.light .topnav {
      background: #fff;
      border-bottom-color: #CC1F1F;
    }

    body.light .logo {
      color: #111;
    }

    body.light .back-btn {
      color: rgba(0, 0, 0, 0.5);
    }

    body.light .back-btn:hover {
      color: #111;
      background: rgba(0, 0, 0, 0.05);
    }

    body.light .nav-icon-btn {
      color: rgba(0, 0, 0, 0.45);
    }

    body.light .nav-icon-btn:hover {
      color: #111;
      background: rgba(0, 0, 0, 0.05);
    }

    body.light .profile-hero {
      background: linear-gradient(135deg, #fff 0%, #F8F8F8 100%);
      border-color: rgba(0, 0, 0, 0.08);
    }

    body.light .hero-name {
      color: #111;
    }

    body.light .hero-dealership {
      color: rgba(0, 0, 0, 0.45);
    }

    body.light .hero-email {
      color: rgba(0, 0, 0, 0.35);
    }

    body.light .card {
      background: #fff;
      border-color: rgba(0, 0, 0, 0.07);
    }

    body.light .card-header {
      border-bottom-color: rgba(0, 0, 0, 0.06);
    }

    body.light .card-title {
      color: #111;
    }

    body.light .field-label {
      color: rgba(0, 0, 0, 0.4);
    }

    body.light .field-view {
      color: rgba(0, 0, 0, 0.8);
    }

    body.light .field-view.empty {
      color: rgba(0, 0, 0, 0.25);
    }

    body.light .field-edit input,
    body.light .field-edit textarea,
    body.light .field-edit select {
      background: #F7F7F7;
      border-color: rgba(0, 0, 0, 0.12);
      color: #111;
    }

    body.light .field-edit input::placeholder,
    body.light .field-edit textarea::placeholder {
      color: rgba(0, 0, 0, 0.25);
    }

    body.light .field-hint {
      color: rgba(0, 0, 0, 0.3);
    }

    body.light .tag {
      background: rgba(0, 0, 0, 0.05);
      color: rgba(0, 0, 0, 0.55);
      border-color: rgba(0, 0, 0, 0.08);
    }

    body.light .check-item {
      color: rgba(0, 0, 0, 0.65);
      border-color: rgba(0, 0, 0, 0.08);
    }

    body.light .check-item:hover {
      background: rgba(0, 0, 0, 0.03);
    }

    body.light .editing-banner {
      background: rgba(204, 31, 31, 0.05);
      color: rgba(0, 0, 0, 0.65);
    }

    body.light .editing-banner strong {
      color: #111 !important;
    }

    body.light .toast {
      background: #fff;
      border-color: rgba(0, 0, 0, 0.1);
      color: #111;
    }

    body.light .btn-outline {
      color: rgba(0, 0, 0, 0.6);
      border-color: rgba(0, 0, 0, 0.15);
    }

    body.light .btn-outline:hover {
      color: #111;
      border-color: rgba(0, 0, 0, 0.3);
      background: rgba(0, 0, 0, 0.04);
    }

    body.light .btn-ghost {
      background: rgba(0, 0, 0, 0.06);
      color: rgba(0, 0, 0, 0.65);
    }

    body.light .btn-ghost:hover {
      background: rgba(0, 0, 0, 0.1);
      color: #111;
    }

    body.light .tag-empty {
      color: rgba(0, 0, 0, 0.3);
    }

    body.light .field-edit select option {
      background: #fff;
      color: #111;
    }

    body.light .admin-only-note {
      color: rgba(0, 0, 0, 0.4);
    }

    body.light .hero-avatar {
      border-color: rgba(0, 0, 0, 0.1);
    }

    body.light .bottombar {
      background: #fff;
      border-top-color: #E8E8E8;
    }

    body.light .bottombar-left {
      color: #999;
    }

    body.light .bottombar-right a {
      color: #999;
    }

    body.light .bottombar-right a:hover {
      color: #555;
    }

    body.light .role-badge.admin {
      color: #CC1F1F;
      background: rgba(204, 31, 31, 0.08);
      border-color: rgba(204, 31, 31, 0.2);
    }

    body.light .role-badge.dealer {
      color: #2563EB;
      background: rgba(59, 130, 246, 0.08);
      border-color: rgba(59, 130, 246, 0.2);
    }

    /* ---- RESPONSIVE ---- */
    @media (max-width: 700px) {
      .topnav {
        padding: 0 1rem;
      }

      .main {
        padding: 1.5rem 1rem 3rem;
      }

      .cards-grid {
        grid-template-columns: 1fr;
      }

      .card-full {
        grid-column: 1;
      }

      .hero-body {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
      }

      .hero-actions {
        margin-left: 0;
      }

      .hero-avatar {
        width: 72px;
        height: 72px;
        font-size: 26px;
      }

      .hero-name {
        font-size: 22px;
      }
    }
  