/* ============================================================
   UTSERVIO BILL STUDIO — Core Styles
   ============================================================ */

   :root {
    --bg1: #0A0A0A;
    --bg2: #111111;
    --bg3: #1A1A1A;
    --bg4: #222222;
    --text1: #FFFFFF;
    --text2: #E0E0E0;
    --text3: #888888;
    --text4: #555555;
    --gold: #F5A623;
    --gold-light: #FFB84D;
    --gold-dark: #C4841A;
    --border: #222222;
    --border2: #333333;
    --danger: #EF4444;
    --success: #10B981;
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 14px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --transition: 0.2s cubic-bezier(.4, 0, .2, 1);
  }
  
  [data-theme="light"] {
    --bg1: #FFFFFF;
    --bg2: #F5F5F5;
    --bg3: #ECECEC;
    --bg4: #E0E0E0;
    --text1: #111111;
    --text2: #333333;
    --text3: #777777;
    --text4: #AAAAAA;
    --border: #E0E0E0;
    --border2: #CCCCCC;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  }
  
  /* Special Pricing Theme overrides */
  body.special-theme {
    --gold: #8B5CF6;
    --gold-light: #A78BFA;
    --gold-dark: #7C3AED;
  }
  
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html, body { height: 100%; overflow: hidden; }
  body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg1);
    color: var(--text2);
    -webkit-font-smoothing: antialiased;
    display: flex; flex-direction: column;
  }
  
  /* ---- TOPBAR ---- */
  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    flex-shrink: 0;
    padding: 0 24px;
    background: linear-gradient(90deg, #080808 0%, #0D0D0D 50%, #080808 100%);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(245,166,35,0.15), 0 4px 20px rgba(0,0,0,0.6);
    border-bottom: none;
    z-index: 100;
    position: relative;
    transition: background var(--transition), border-color var(--transition);
  }
  .topbar::after {
    content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(245,166,35,0.4) 30%, rgba(245,166,35,0.6) 50%, rgba(245,166,35,0.4) 70%, transparent 100%);
    pointer-events: none;
  }
  [data-theme="light"] .topbar { background: linear-gradient(90deg, #FFFFFF 0%, #FEFEFE 50%, #FFFFFF 100%); border-bottom: 1px solid rgba(0, 0, 0, 0.08); box-shadow: 0 1px 0 rgba(245,166,35,0.2), 0 4px 16px rgba(0,0,0,0.06); }
  
  .topbar-left { display: flex; align-items: center; gap: 16px; }
  .logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
  .logo img { height: 28px; }
  .logo-product { font-size: 13px; font-weight: 700; color: var(--gold); letter-spacing: 1px; text-transform: uppercase; }
  .topbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  
  /* Buttons */
  .btn {
    display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px;
    border-radius: var(--radius-sm); font-size: 12px; font-weight: 600;
    font-family: inherit; border: none; cursor: pointer; transition: all var(--transition); white-space: nowrap;
  }
  .btn:active { transform: scale(0.96); }
  
  .btn-ghost { background: rgba(255, 255, 255, 0.03); color: var(--text2); border: 1px solid rgba(255, 255, 255, 0.08); }
  [data-theme="light"] .btn-ghost { background: rgba(0, 0, 0, 0.02); border: 1px solid rgba(0, 0, 0, 0.08); }
  .btn-ghost:hover { background: rgba(255, 255, 255, 0.08); color: var(--text1); border-color: rgba(255, 255, 255, 0.15); }
  [data-theme="light"] .btn-ghost:hover { background: rgba(0, 0, 0, 0.05); border-color: rgba(0, 0, 0, 0.15); }
  
  .btn-icon { padding: 8px 10px; }
  
  .btn-gold { background: linear-gradient(135deg, var(--gold), var(--gold-light)); color: #0A0A0A; box-shadow: 0 4px 14px rgba(245, 166, 35, 0.25); }
  body.special-theme .btn-gold { box-shadow: 0 4px 14px rgba(139, 92, 246, 0.25); color: #fff; }
  .btn-gold:hover { box-shadow: 0 6px 20px rgba(245, 166, 35, 0.45); transform: translateY(-1px); }
  body.special-theme .btn-gold:hover { box-shadow: 0 6px 20px rgba(139, 92, 246, 0.45); }
  .btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }
  
  /* User/Waffle Menu */
  .user-menu-wrap { position: relative; }
  .avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--gold-light)); color: #0A0A0A;
    font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all var(--transition); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  }
  body.special-theme .avatar { color: #fff; }
  .avatar:hover { transform: scale(1.06); box-shadow: 0 0 12px rgba(245, 166, 35, 0.4); }
  
  .user-dropdown {
    position: absolute; top: calc(100% + 8px); right: 0; width: 220px;
    background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: all var(--transition); z-index: 200;
  }
  .user-dropdown.open { opacity: 1; visibility: visible; transform: translateY(0); }
  
  .user-dropdown-header { padding: 12px 14px; }
  .user-dropdown-name { font-size: 13px; font-weight: 600; color: var(--text1); }
  .user-dropdown-email { font-size: 11px; color: var(--text3); margin-top: 2px; }
  .user-dropdown-divider { height: 1px; background: var(--border); margin: 0 10px; }
  .user-dropdown-item {
    display: flex; align-items: center; gap: 8px; padding: 9px 14px;
    font-size: 12px; color: var(--text2); text-decoration: none; transition: background var(--transition);
  }
  .user-dropdown-item:hover { background: var(--bg3); }
  .user-dropdown-item.danger { color: var(--danger); }
  
  /* Waffle Items */
  .waffle-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 8px; text-decoration: none; transition: background 0.2s; text-align: center; }
  .waffle-item:hover { background: rgba(255, 255, 255, 0.04); }
  [data-theme="light"] .waffle-item:hover { background: rgba(0, 0, 0, 0.03); }
  .waffle-sq { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; border: 1px solid rgba(255, 255, 255, 0.15); transition: transform 0.2s, box-shadow 0.2s; }
  [data-theme="light"] .waffle-sq { border-color: rgba(0, 0, 0, 0.08); }
  .waffle-item:hover .waffle-sq { transform: translateY(-3px) scale(1.04); box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4); }
  [data-theme="light"] .waffle-item:hover .waffle-sq { box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08); }
  .waffle-sq svg { width: 26px; height: 26px; color: #ffffff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; display: block; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2)); }
  .waffle-item span { font-size: 9px; font-weight: 600; color: var(--text2); line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; height: 24px; max-width: 76px; margin-top: 4px; transition: color 0.2s; text-transform: none; letter-spacing: normal; }
  .waffle-item:hover span { color: var(--gold) !important; }
  
  /* ---- MAIN LAYOUT ---- */
  .main-layout { display: flex; flex: 1; min-height: 0; overflow: hidden; position: relative; width: 100%; }
  
  .main-layout::before {
    content: ""; position: absolute; top: -10%; right: -10%; width: 50vw; height: 50vw;
    background: radial-gradient(circle, rgba(245, 166, 35, 0.05) 0%, transparent 70%); pointer-events: none; z-index: 0; transition: background 0.3s;
  }
  .main-layout::after {
    content: ""; position: absolute; bottom: -10%; left: -10%; width: 40vw; height: 40vw;
    background: radial-gradient(circle, rgba(245, 166, 35, 0.03) 0%, transparent 70%); pointer-events: none; z-index: 0; transition: background 0.3s;
  }
  body.special-theme .main-layout::before { background: radial-gradient(circle, rgba(139, 92, 246, 0.05) 0%, transparent 70%); }
  body.special-theme .main-layout::after { background: radial-gradient(circle, rgba(139, 92, 246, 0.03) 0%, transparent 70%); }
  
  /* ---- LEFT PANEL (SERVICES) ---- */
  .services-panel {
    flex: 1;
    background: rgba(17, 17, 17, 0.7); backdrop-filter: blur(16px);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex; flex-direction: column; overflow: hidden; position: relative; z-index: 10;
  }
  [data-theme="light"] .services-panel { background: rgba(245, 245, 245, 0.8); border-right: 1px solid rgba(0, 0, 0, 0.08); }
  
  .panel-header {
    padding: 20px; display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--border);
  }
  
  .panel-title { font-size: 15px; font-weight: 700; color: var(--text1); }
  
  /* Search / Custom Box */
  .toolbar-box {
    padding: 16px 20px; border-bottom: 1px solid var(--border);
    background: rgba(0,0,0,0.1);
  }
  [data-theme="light"] .toolbar-box { background: rgba(255,255,255,0.5); }
  
  .bill-input {
    width: 100%; padding: 10px 12px; font-size: 13px;
    background: rgba(0, 0, 0, 0.2); color: var(--text1); border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm); font-family: inherit; outline: none; transition: all 0.2s;
  }
  [data-theme="light"] .bill-input { background: rgba(255, 255, 255, 0.8); border: 1px solid rgba(0, 0, 0, 0.1); color: var(--text1); }
  .bill-input:focus { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(245, 166, 35, 0.1); }
  
  .custom-item-row { display: flex; gap: 8px; margin-top: 8px; }
  
  /* Services Scroll Area */
  .services-scroll {
    flex: 1; overflow-y: auto; padding: 20px;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; align-content: start;
  }
  .services-scroll::-webkit-scrollbar { width: 4px; }
  .services-scroll::-webkit-scrollbar-track { background: transparent; }
  .services-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 4px; }
  [data-theme="light"] .services-scroll::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.08); }
  
  /* Service Card */
  .service-card {
    background: rgba(255, 255, 255, 0.02); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px;
    transition: all 0.2s; position: relative; overflow: hidden;
  }
  [data-theme="light"] .service-card { background: rgba(0, 0, 0, 0.01); border-color: rgba(0, 0, 0, 0.06); }
  
  .service-card:hover { border-color: rgba(245, 166, 35, 0.4); background: rgba(245, 166, 35, 0.04); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(245,166,35,0.06); }
  body.special-theme .service-card:hover { border-color: rgba(139, 92, 246, 0.4); background: rgba(139, 92, 246, 0.04); box-shadow: 0 6px 20px rgba(139,92,246,0.06); }
  
  .service-card.active-service { border-color: var(--gold); background: rgba(245, 166, 35, 0.08); box-shadow: 0 0 20px rgba(245, 166, 35, 0.12); }
  body.special-theme .service-card.active-service { border-color: var(--gold); background: rgba(139, 92, 246, 0.08); box-shadow: 0 0 20px rgba(139, 92, 246, 0.12); }
  
  .service-card.active-service .service-img, .service-card.active-service .service-emoji-fallback {
    border-color: var(--gold); background: rgba(245,166,35,0.1); box-shadow: 0 0 10px rgba(245, 166, 35, 0.3);
  }
  body.special-theme .service-card.active-service .service-img, body.special-theme .service-card.active-service .service-emoji-fallback {
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.3); background: rgba(139,92,246,0.1);
  }
  
  .service-card-header { display: flex; align-items: center; gap: 12px; }
  
  .service-img {
    width: 44px; height: 44px; border-radius: var(--radius-sm);
    object-fit: cover; flex-shrink: 0; border: 1px solid rgba(255, 255, 255, 0.05);
  }
  [data-theme="light"] .service-img { border-color: rgba(0, 0, 0, 0.04); }

  .service-emoji-fallback {
    width: 44px; height: 44px; border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0;
  }
  [data-theme="light"] .service-emoji-fallback { background: rgba(0, 0, 0, 0.02); border-color: rgba(0, 0, 0, 0.04); }
  
  .service-main h3 { font-size: 14px; font-weight: 600; color: var(--text1); margin-bottom: 4px; }
  .price-display { font-size: 15px; font-weight: 700; color: var(--gold); }
  
  .action-area { margin-top: auto; display: flex; justify-content: flex-end; }
  
  .btn-add-initial {
    background: rgba(255, 255, 255, 0.05); color: var(--text2); border: 1px solid var(--border);
    padding: 6px 16px; border-radius: 20px; font-size: 12px; font-weight: 600; cursor: pointer; transition: 0.2s;
  }
  [data-theme="light"] .btn-add-initial { background: rgba(0, 0, 0, 0.03); }
  .btn-add-initial:hover { background: var(--gold); color: #000; border-color: var(--gold); }
  
  .service-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
  
  .qty-row { display: flex; align-items: center; background: rgba(0,0,0,0.2); border-radius: 4px; overflow: hidden; border: 1px solid var(--border); }
  [data-theme="light"] .qty-row { background: #fff; }
  
  .btn-qty-mini {
    background: transparent; color: var(--text2); border: none; width: 28px; height: 28px;
    font-size: 16px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s;
  }
  .btn-qty-mini:hover { background: rgba(255,255,255,0.1); color: var(--text1); }
  [data-theme="light"] .btn-qty-mini:hover { background: rgba(0,0,0,0.05); }
  
  .qty-display-input { width: 30px; text-align: center; font-weight: 600; font-size: 13px; color: var(--text1); }
  
  .price-row { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text3); }
  .price-input {
    width: 60px; background: transparent; border: none; border-bottom: 1px dashed var(--text3);
    color: var(--text1); font-size: 13px; font-weight: 600; text-align: center; padding: 2px 0; outline: none;
  }
  .price-input:focus { border-color: var(--gold); }
  
  /* ---- RIGHT PANEL (CART) ---- */
  .cart-panel {
    width: 400px; min-width: 400px; background: var(--bg1); position: relative; z-index: 5;
    display: flex; flex-direction: column; overflow: hidden;
    box-shadow: -4px 0 24px rgba(0,0,0,0.2);
  }
  
  .cart-inner { padding: 30px; display: flex; flex-direction: column; gap: 24px; height: 100%; overflow-y: auto; background: radial-gradient(circle at 100% 0%, rgba(255,255,255,0.02) 0%, transparent 50%); }
  
  .cart-header h2 { font-size: 18px; font-weight: 700; color: var(--text1); margin-bottom: 16px; }
  
  .total-card {
    background: linear-gradient(135deg, rgba(245, 166, 35, 0.12) 0%, rgba(245, 166, 35, 0.02) 100%);
    border: 1px solid rgba(245, 166, 35, 0.25);
    border-radius: var(--radius-lg); padding: 24px; text-align: center;
    box-shadow: 0 8px 32px rgba(245, 166, 35, 0.1);
  }
  body.special-theme .total-card {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.12) 0%, rgba(139, 92, 246, 0.02) 100%);
    border-color: rgba(139, 92, 246, 0.25);
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.1);
  }
  
  .total-card-label { font-size: 10px; font-weight: 700; color: var(--gold); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
  .total-card-amount { font-size: 42px; font-weight: 800; color: var(--text1); line-height: 1; margin-bottom: 16px; }
  
  .cart-actions { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
  
  /* Toggles */
  .toggle-wrap { display: flex; align-items: center; gap: 10px; cursor: pointer; }
  .toggle-checkbox { display: none; }
  .toggle-slider {
    position: relative; width: 36px; height: 20px; background: rgba(255,255,255,0.1); border-radius: 20px; transition: 0.3s;
  }
  [data-theme="light"] .toggle-slider { background: rgba(0,0,0,0.1); }
  .toggle-slider::before {
    content: ""; position: absolute; width: 14px; height: 14px; border-radius: 50%; background: #fff;
    top: 3px; left: 3px; transition: 0.3s; box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  }
  .toggle-checkbox:checked + .toggle-slider { background: var(--gold); }
  .toggle-checkbox:checked + .toggle-slider::before { transform: translateX(16px); }
  .toggle-label { font-size: 12px; font-weight: 600; color: var(--text2); }
  
  /* ---- MODALS ---- */
  .modal-backdrop {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: all var(--transition);
  }
  .modal-backdrop.open { opacity: 1; visibility: visible; }
  
  .modal-content {
    background: var(--bg2); width: 500px; max-width: 90%; border-radius: var(--radius-lg);
    border: 1px solid var(--border); box-shadow: 0 16px 40px rgba(0,0,0,0.5);
    display: flex; flex-direction: column; transform: translateY(20px); transition: 0.3s cubic-bezier(.4, 0, .2, 1);
  }
  [data-theme="light"] .modal-content { box-shadow: 0 16px 40px rgba(0,0,0,0.15); }
  .modal-backdrop.open .modal-content { transform: translateY(0); }
  
  .modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
  .modal-title { font-size: 18px; font-weight: 700; color: var(--text1); }
  .modal-close { background: transparent; border: none; color: var(--text3); font-size: 18px; cursor: pointer; }
  .modal-close:hover { color: var(--text1); }
  
  .modal-body { padding: 24px; max-height: 85vh; overflow-y: auto; }
  
  @media (max-width: 600px) {
    .modal-content { max-width: 95%; margin: 10px; }
    .modal-header { padding: 16px; }
    .modal-body { padding: 16px; max-height: 80vh; }
  }
  
  textarea.msg-area {
    width: 100%; min-height: 200px; padding: 16px; font-family: monospace; font-size: 12px;
    background: rgba(0,0,0,0.2); color: var(--text1); border: 1px solid var(--border);
    border-radius: var(--radius-sm); resize: vertical; outline: none;
  }
  [data-theme="light"] textarea.msg-area { background: #fff; border-color: rgba(0,0,0,0.1); }
  
  /* TOAST */
  .toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
    background: rgba(17, 17, 17, 0.95); color: #fff; padding: 10px 20px;
    border-radius: 30px; font-size: 13px; font-weight: 500;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1);
    opacity: 0; visibility: hidden; transition: 0.3s; z-index: 9999;
  }
  .toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
  .toast-gold { border-color: var(--gold); color: var(--gold); }

  /* MOBILE RESPONSIVENESS */
  @media (max-width: 900px) {
    /* Stack layout vertically, scroll whole container */
    .main-layout { flex-direction: column; overflow-y: auto; overflow-x: hidden; }
    
    .services-panel { flex: none; height: auto; border-right: none; order: 2; overflow: visible; }
    
    /* 3 Services in a row */
    .services-scroll { 
      overflow: visible; 
      grid-template-columns: repeat(3, 1fr); 
      padding: 10px; 
      gap: 8px; 
    }
    
    /* Compact service card for mobile 3-column layout */
    .service-card { padding: 8px; gap: 8px; }
    .service-card-header { flex-direction: column; text-align: center; gap: 4px; }
    .service-img, .service-emoji-fallback { width: 32px; height: 32px; font-size: 16px; margin: 0 auto; }
    .service-main h3 { font-size: 11px; line-height: 1.2; margin-bottom: 2px; }
    .price-display { font-size: 12px; }
    .action-area { justify-content: center; }
    .btn-add-initial { padding: 4px 10px; font-size: 11px; }
    .service-controls { gap: 4px; justify-content: center; }
    .qty-row { flex-direction: row; }
    .btn-qty-mini { width: 22px; height: 22px; font-size: 14px; }
    .qty-display-input { width: 22px; font-size: 12px; }
    .price-row { display: none; /* Hide manual price edit on compact mobile card */ }
    
    .cart-panel { 
      width: 100%; min-width: 0; height: auto; 
      border-bottom: 1px solid var(--border); order: 1; flex-shrink: 0;
      box-shadow: none;
    }
    .cart-inner { padding: 16px; overflow: visible; height: auto; gap: 12px; }
    
    /* Topbar adjustments */
    .topbar { 
      height: auto; 
      padding: 12px; 
      flex-direction: column; 
      gap: 12px; 
      align-items: center; 
    }
    .topbar-right { 
      flex-wrap: wrap; 
      justify-content: center; 
      gap: 8px; 
    }
    .logo-product { display: block; }
  }

  /* ---- A4 INVOICE TEMPLATE STYLES ---- */
  .invoice-a4-canvas {
    width: 794px; /* A4 width at 96 DPI */
    height: 1122px; /* A4 height at 96 DPI */
    background: #ffffff;
    color: #333333;
    font-family: 'Inter', sans-serif;
    position: relative;
    padding: 0px 40px 30px 40px;
    box-sizing: border-box;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    isolation: isolate; /* prevent any stacking context bleed */
  }
  
  .invoice-watermark {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) rotate(-30deg);
    font-size: 130px;
    font-weight: 900;
    color: rgba(0, 0, 0, 0.02);
    pointer-events: none;
    z-index: 1;
    white-space: nowrap;
    letter-spacing: 2px;
  }
  
  .invoice-a4-canvas > * { position: relative; z-index: 2; }
  
  .invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
    border-bottom: 2px solid #111111;
    padding-bottom: 24px;
    padding-top: 0;
  }
  
  .invoice-logo-col { display: flex; flex-direction: column; gap: 16px; }
  .invoice-logo { display: flex; align-items: center; gap: 12px; }
  .invoice-brand { font-size: 26px; font-weight: 900; color: #111; letter-spacing: -0.5px; }
  
  .invoice-company-details { font-size: 12px; color: #555; line-height: 1.6; }
  
  .invoice-meta-col { text-align: right; }
  .invoice-title { font-size: 42px; font-weight: 900; color: #111; margin: 0 0 16px 0; letter-spacing: 2px; }
  
  .invoice-meta-grid {
    display: grid; grid-template-columns: auto auto; gap: 6px 16px; text-align: left;
    background: #F8F9FA; padding: 12px 16px; border-radius: 4px; border: 1px solid #EEEEEE;
  }
  .meta-label { font-size: 11px; font-weight: 700; color: #777; text-transform: uppercase; }
  .meta-value { font-size: 13px; font-weight: 600; color: #111; text-align: right; }
  
  .invoice-bill-to-box { margin-bottom: 30px; background: #FFFFFF; border-left: 4px solid #F5A623; padding: 8px 16px; margin-left: 0; }
  .bill-to-label { font-size: 11px; font-weight: 700; color: #888; text-transform: uppercase; margin-bottom: 4px; letter-spacing: 1px; }
  .bill-to-name { font-size: 18px; font-weight: 800; color: #111; }
  .bill-to-address { font-size: 12px; color: #555; }
  
  .invoice-table { width: 100%; border-collapse: collapse; margin-bottom: 40px; }
  .invoice-table th {
    background: #111111; padding: 12px 16px; font-size: 11px; font-weight: 700;
    color: #FFFFFF; text-transform: uppercase; text-align: left; letter-spacing: 0.5px;
  }
  .invoice-table td {
    padding: 14px 16px; border-bottom: 1px solid #EEEEEE; font-size: 13px; color: #333;
  }
  .invoice-table tbody tr:nth-child(even) { background: #FAFAFA; }
  
  .invoice-bottom-grid { display: grid; grid-template-columns: 1fr 320px; gap: 40px; margin-bottom: 50px; }
  
  .invoice-payment-info { font-size: 12px; color: #555; line-height: 1.6; }
  .payment-title { font-size: 11px; font-weight: 700; color: #111; text-transform: uppercase; letter-spacing: 1px; border-bottom: 1px solid #DDD; padding-bottom: 6px; margin-bottom: 10px; }
  
  .invoice-summary { background: #F8F9FA; border: 1px solid #EEE; padding: 20px; border-radius: 4px; }
  .summary-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 13px; color: #555; }
  .summary-row.summary-total {
    border-top: 1px solid #CCC; padding-top: 12px; margin-top: 4px;
    font-size: 22px; font-weight: 900; color: #111;
  }
  
  .invoice-footer {
    display: flex; justify-content: space-between; align-items: flex-end;
    margin-top: auto;
    border-top: 1px solid #EEEEEE; padding-top: 20px;
  }
  
  .terms-title { font-size: 11px; font-weight: 700; color: #111; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
  .invoice-terms { font-size: 10px; color: #777; line-height: 1.6; max-width: 60%; }
  .invoice-signature { text-align: center; font-size: 11px; color: #555; }
  .signature-line { width: 180px; height: 1px; background: #333; margin-bottom: 10px; }
  .signature-brand { font-weight: 800; color: #111; font-size: 13px; margin-top: 2px; }
