/* =====================================================
   MoKont — MERGED STYLESHEET (single source of truth)
   Generated by ChatGPT merge step
   ===================================================== */

/* ===== Design Tokens (Apple Design System) ===== */
:root{
  /* Apple System Colors */
  --apple-blue: #5063ad;
  --apple-blue-hover: #607acc;
  --apple-blue-active: #5063ad;
  --apple-green: #0bac80;
  --apple-green-hover: #0ecc92;
  --apple-green-active: #0bac80;
  --apple-red: #ff3b30;
  --apple-red-hover: #e6342a;
  --apple-red-active: #cc2e24;
  --apple-orange: #ff9500;
  --apple-yellow: #ffcc00;

  /* Apple Grays */
  --apple-gray-50: #fafafa;
  --apple-gray-100: #f5f5f7;
  --apple-gray-200: #e8e8ed;
  --apple-gray-300: #d2d2d7;
  --apple-gray-400: #b0b0b5;
  --apple-gray-500: #86868b;
  --apple-gray-600: #6e6e73;
  --apple-gray-700: #515154;
  --apple-gray-800: #3a3a3c;
  --apple-gray-900: #1d1d1f;

  /* Updated Semantic Colors */
  --bg: #f5f5f7;
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f7;
  --bg-tertiary: #fafafa;
  --bg-elevated: #ffffff;
  --bg-gradient: linear-gradient(180deg, #f5f5f7 0%, #fafafa 100%);

  --card: #ffffff;
  --ink: #1d1d1f;
  --muted: #86868b;
  --black: #1d1d1f;
  --line: #d2d2d7;
  --accent: #5063ad;
  --danger: #ff3b30;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);

  /* Text Colors */
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --text-link: #5063ad;

  /* Border Colors */
  --border-primary: #d2d2d7;
  --border-secondary: #e8e8ed;
  --border-focus: #5063ad;

  /* Apple Spacing (4px grid) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Apple Radius Scale */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Apple Shadow System */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 8px 32px rgba(0, 0, 0, 0.14);
  --shadow-2xl: 0 12px 48px rgba(0, 0, 0, 0.16);

  /* Typography */
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-text: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;

  /* Font Sizes */
  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 15px;
  --text-lg: 17px;
  --text-xl: 19px;
  --text-2xl: 24px;
  --text-3xl: 28px;
  --text-4xl: 34px;

  /* Font Weights */
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Auth (backwards compatibility) */
  --auth-bg: #f5f5f7;
  --auth-card: #ffffff;
  --auth-ink: #1d1d1f;
  --auth-line: #e8e8ed;
  --auth-muted: #86868b;
  --auth-radius: 20px;
  --auth-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);

  /* Legacy (keep for compatibility) */
  --hnry-active: rgba(255,255,255,.12);
  --hnry-hover: rgba(255,255,255,.08);
  --hnry-navy: #001840;
  --hnry-navy-2: #001840;
  --hnry-shadow: 0 8px 24px rgba(0,0,0,.18);
  --hnry-text-dim: rgba(255,255,255,.72);
  --hnry-text-on: rgba(255,255,255,.92);
  --illuA: #ffd44a;
  --illuB: #ff6aa2;
  --illuC: #7c5cff;
  --illuCoin: #ffd44a;
  --illuCoin2: #ff6aa2;
  --line2: rgba(17,24,39,.10);
  --muted2: rgba(17,24,39,.55);

  /* Layout */
  --sidebar-w: 280px;
  --topbar-h: 104px;
--toppad-h: 24px;
}
/* ===== Source: styles_fixed.css ===== */
/* CSS Document */


    *{box-sizing:border-box}
    body{
      margin:0;
      font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
      color:var(--text-primary);
      background:#f3f5fb;
    }
    header{
      padding:20px 0;
      max-width:100%;
      margin:0 auto;
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:12px;
    }
    header .title{
      display:flex;
      flex-direction:column;
      gap:4px;
    }
    header h1{
      font-size:18px;
      margin:0;
      letter-spacing:.2px;
    }
    header p{
      margin:0;
      color:var(--muted);
      font-size:13px;
    }
    header .actions{
      display:flex;
      gap:10px;
      flex-wrap:wrap;
      justify-content:flex-end;
    }

h2{
	padding: 0;
	margin: 0;
}

h3{
	padding: 0;
	margin: 0;
}


/* Global table radius override */

/* ========================================
   UNIFIED TABLE STYLES - Apply to ALL tables
   ======================================== */
table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	  border: 1px solid #e2e8f0;
    border-radius: 8px !important;
	box-shadow:var(--shadow);
}

/* Table Headers - Consistent across all tables */
table thead {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

table th {
  padding: 16px 20px;
  text-align: left !important; /* Force left alignment for all headers */
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.5;
  vertical-align: middle;
  height: 48px; /* Fixed height for consistency */
}

/* Removed right-alignment classes - all content left-aligned */
table th.num,
table th.text-right {
  text-align: left !important;
}

table th.actions {
  white-space: nowrap;
}

/* Table Body Rows - Consistent across all tables */
table tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background-color 0.15s ease;
}

table tbody tr:last-child {
  border-bottom: none;
}

table tbody tr:hover {
  background-color: #f8fafc;
}

/* Remove hover effect from line items table */
#itemsTable tbody tr:hover {
  background-color: transparent;
  transform: none !important;
}

#itemsTable tbody tr {
  transition: none !important;
}

/* Disable hover effects on line items inputs/textareas/selects to prevent shift */
#itemsTable input:hover:not(:focus),
#itemsTable textarea:hover:not(:focus),
#itemsTable select:hover:not(:focus) {
  border-color: #e2e8f0 !important;
  background: #ffffff !important;
  transform: none !important;
}

#itemsTable input,
#itemsTable textarea,
#itemsTable select {
  transition: border-color 0.15s ease !important;
}

#itemsTable td,
#itemsTable th {
  transition: none !important;
}

/* Table Cells - Consistent across all tables */
table td {
  padding: 16px 20px;
  font-size: 14px;
  color: #0f172a;
  line-height: 1.5;
  vertical-align: middle;
  height: 56px; /* Fixed height for consistency */
  text-align: left !important; /* Force left alignment for all cells */
}

/* Removed right-alignment classes - all content left-aligned */
table td.num,
table td.text-right {
  text-align: left !important;
  font-variant-numeric: tabular-nums;
}

table td.actions {
  white-space: nowrap;
}

/* Table Footer - Consistent styling */
table tfoot {
  background: #f8fafc;
  border-top: 2px solid #e2e8f0;
  font-weight: 500;
}

table tfoot th,
table tfoot td {
  padding: 16px 20px;
  font-size: 14px;
  color: #0f172a;
  font-weight: 500;
  line-height: 1.5;
  vertical-align: middle;
  height: 48px; /* Fixed height for consistency */
}

/* Auto-expanding textarea in items table */
#itemsTable textarea {
  width: 100%;
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  overflow: hidden;
  font-family: inherit;
  transition: border-color 0.15s ease;
  box-sizing: border-box;
}

#itemsTable textarea:focus {
  outline: none;
  border-color: #001840;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#itemsTable textarea::placeholder {
  color: #94a3b8;
}

/* Input fields in items table */
#itemsTable input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.5;
  font-family: inherit;
  transition: border-color 0.15s ease;
  box-sizing: border-box;
  min-width: 60px; /* Prevent input from being too narrow */
}

#itemsTable input:focus {
  outline: none;
  border-color: #001840;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#itemsTable select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.5;
  font-family: inherit;
  transition: border-color 0.15s ease;
  box-sizing: border-box;
  background-color: white;
}

#itemsTable select:focus {
  outline: none;
  border-color: #001840;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Ensure table cells accommodate growing textareas */
#itemsTable tr {
  vertical-align: top;
}

/* Enable horizontal scroll on table container */
.items > div:first-child {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f1f5f9;
}

.items > div:first-child::-webkit-scrollbar {
  height: 8px;
}

.items > div:first-child::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 8px;
}

.items > div:first-child::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 8px;
}

.items > div:first-child::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Icon-only button styling */
.icon-only {
  padding: 8px !important;
  min-width: unset !important;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.icon-only svg {
  display: block;
  margin: 0;
}

/* Responsive table improvements */
#itemsTable {
  width: 100%;
  table-layout: auto;
  min-width: 900px; /* Ensure table has minimum width for horizontal scroll */
}

#itemsTable th,
#itemsTable td {
  white-space: nowrap;
  padding: 12px;
}

#itemsTable th:first-child,
#itemsTable td:first-child {
  white-space: normal; /* Allow description to wrap */
}

/* Column widths */
#itemsTable th:nth-child(1),
#itemsTable td:nth-child(1) { min-width: 220px; width: 30%; } /* Description */
#itemsTable th:nth-child(2),
#itemsTable td:nth-child(2) { min-width: 80px; width: 10%; } /* Qty */
#itemsTable th:nth-child(3),
#itemsTable td:nth-child(3) { min-width: 110px; width: 15%; } /* Rate */
#itemsTable th:nth-child(4),
#itemsTable td:nth-child(4) { min-width: 120px; width: 15%; } /* Amount */
#itemsTable th:nth-child(5),
#itemsTable td:nth-child(5) { min-width: 140px; width: 15%; } /* VAT */
#itemsTable th:nth-child(6),
#itemsTable td:nth-child(6) { min-width: 120px; width: 15%; } /* Total */
#itemsTable th:nth-child(7),
#itemsTable td:nth-child(7) { min-width: 60px; width: 60px; text-align: center; } /* Delete */

/* Adjust column widths on smaller screens */
@media (max-width: 1200px) {
  #itemsTable th:nth-child(1) { min-width: 200px; } /* Description */
  #itemsTable th:nth-child(2) { min-width: 70px; }  /* Qty */
  #itemsTable th:nth-child(3) { min-width: 100px; } /* Rate */
  #itemsTable th:nth-child(4) { min-width: 110px; } /* Amount */
  #itemsTable th:nth-child(5) { min-width: 130px; } /* VAT */
  #itemsTable th:nth-child(6) { min-width: 110px; } /* Total */
}

@media (max-width: 992px) {
  #itemsTable {
    min-width: 800px; /* Reduced minimum width for tablets */
  }
  
  #itemsTable th:nth-child(1) { min-width: 180px; }
  #itemsTable th:nth-child(2) { min-width: 65px; }
  #itemsTable th:nth-child(3) { min-width: 90px; }
  #itemsTable th:nth-child(4) { min-width: 100px; }
  #itemsTable th:nth-child(5) { min-width: 120px; }
  #itemsTable th:nth-child(6) { min-width: 100px; }
}

/* Better table scroll on tablets */
@media (max-width: 992px) and (min-width: 769px) {
  .items > div:first-child {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
}



/* ===== Branding (Header) ===== */
.brand-wrap{
  display:flex;
  align-items:center;
  gap:14px;
}

.brand-logo{
  width:120px;
  height:120px;
  border-radius:16px;
  border:1px dashed var(--line);
  background:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  flex-shrink:0;
}

.brand-logo img{
  max-width:100%;
  max-height:100%;
  object-fit:contain;
  display:none; /* shown only when logo is set */
}


#btnSaveHistory{
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}


    /* ===== APPLE BUTTON SYSTEM ===== */
    button, .btn{
      appearance:none;
      border:none;
      margin:0;
      display:inline-flex;
      align-items:center;
      justify-content:center;
      gap:8px;
      padding:11px 20px;
      min-height:44px;
      font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
      font-size:14px;
      font-weight:500;
      line-height:1.2;
      letter-spacing:-0.01em;
      text-align:center;
      border-radius:10px;
      cursor:pointer;
      user-select:none;
      transition:all 200ms cubic-bezier(0.4, 0, 0.2, 1);
      background:white;
      border:1px solid var(--border-primary);
      color:var(--text-primary);
      box-shadow:var(--shadow-sm);
    }
    button:hover, .btn:hover{
      background:var(--apple-gray-100);
      border-color:#b8b8bd;
      box-shadow:var(--shadow-md);
      transform:translateY(-1px);
    }
    button:active, .btn:active{
      background:var(--apple-gray-200);
      box-shadow:var(--shadow-sm);
      transform:translateY(0);
    }
    button:focus-visible, .btn:focus-visible{
      outline:2px solid var(--apple-blue);
      outline-offset:2px;
    }
    /* PRIMARY BUTTON (Blue) */
    button.primary, .btn-primary{
      background:var(--apple-blue);
      border:1px solid var(--apple-blue);
      color:white;
      font-weight:600;
      box-shadow:0 2px 8px rgba(0, 122, 255, 0.25);
    }
    button.primary:hover, .btn-primary:hover{
      background:var(--apple-blue-hover);
      border-color:var(--apple-blue-hover);
      box-shadow:0 4px 12px rgba(0, 122, 255, 0.35);
    }
    button.primary:active, .btn-primary:active{
      background:var(--apple-blue-active);
      transform:translateY(0);
    }
    /* CTA/SUCCESS BUTTON (Green) */
    button.cta, button.success, .btn-cta, .btn-success{
      background:var(--apple-green);
      border:1px solid var(--apple-green);
      color:white;
      font-weight:600;
      box-shadow:0 2px 8px rgba(52, 199, 89, 0.25);
    }
    button.cta:hover, button.success:hover, .btn-cta:hover, .btn-success:hover{
      background:var(--apple-green-hover);
      border-color:var(--apple-green-hover);
      box-shadow:0 4px 12px rgba(52, 199, 89, 0.35);
    }
    button.cta:active, button.success:active, .btn-cta:active, .btn-success:active{
      background:var(--apple-green-active);
      transform:translateY(0);
    }
    /* SECONDARY BUTTON */
    button.secondary, .btn-secondary{
      background:white;
      border:1px solid var(--border-primary);
      color:var(--text-primary);
    }
    /* DANGER/DELETE BUTTON (Red) */
    button.danger, .btn-danger{
      background:white;
      border:1.5px solid var(--apple-red);
      color:var(--apple-red);
      font-weight:600;
    }
    button.danger:hover, .btn-danger:hover{
      background:#fff5f5;
      border-color:var(--apple-red-hover);
      color:var(--apple-red-hover);
      box-shadow:0 2px 8px rgba(255, 59, 48, 0.15);
    }
    button.danger:active, .btn-danger:active{
      background:#ffe5e5;
      transform:translateY(0);
    }
    /* DISABLED BUTTON */
    button:disabled, button.inactive, .btn:disabled, .btn-inactive{
      background:var(--apple-gray-100);
      border-color:#e5e5ea;
      color:#c7c7cc;
      cursor:not-allowed;
      box-shadow:none;
      transform:none !important;
    }
    button:disabled:hover, button.inactive:hover{
      background:var(--apple-gray-100);
      transform:none;
    }
    /* BUTTON SIZES */
    button.small, .btn-small{
      min-height:36px;
      padding:8px 16px;
      font-size:13px;
    }
    /* Icon-only small buttons - square shape */
    button.small:not(:has(span:not(.icon))),
    button.small:has(> .icon:only-child) {
      padding: 8px;
      min-width: 36px;
    }
    button.large, .btn-large{
      min-height:52px;
      padding:14px 28px;
      font-size:16px;
      font-weight:600;
    }
    button.full-width, .btn-full-width{
      width:100%;
    }
    /* LINK BUTTON */
    button.link, button.linklike, .btn-link{
      background:transparent;
      border:none;
      color:var(--apple-blue);
      box-shadow:none;
      padding:8px 12px;
      min-height:auto;
    }
    button.link:hover, button.linklike:hover, .btn-link:hover{
      background:rgba(0, 122, 255, 0.08);
      color:var(--apple-blue-hover);
      transform:none;
    }
    button.link:active, button.linklike:active, .btn-link:active{
      background:rgba(0, 122, 255, 0.15);
      transform:translateY(0);
    }

    .panel{
      background:var(--card);
      border:1px solid var(--line);
      border-radius:var(--radius);
      box-shadow:var(--shadow);
      overflow:hidden;
    }
    .panel .hd{
      padding:14px 16px;
      border-bottom:1px solid var(--line);
      display:flex;
      justify-content:space-between;
      align-items:center;
      gap:10px;
    }
    .panel .hd strong{font-size:18px}
    .panel .bd{
		padding:14px 16px;
		border-bottom: 1px solid var(--line);

}
    .grid{
      display:grid;
      grid-template-columns: 1fr 1fr;
      gap:10px;
    }
    .grid3{
      display:grid;
      grid-template-columns: 1fr 1fr 1fr;
      gap:12px;
    }

    @media (max-width: 600px) {
      .grid3 {
        grid-template-columns: 1fr;
        gap: 0;
      }
      .grid3 > div {
        padding: 14px 0;
        border-bottom: 1px solid #e2e8f0;
      }
      .grid3 > div:last-child {
        border-bottom: none;
        padding-bottom: 4px;
      }
      .grid3 > div:first-child {
        padding-top: 4px;
      }
    }
    .full{
		padding: 10px 0;
		grid-column:1 / -1;
}
    label{
      display:block;
      font-size:14px;
      color:var(--black);
      margin:0 0 10px;
    }
    input, textarea, select{
      width:100%;
      border:1px solid #d2d5db;
      border-radius:6px;
      padding:13px 15px;
      font-size:14px;
      outline:none;
      background:#fff;
      color:var(--ink);
		line-height: 140%;
		font-family: var(--mono);
    }
    textarea{min-height:140px; resize:vertical;}
    .row{
      display:flex;
      gap:10px;
      align-items:center;
      flex-wrap:wrap;
    }
    .hint{
      font-size:12px;
      color:var(--muted);
      line-height:1.35;
    }
    .chip{
      font-size:12px;
      padding:6px 10px;
      background:#eef2ff;
      border:1px solid #e0e7ff;
      color:#1e3a8a;
      border-radius:999px;
      font-weight:600;
      display:inline-flex;
      align-items:center;
      gap:6px;
    }
    .items{
      padding-top:12px;
    }
    /* Table styles now unified - see UNIFIED TABLE STYLES section above */
    .small{
      font-size:14px;
      color:var(--muted);
    }

#pInvoiceTax{
	font-size: 18px;
}

/* ===== Accordion ===== */

    /* Invoice preview */
    .invoice{
      background:#fff;
      padding:24px;
      border-radius:var(--radius);
      border:1px solid var(--line);
      box-shadow:var(--shadow);
    }
    .inv-top{
      display:flex;
      justify-content:space-between;
      gap:16px;
      flex-wrap:wrap;
      align-items:flex-start;
    }
    .inv-brand h2{
      margin:0 0 6px;
      font-size:20px;
      letter-spacing:.2px;
    }
    .inv-brand .meta{
      margin:0;
      color:var(--muted);
      font-size:12.5px;
      white-space:pre-line;
      line-height:1.35;
    }
    .inv-right{
      text-align:right;
      min-width:260px;
    }
    .inv-right h3{
      margin:0 0 10px;
      font-size:16px;
      letter-spacing:.5px;
    }
    .kv{
      display:grid;
      grid-template-columns: 120px 1fr;
      gap:6px 10px;
      justify-content:end;
      font-size:12.5px;
    }
    .kv div:nth-child(odd){color:var(--muted)}
    .block{
      display:grid;
      grid-template-columns:1fr 1fr;
      gap:16px;
      margin-top:18px;
    }
    @media (max-width: 680px){
      .block{grid-template-columns:1fr;}
      .inv-right{min-width:unset; width:100%;}
      .inv-right{text-align:left;}
      .kv{grid-template-columns: 110px 1fr; justify-content:start;}
    }
    .box{
      padding:12px 0;
    }
    .box h4{
      margin:0 0 8px;
      font-size:12px;
      letter-spacing:.3px;
      text-transform:uppercase;
      color:var(--muted);
    }
    .box .txt{
      white-space:pre-line;
      font-size:13px;
      line-height:1.35;
    }
    .inv-table{
      margin-top:18px;
    }
    /* .inv-table table th now uses unified table styles */
    .totals{
      margin-top:14px;
      display:flex;
      justify-content:flex-end;
    }
    .totals .card{
      min-width:320px;
      border:1px solid var(--line);
      border-radius:8px;
      padding:12px;
      background:#fff;
    }
    .totals .line{
      display:flex;
      justify-content:space-between;
      gap:12px;
      font-size:13px;
      padding:6px 0;
    }
    .totals .line strong{font-family:var(--mono); font-variant-numeric:tabular-nums;}
    .totals .grand{
      border-top:1px solid var(--line);
      margin-top:6px;
      padding-top:10px;
      font-size:14px;
    }
    .totals .grand span{font-weight:800}
    .footer-notes{
      margin-top:16px;
      display:grid;
      grid-template-columns: 1fr 1fr;
      gap:32px;
    }
    .badge{
      font-size:12px;
      color:var(--muted);
    }
    .right-note{
      font-size:12px;
      color:var(--muted);
      margin-top:10px;
    }

    /* LOGO in preview */
    .logo-wrap{
      margin-bottom:10px;
    }
    .logo-wrap img{
      max-width:150px;
      max-height:100px;
      width:auto;
      height:auto;
      object-fit:contain;
    }
    #pLogo{
      display:none;
      width:150px;
      height:auto;
      max-width:150px;
      max-height:100px;
      object-fit:contain;
    }

    /* Tax estimate box */

.label_heading{
	font-weight: 500;
	padding-top: 10px;
}
    .tax-box{
      margin-top:24px;
      border:1px dashed var(--line);
      border-radius:8px;
      padding: 24px;
      background:#fff;
    }
    .tax-box .title{
      font-size:12px;
      color:var(--muted);
      text-transform:uppercase;
      letter-spacing:.3px;
      margin:0 0 6px;
      font-weight:800;
    }
    .tax-box .row2{
      display:flex;
      justify-content:space-between;
      gap:12px;
      font-size:13px;
      padding:4px 0;
    }
    .tax-box .row2 strong{
      font-family:var(--mono);
      font-variant-numeric: tabular-nums;
    }
    .tax-box .note{
      margin-top:6px;
      font-size:12px;
      color:var(--muted);
      line-height:1.35;
    }

    /* PRINT */
    @media print{
      body{background:#fff;}
      header, .panel.input, .no-print{display:none !important;}
      main{display:block; max-width:none; padding:0; margin:0;}
      .panel{box-shadow:none; border:none;}
      .invoice{
        box-shadow:none;
        border:none;
        border-radius:0;
        padding:0;
      }
      .invoice, .inv-table table, .totals .card, .box, .tax-box{
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
      }
      
      /* Custom font sizes for PDF/Print */
      .inv-brand h2 {
        font-size: 18px !important;  /* Company name: 20px → 18px */
      }
      
      table td {
        font-size: 12px !important;  /* Line items: 14px → 12px */
      }
      
      .totals .line {
        font-size: 12px !important;  /* Totals: 13px → 12px */
      }
      
      .totals .grand {
        font-size: 12px !important;  /* Amount due: stays at 12px */
      }
      
      .inv-brand .meta,
      .kv {
        font-size: 11px !important;  /* Metadata: 12.5px → 11px */
      }
      
      .inv-right h3 {
        font-size: 14px !important;  /* Invoice title: 16px → 14px */
      }
      
      table th {
        font-size: 11px !important;  /* Table headers: 13px → 11px */
      }
      
      .box .txt {
        font-size: 11px !important;  /* Client details: 13px → 11px */
      }
      
      .box h4 {
        font-size: 10px !important;  /* Section headers: 12px → 10px */
      }
    }

/* ===== Modal ===== */
/* ============================================================================
   STANDARDIZED MODAL SYSTEM - All modals use consistent 12px border-radius
   ============================================================================ */
.modal{
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;      /* Center vertically when visible */
  justify-content: center;   /* Center horizontally when visible */
  padding: 20px;
}
.modal.is-open{
  display: flex;  /* Use flex when open, not block */
}

.modal-backdrop{
  position:absolute; inset:0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-dialog{
  position: relative;  /* Flexbox parent handles positioning */
  width: min(640px, calc(100vw - 24px));
  max-height: calc(100vh - 48px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(0,0,0,.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header{
  padding:20px 24px;
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  flex-shrink: 0;
}

.modal-header h2{
  margin:0;
  padding:0;
  font-size:24px;
  font-weight:600;
  line-height:1.2;
  color:#111827;
}

.modal-header .iconBtn{
  width:36px;
  height:36px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid #e5e7eb;
  border-radius:8px;
  background:#fff;
  color:#6b7280;
  font-size:24px;
  line-height:1;
  cursor:pointer;
  transition:all 0.15s ease;
  flex-shrink:0;
  padding:0;
}

.modal-header .iconBtn:hover{
  background:#f9fafb;
  border-color:#d1d5db;
  color:#111827;
}

.modal-header .iconBtn:active{
  background:#f3f4f6;
  transform:scale(0.95);
}

.modal-body{
  padding:24px;
  overflow:auto;
  flex:1;
}

/* Modal responsive styles */
@media (max-width: 640px) {
  .modal-dialog {
    width: calc(100vw - 24px);
    margin: 12px;
    max-height: calc(100vh - 24px);
  }

  .modal-header {
    padding: 16px 20px;
  }

  .modal-header h2 {
    font-size: 20px;
  }

  .modal-body {
    padding: 20px;
  }

  .clientModal {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }

  .clientModalHeader {
    padding: 16px 20px;
  }

  .clientModalHeader h2 {
    font-size: 20px;
  }

  .clientPickerSimple,
  .clientView,
  .clientEditView {
    padding: 0 20px 20px;
  }

  .clientFooter {
    padding: 12px 20px 20px;
  }
}

/* #historyTable tfoot now uses unified table tfoot styles */

#authShell{
	padding: 24px;
}

.auth-brand{
	text-align: center;
}

/* ===== Source: styles_auth_hnry_pw.css ===== */
/* ===== Auth (HNRY-style) ===== */
.auth-shell{
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
  background:
    radial-gradient(1200px 600px at 10% 10%, rgba(37,99,235,.08), transparent 55%),
    radial-gradient(1000px 520px at 90% 20%, rgba(99,102,241,.07), transparent 55%),
    var(--auth-bg);
}

.auth-wrap{
  width: min(1020px, 100%);
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 18px;
  align-items: stretch;
}

.auth-panel{
  background: var(--hnry-navy);
  color: rgba(248,250,252,.95);
  border-radius: var(--auth-radius);
  box-shadow: var(--auth-shadow);
  padding: 30px;
  position: relative;
  overflow: hidden;
}

.auth-panel:before{
  content:"";
  position:absolute;
  inset: -60px;
  filter: blur(6px);
  opacity: .75;
}

.auth-panel > *{ position: relative; }

.auth-brandRow{ align-items:center; gap:14px; text-align: center !important; }
.auth-brandRow img{ width: 140px; height: 140px; object-fit: contain; border-radius: 8px; }
.auth-brandRow .t{ font-weight: 800; letter-spacing: -0.02em; font-size: 20px; }
.auth-panel h1{ margin: 18px 0 8px; font-size: 30px !important; line-height: 1.05; letter-spacing: -0.04em; }
.auth-panel p{ margin: 0; color: rgba(226,232,240,.9); max-width: 44ch; }

.auth-bullets{ margin-top: 18px; display:grid; gap:10px; }
.auth-bullet{ display:flex; gap:10px; align-items:flex-start; color: rgba(248,250,252,.92); }
.auth-bullet svg{ flex: 0 0 auto; margin-top: 2px; }
.auth-footnote{ margin-top: 20px; font-size: 13px; color: rgba(226,232,240,.75); }

.auth-card{
  background: var(--auth-card);
  border: 1px solid rgba(226,232,240,.8);
  border-radius: var(--auth-radius);
  box-shadow: var(--auth-shadow);
  padding: 22px;
}

.auth-head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.auth-head .k{
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 18px;
  color: var(--auth-ink);
}

.auth-tabs{
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 14px;
}

.auth-tab{
  border: 0;
  background: transparent;
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
}

.auth-tab.is-active{
  background: #fff;
  color: #0f172a;
  box-shadow: 0 6px 20px rgba(2,6,23,.08);
}

.auth-grid{ display:grid; grid-template-columns: 1fr; gap: 12px; }
.auth-grid label{ display:block; font-size: 13px; font-weight: 700; color: #0f172a; margin: 0 0 6px; }

.auth-grid input{
  width: 100%;
  border: 1px solid var(--auth-line);
  border-radius: 8px;
  padding: 12px 12px;
  font-size: 15px;
  color: var(--auth-ink);
  background: #fff;
  outline: none;
}

.auth-grid input:focus{
  border-color: rgba(37,99,235,.55);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}

.auth-grid input.is-invalid{
  border-color: rgba(220,38,38,.55);
  box-shadow: 0 0 0 4px rgba(220,38,38,.10);
}

.auth-grid input.is-valid{
  border-color: rgba(22,163,74,.45);
  box-shadow: 0 0 0 4px rgba(22,163,74,.10);
}

/* Error Tooltip Styling - ONLY for password length error */
.error-tooltip {
  position: absolute;
  background: #5063ad;
  color: white;
  padding: 12px 16px;
  padding-left: 44px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  display: none;
  z-index: 1000;
  max-width: 300px;
  line-height: 1.5;
  white-space: normal;
  top: -60px;
  left: 0;
}

.error-tooltip.show {
  display: block;
  animation: tooltipFadeIn 0.2s ease;
}

.error-tooltip::before {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 24px;
  width: 12px;
  height: 12px;
  background: #5063ad;
  transform: rotate(45deg);
}

.error-tooltip::after {
  content: 'ⓘ';
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  font-weight: bold;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes tooltipFadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Red text below field for all other errors (Google standard) */
.auth-help{ 
  display: none;
  font-size: 12px; 
  color: #b91c1c; 
  margin-top: 6px; 
  line-height: 1.4;
}

.auth-help.show-error{ 
  display: block !important;
}

.auth-hint{ font-size: 12px; color: var(--auth-muted); margin-top: 6px; }

/* Style browser/library field-error divs as tooltips */
.field-error {
  position: absolute !important;
  background: #5063ad !important;
  color: white !important;
  padding: 12px 16px !important;
  padding-left: 44px !important;
  border-radius: 12px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3) !important;
  display: none !important;  /* Hidden by default */
  z-index: 1000 !important;
  max-width: 300px !important;
  line-height: 1.5 !important;
  white-space: normal !important;
  top: -60px !important;
  left: 0 !important;
  animation: tooltipFadeIn 0.2s ease !important;
  margin: 0 !important;
  border: none !important;
}

.field-error.show {
  display: block !important;  /* Only show when has 'show' class */
}

.field-error::before {
  content: '' !important;
  position: absolute !important;
  bottom: -6px !important;
  left: 24px !important;
  width: 12px !important;
  height: 12px !important;
  background: #5063ad !important;
  transform: rotate(45deg) !important;
}

.field-error::after {
  content: 'ⓘ' !important;
  position: absolute !important;
  left: 16px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  font-size: 20px !important;
  font-weight: bold !important;
  width: 20px !important;
  height: 20px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}


.pw-meter{
  display: none !important;  /* Hidden - use field errors instead */
  margin-top: 10px;
  background: #f1f5f9;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}
.pw-meter > div{ height: 100%; width: 0%; background: #0f172a; transition: width .18s ease; }

.pw-meterRow{ 
  display: none !important;  /* Hidden - use field errors instead */
  justify-content: space-between; 
  align-items:center; 
  margin-top: 8px; 
}
.pw-meterRow .label{ font-size: 12px; color: var(--auth-muted); }
.pw-meterRow .strength{ font-size: 12px; font-weight: 800; color: #0f172a; }
.pw-meterRow .strength[data-strength="0"],
.pw-meterRow .strength[data-strength="1"],
.pw-meterRow .strength[data-strength="2"]{ color: #b91c1c; }
.pw-meterRow .strength[data-strength="3"]{ color: #92400e; }
.pw-meterRow .strength[data-strength="4"],
.pw-meterRow .strength[data-strength="5"]{ color: #166534; }

.pw-req{
  display: none !important;  /* Always hidden - use field errors instead */
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  gap: 6px;
  color: #475569;
  font-size: 12px;
}
.pw-req li{ display:flex; gap: 8px; align-items: center; }
.pw-req li:before{
  content: "•";
  font-weight: 900;
  opacity: .45;
}
.pw-req li.is-ok{ color: #166534; }
.pw-req li.is-ok:before{ content:"✓"; opacity: 1; }

.auth-actions{ display:flex; gap: 10px; align-items:center; justify-content: space-between; margin-top: 4px; }
.auth-actions .primary{
  border: 0;
  background: #0f172a;
  color: #fff;
  border-radius: 8px;
  padding: 12px 14px;
  font-weight: 800;
  cursor: pointer;
  width: 100%;
}
.auth-actions .primary:disabled{ opacity: .55; cursor: not-allowed; }

.auth-msg{
  display:none;
  margin-top: 12px;
  border-radius: 8px;
  padding: 10px 12px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
  font-size: 13px;
}

.auth-meta{
  margin-top: 12px;
  font-size: 12px;
  color: var(--auth-muted);
  display:flex;
  gap: 10px;
  align-items:center;
}

.auth-meta svg{ flex: 0 0 auto; }

@media (max-width: 920px){
  .auth-wrap{ grid-template-columns: 1fr; }
  .auth-panel{ padding: 22px; }
  .auth-panel h1{ font-size: 34px; }
}


/* ===== Password visibility toggle + caps lock warning ===== */
.auth-inputWrap{
  position: relative;
  display: flex;
  align-items: center;
}
.auth-inputWrap input{
  padding-right: 44px; /* room for eye button */
}
.pw-toggle{
  position:absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  border-radius: 10px;
  color: rgba(15,23,42,.70);
  display:grid;
  place-items:center;
  cursor:pointer;
}
.pw-toggle:hover {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  transform: translateY(-50%) !important;
}
.pw-toggle:focus{
  outline:none;
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}
.pw-toggle .eye-closed{ display:none; }
.pw-toggle[data-state="shown"] .eye-open{ display:none; }
.pw-toggle[data-state="shown"] .eye-closed{ display:block; }

.caps-warn{
  margin-top: 6px;
  font-size: 12px;
  color: #92400e;
  display:flex;
  gap:8px;
  align-items:center;
}
.caps-warn:before{
  content:"⚠";
  font-size: 12px;
  opacity:.9;
}

/* ===== Source: styles_pages_hnry.css ===== */
/* HNRY-ish in-page sections for History/Profile (no modals) */
.page-shell{
  padding: 0px;
	margin: 0 auto;
	max-width: 1200px;
}
.page-wrap{
  max-width: 100%;
}
.page-head{ margin-bottom: 20px; }
.page-title{
  margin:0;
  font-size: 34px;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.page-sub{
  margin: 6px 0 0;
  color: var(--muted2, #64748b);
  font-size: 14px;
}

.chip-btn{
  appearance:none;
  border: 1px solid var(--line2, #e5e7eb);
  background: var(--card, #fff);
  color: var(--ink, #0f172a);
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  cursor:pointer;
}
.chip-btn:hover{ filter: brightness(0.98); }
.chip-btn.is-active{
  border-color: rgba(37,99,235,.35);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}

#summaryWrap .card, #summaryWrap .summary-card{
  border: 1px solid var(--line2, #e5e7eb);
  border-radius: 8px;
  background: var(--card, #fff);
  box-shadow: 0 10px 24px rgba(15,23,42,.06);
}

@media (max-width: 980px){
  .page-title{ font-size: 26px; }
  .page-shell{ padding: 8px 14px 28px; }
}

/* ===== Source: styles_ux_hnry_refined.css ===== */
/* =====================================================
   Mokont Invoices — UX add-ons (clean, no duplicates)
   ===================================================== */

/* ---------- Profile hint + linklike button ---------- */
.profile-hint .hint{
  display:flex;
  align-items:center;
  gap:8px;
  padding:10px 12px;
  border:1px dashed var(--line);
  border-radius:12px;
  background:#fbfbfd;
}

button.linklike{
  border:none;
  padding:0;
  background:transparent;
  color:var(--accent);
  text-decoration:underline;
  cursor:pointer;
  font:inherit;
}

/* ---------- Profile modal layout ---------- */
.profile-modal-grid{
  display:grid;
  grid-template-columns: 1fr 1.2fr;
  gap:14px;
}

.profile-modal-grid .card{
  border:1px solid var(--line);
  border-radius:16px;
  padding:14px;
  background:#fff;
}

@media (max-width: 900px){
  .profile-modal-grid{ grid-template-columns: 1fr; }
}

/* ---------- Hide duplicate business fields in invoice editor ---------- */
[data-hide-invoice-business="true"]{
  display:none !important;
}

/* =====================================================
   HNRY-STYLE APP CHROME (Header + Sidebar + Content)
   ===================================================== */

/* ---------- Topbar (mobile only) ---------- */
.topbar{
  height: var(--topbar-h);
  background: var(--hnry-navy);
  color:#fff;

  display:flex;
  align-items:center;
  justify-content:flex-start;

  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 100;

  box-shadow: var(--hnry-shadow);
}

.topbar .icon-btn{
  width:44px;
  height:44px;
  border-radius:12px;

  display:grid;
  place-items:center;

  background:transparent;
  border:0;
  color:#fff;

  font-size:24px;
  cursor:pointer;
}

/* Animated Burger Menu (Mobile Only) */
.burger-menu {
  width: 44px;
  height: 44px;
  background: transparent;
  border: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 10px;
  position: relative;
  z-index: 130;
}

.burger-menu:hover {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  transform: none !important;
}

.burger-bar {
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}

/* Burger → X Animation */
.burger-menu.active .burger-bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.burger-menu.active .burger-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.burger-menu.active .burger-bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.topbar-center{
  position:absolute;
  left:50%;
  transform:translateX(-50%);
  pointer-events:none;
  display:flex;
  align-items:center;
}

.topbar-logo{
  height: 88px;
  width:auto;
  display:block;
}

/* Ensure topbar never becomes centered/stacked under 980px overrides */
@media (max-width: 980px){
  header.topbar{
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
  }
}

/* =====================================================
   LAYOUT — SINGLE CLEAN SOURCE OF TRUTH
   Topbar (mobile) + Sidebar + Main content + AppShell
   ===================================================== */

/* ---- Topbar: mobile-only sticky bar ---- */
@media (min-width: 1024px){
  .topbar{ display:none !important; }
  #btnBurger,
  .burger-menu { display:none !important; }
}

/* ---- appChrome: full-height flex column ---- */
#appChrome{
  display: block;
  width: 100%;
  min-height: 100vh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  letter-spacing: -0.01em;
}

/* ---- Layout: sidebar + content side by side ---- */
#appChrome .layout{
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar{
  flex: 0 0 var(--sidebar-w);
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--hnry-navy);
  border-right: none;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 10;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-brand{
	text-align: center;
  flex-direction: column;
  gap: 8px;
  margin: 10px auto;
}

.sidebar-logo{
  width: 160px;
  height: auto;
  filter: brightness(1.05);
}

.sidebar-sub{ color: var(--hnry-text-dim); font-size: 13px; }

.sidebar-nav{
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 10px;
  flex: 1; /* push footer to bottom */
}

.nav-item{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  color: var(--hnry-text-on);
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  font-weight: 600;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  width: 100%;
}

.nav-item .nav-ico{
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255,255,255,.06);
  flex-shrink: 0;
}

.nav-item .nav-ico svg{
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item:hover{ background: var(--hnry-hover); }
.nav-item.is-active{
  background: var(--hnry-active);
  border-color: rgba(255,255,255,.14);
}
.nav-item.danger{ color: #ffd0d0; }
.nav-item.danger .nav-ico{ background: rgba(239,68,68,.16); }
.nav-item.danger:hover{ background: rgba(220,38,38,.18); }

.nav-sep{
  height: 1px;
  background: rgba(255,255,255,.12);
  margin: 10px 8px;
}

/* Sidebar footer */
.sidebar-footer{
  margin-top: auto;
  padding: 14px 10px 12px;
  border-top: 1px solid rgba(255,255,255,.10);
}

/* Overlay for mobile */
.sidebar-overlay{
  position: fixed;
  inset: 0;
  background: rgba(17,24,39,0); /* Fully transparent - don't darken topbar */
  z-index: 110;
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.sidebar-overlay:not([hidden]) {
  opacity: 1;
  pointer-events: auto;
}

/* ---- Main content area ---- */
#appChrome main.content{
  flex: 1 1 0;
  min-width: 0;          /* essential — allows shrinking below content width */
  width: 0;              /* force flex to control width, not content */
  max-width: none !important;
  margin: 0 !important;
  padding: 32px;
  background: #f3f5fb;
  display: block;
  overflow-x: hidden;
}

/* ---- Mobile: sidebar becomes off-canvas drawer ---- */
@media (max-width: 1023px){
  #appChrome .layout{
    flex-direction: column;
  }

  .sidebar{
    position: fixed !important;
    top: var(--topbar-h);
    left: 0;
    height: calc(100vh - var(--topbar-h));
    min-height: 0 !important; /* Override base min-height: 100vh */
    width: 100vw; /* Full width on mobile */
    max-width: 100vw;
    transform: translateX(-100%) !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: 120;
    box-shadow: var(--hnry-shadow);
    will-change: transform;
    overflow-y: auto; /* Allow scrolling if content overflows */
    overflow-x: hidden;
    display: flex !important; /* Maintain flexbox */
    flex-direction: column !important; /* Vertical layout */
  }

  .sidebar.is-open{ 
    transform: translateX(0) !important;
  }

  /* Hide entire brand block on mobile - topbar already has logo */
  .sidebar-brand {
    display: none !important;
  }

  #appChrome main.content{
    width: 100%;
    padding: calc(var(--toppad-h) + 8px) 16px 32px;
  }
}

/* =====================================================
   APP SHELL — Two-column invoice editor (desktop)
   ===================================================== */

#appShell{
  width: 100%;
  max-width: none !important;
  margin: 0 !important;
  display: block; /* mobile: stacked */
}

/* Both columns fill available width */
#appShell > section,
#appShell > .appShell-left{
  min-width: 0;
  width: 100%;
}

@media (min-width: 1024px){
  #appShell{
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
  }

  #appShell > section{
    width: 100% !important;
    max-width: none !important;
    min-width: 0;
  }

  #appShell .panel,
  #appShell .invoice,
  #appShell #invoicePreview{
    width: 100% !important;
    max-width: none !important;
  }

  #appShell .invoice-preview{
    position: sticky;
  }
}

@media print{
  /* CRITICAL: Force ALL scrollable containers to be fully visible */
  * {
    overflow: visible !important;
    max-height: none !important;
  }
  
  html, body {
    height: auto !important;
    overflow: visible !important;
  }
  
  /* Hide app chrome */
  .topbar,
  #sidebar,
  #sidebarOverlay,
  .sidebar,
  .sidebar-overlay,
  .appShell-left,
  .no-print,
  #dashboardShell{
    display: none !important;
  }

  /* Make sure the invoice preview prints */
  #appChrome,
  #appShell,
  #invoicePreview,
  .invoice{
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    position: static !important;
  }
  
  /* Ensure invoice-preview container doesn't clip content */
  .invoice-preview {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    position: static !important;
  }

  /* Clean print canvas */
  body{
    background: #fff !important;
  }

  /* Remove padding/margins that can shift content */
  #appChrome main.content{
    padding: 0 !important;
    margin: 0 !important;
  }
  
  /* Custom font sizes for PDF/Print */
  .inv-brand h2 {
    font-size: 18px !important;  /* Company name: 20px → 18px */
  }
  
  table td {
    font-size: 12px !important;  /* Line items: 14px → 12px */
  }
  
  .totals .line {
    font-size: 12px !important;  /* Totals: 13px → 12px */
  }
  
  .totals .grand {
    font-size: 12px !important;  /* Amount due: stays at 12px */
  }
  
  .inv-brand .meta,
  .kv {
    font-size: 11px !important;  /* Metadata: 12.5px → 11px */
  }
  
  .inv-right h3 {
    font-size: 14px !important;  /* Invoice title: 16px → 14px */
  }
  
  table th {
    font-size: 11px !important;  /* Table headers: 13px → 11px */
  }
  
  .box .txt {
    font-size: 11px !important;  /* Client details: 13px → 11px */
  }
  
  .box h4 {
    font-size: 10px !important;  /* Section headers: 12px → 10px */
  }
}

/* ============================
   DASHBOARD — KPI CARDS
   ============================ */

.dashboard-shell .auth-card{
  /* optional: make dashboard card feel less like auth */
  max-width: 1100px;
}

/* Header row */
.dash-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom: 16px;
}

.dash-title{
  margin: 0;
  font-size: 44px;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.dash-sub{
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
}

/* Right mini card */
.dash-balance{
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  padding: 14px 16px;
  min-width: 260px;
  box-shadow: 0 12px 30px rgba(0,0,0,.06);
}

.dash-balance-label{
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.dash-balance-value{
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* KPI grid */
.kpi-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0 18px;
}

.kpi-card{
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 12px 30px rgba(0,0,0,.06);
}

.kpi-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom: 10px;
}

.kpi-label{
  font-size: 13px;
  color: var(--muted);
}

.kpi-chip{
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #1f3fbf;
  font-weight: 700;
}

.kpi-chip-muted{
  background: #f3f4f6;
  border-color: #e5e7eb;
  color: #6b7280;
}

.kpi-value{
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.kpi-meta{
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

/* Responsive */
@media (max-width: 980px){
  .dash-title{ font-size: 34px; }
  .dash-head{ flex-direction: column; }
  .dash-balance{ width: 100%; min-width: 0; }
  .kpi-grid{ grid-template-columns: 1fr; }
}


/* =====================================================
   HNRY DASHBOARD + DARK SIDEBAR OVERRIDES (v1)
   ===================================================== */


/* Dashboard wrapper */
.dashboard-shell{
  width:100%;
}
.dashboard-shell .dash-wrap{
  max-width: 100%;
}
.dashboard-shell .auth-card{
  /* stop looking like an auth card */
  max-width: none;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

/* KPI grid: keep 3-up on desktop, stack on small */
.kpi-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 16px 0 18px;
}

/* 3-up content grid */
.dash-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.dash-card{
  background: #fff;
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 12px 30px rgba(0,0,0,.06);
  min-width: 0;
}

.dash-card-hd h3{
  margin:0;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.dash-card-p{
  margin: 10px 0 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.dash-empty{
  padding: 10px 0 2px;
}
.dash-empty-title{
  font-weight: 750;
  margin-bottom: 6px;
}
.dash-empty-sub{
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.dash-actions{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

/* Make "View all" look like Hnry small link */
button.linklike{
  text-decoration: none;
  color: var(--muted);
  font-weight: 650;
}
button.linklike:hover{
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 980px){
  .kpi-grid{ grid-template-columns: 1fr; }
  .dash-grid{ grid-template-columns: 1fr; }

  /* Dashboard head */
  .dash-head h1 {
    font-size: 32px !important;
  }

  .dash-head p {
    font-size: 14px !important;
  }

}

/* Tablet and below */
@media (max-width: 768px) {
  /* Invoice header */
  .invoices-header-hnry {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-create-new-hnry {
    width: 100%;
    justify-content: center;
  }

  .invoices-filters-hnry {
    display: block; /* Use block instead of flex on mobile */
    padding: 0 4px;
  }

  .search-box-hnry {
    flex: 1 !important;
    width: 100%;
    min-width: 0; /* Prevent flex overflow */
    max-width: 100%;
    margin-bottom: 12px; /* Spacing for block layout */
  }

  .search-box-hnry input {
    width: 100%;
    min-width: 0; /* Prevent overflow */
    padding: 11px 48px 11px 14px; /* More right padding for icon */
    font-size: 16px; /* Prevent iOS zoom */
    box-sizing: border-box;
  }

  .search-box-hnry .search-icon {
    right: 16px; /* More space from edge */
  }

  .filter-group-hnry {
    display: flex;
    flex-direction: row;
    gap: 12px;
    width: 100%;
    align-items: center; /* Vertically center the select boxes */
  }

  .custom-select-hnry {
    flex: 1;
    min-width: 0;
    max-width: 100%;
  }
  
  .custom-select-hnry select {
    width: 100%;
    box-sizing: border-box;
    font-size: 16px; /* Prevent iOS zoom */
  }

  .row-actions-hnry {
    opacity: 1;
    visibility: visible;
  }

  /* Dashboard actions */
  .dash-head-actions {
    flex-direction: column;
    width: 100%;
  }

  .dash-head-actions button {
    width: 100%;
  }
}

/* Mobile phones */
@media (max-width: 480px) {
  .filter-group-hnry {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center; /* Vertically center select boxes */
  }

  .custom-select-hnry {
    flex: 1;
    min-width: 0;
  }

  /* Ensure search box works properly on mobile */
  .search-box-hnry {
    flex: 1 !important;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin-bottom: 12px; /* Spacing for block layout */
  }

  .search-box-hnry input {
    width: 100%;
    padding: 11px 48px 11px 14px; /* More right padding for icon */
    font-size: 16px; /* Prevent iOS zoom */
    box-sizing: border-box;
  }

  .search-box-hnry .search-icon {
    right: 16px; /* More space from edge */
    flex-shrink: 0;
  }
  
  .custom-select-hnry select {
    font-size: 16px; /* Prevent iOS zoom */
    box-sizing: border-box;
  }

  /* Stack KPI chips */
  .kpi-top {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 8px;
  }

  .kpi-value {
    font-size: 28px !important;
  }

  /* Smaller chart on phones */

  /* Card header dropdown stacks */
  .dash-card-hd {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px;
  }

  .dash-card-hd .custom-select-hnry {
    width: 100%;
    min-width: 100%;
  }
}


/* =====================================================
   HNRY STYLE REFINEMENTS — icons, typography, spacing
   ===================================================== */

/* Typography closer to Hnry */
#appChrome{
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  letter-spacing: -0.01em;
}

.dashboard-shell .dash-head h1{
  font-size: 44px;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.dashboard-shell .dash-head p{
  font-size: 15px;
  color: var(--muted);
  margin-top: 8px;
}



/* Sidebar footer user block (HNRY-style) */
.sidebar-footer{
  margin-top: auto;
  padding: 14px 10px 12px;
  border-top: 1px solid rgba(255,255,255,.10);
}

.sidebar-user{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 8px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
}

.sidebar-user:hover{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.10);
}

.sidebar-avatar{
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: .02em;
  color: rgba(255,255,255,.95);
  background: #ff9200;
  border: 1px solid rgba(0,0,0,.0);
}

.sidebar-userText{ min-width: 0; }

.sidebar-userName{
  color: rgba(255,255,255,.92);
  font-size: 14px;
  font-weight: 750;
  letter-spacing: -0.01em;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
}

.sidebar-userMeta{
  margin-top: 2px;
  font-size: 12px;
  color: rgba(255,255,255,.68);
  line-height: 1.2;
}





/* Cards */
.kpi-card, .dash-card, .dash-balance{
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
}


.kpi-grid{ gap: 24px; }

.kpi-top{ margin-bottom: 10px; }
.kpi-label{ font-weight: 700; color: #111827; }
.kpi-value{ font-size: 34px; letter-spacing: -0.02em; color: #5063ad;}
.kpi-meta{ color: var(--muted2); }

/* Card headers like Hnry */
.dash-card-hd{
  padding: 0 0 16px 0;
  border-bottom: 1px solid var(--line2);
  margin: 0;
}

.dash-card-hd h3{
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.dash-card{
  padding: 24px; /* header handles padding */
  overflow: hidden;
}

.dash-card > :not(.dash-card-hd){
  padding: 0px;
}

.dash-card-p{ margin: 14px 0 14px; color: var(--muted2); font-size: 14px; line-height: 1.5; }

.dash-list{ padding-top: 4px; padding-bottom: 14px; }

/* Empty state with illustration */
.dash-empty{
  text-align: center;
  padding: 20px 6px 18px;
}

.dash-empty-illu{
  width: 100%;
  display:flex;
  justify-content:center;
  margin: 4px 0 10px;
}

.dash-empty-illu svg{
  width: 170px;
  height: auto;
}

.dash-empty-title{
  font-weight: 800;
  font-size: 15px;
}

.dash-empty-sub{
  color: var(--muted2);
  font-size: 13px;
  line-height: 1.45;
  margin-top: 6px;
}

.dash-actions{
  padding: 12px 18px 18px;
  display:flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dash-actions button{
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 700;
}

/* Dashboard header row spacing */
.dash-head{
  align-items: flex-start;
  margin-bottom: 32px;
}

.dash-balance{
  padding: 16px 18px;
}

.dash-balance .label{
  font-size: 13px;
  color: var(--muted2);
  font-weight: 700;
}

.dash-balance .amount{
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

@keyframes contentFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.content-fade-in {
  animation: contentFadeIn .38s cubic-bezier(.16,1,.3,1);
}

/* Toast (HNRY subtle) */
.toast{
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: rgba(15,23,42,.92);
  color: rgba(255,255,255,.95);
  border: 1px solid rgba(255,255,255,.10);
  padding: 10px 12px;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0,0,0,.18);
  font-size: 13px;
  font-weight: 650;
  display: flex;
  gap: 10px;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 9999;
}

.toast.is-show{
  opacity: 1;
  transform: translateX(-50%) translateY(-6px);
}

.toast .dot{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
}

.tableTools{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin: 12px 0 12px;
}

.searchField{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius: 8px;
  background:#fff;
  min-width: 320px;
  max-width: 360px;
  width: 100%;
}

.searchField input{
  border:0;
	padding: 0;
	margin: 0;
  outline:0;
  width:100%;
  font-size:14px;
  background:transparent;
}

.searchIcon{
  opacity:.55;
  font-weight:700;
}

.ghost{
  border:0;
  background:transparent;
  color: var(--muted);
  font-weight:650;
  cursor:pointer;
  padding:16px 18px;
}

.ghost:hover{
  background: rgba(17,24,39,.06);
  color: var(--ink);
}

.mutedSmall{
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}




/* ===== Clients modal list ===== */
.clientList{
  border:1px solid var(--line);
  background:#fff;
  max-height: 260px;
  overflow:auto;
}
.client-row{
  width:100%;
  display:block;
  text-align:left;
  border:0;
  background:transparent;
  padding:10px 12px;
  border-radius:10px;
  cursor:pointer;
}
.client-row:hover{ background:#f3f4f6; }
.client-row__name{ font-weight:800; }
.client-row__meta{ color:var(--muted); font-size:13px; margin-top:2px; }
.client-empty{
  padding:12px;
  color:var(--muted);
  font-size:14px;
}


/* ===== Client Picker Modal ===== */
/* ============================================================================
   MODAL JUMP FIX - AGGRESSIVE SCROLLBAR
   ============================================================================
   Strategy: ALWAYS show scrollbar so viewport width NEVER changes
   ============================================================================ */

html {
  overflow-y: scroll !important; /* ALWAYS show scrollbar - prevents ANY width change */
}

/* JavaScript handles scroll locking with position: fixed on body */
/* No additional CSS needed - JS sets body position, top, and width */

html.modal-open main.content {
  margin-left: var(--sidebar-w) !important;
}



.clientOverlay {
  position: fixed;
  inset: 0;
  background: rgba(17,24,39,.55);
  -webkit-backdrop-filter: blur(2px);  /* ← ADD THIS */
  backdrop-filter: blur(2px);
  z-index: 1000;
}

/* Hide overlay when it has hidden attribute */
.clientOverlay[hidden] {
  display: none !important;
}

/* duplicate .clientOverlay removed */

/* Client Modal Wrapper - flexbox container (NO JUMP) */
.client-modal-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  /* Safari: use env(safe-area-inset-bottom) for home bar */
  padding: 20px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Prevent modal from overlapping Safari's browser chrome */
  height: 100vh;
  height: 100dvh;
}

.client-modal-wrapper[hidden] {
  display: none !important;
}

.clientModal{
  /* NO JUMP: position relative, centered by parent flexbox */
  position: relative !important;
  width: min(1100px, calc(100vw - 24px));
  max-width: 640px;
  /* Give the modal an explicit height so flex children can fill it */
  height: 560px;
  min-height: 400px;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(0,0,0,.22);
  z-index: 1;
  display: flex;
  flex-direction: column;
}

/* Hide modal when it has hidden attribute */
.clientModal[hidden] {
  display: none !important;
}

.field{
	padding: 24px 0;
}

.clientModalHeader{
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.clientModalHeader h2{
  margin: 0;
  padding: 0;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  color: #111827;
}

.clientModalHeader .muted{
  margin: 6px 0 0;
  font-size: 14px;
  color: #6b7280;
  line-height: 1.5;
}

.clientModalHeader .iconBtn{
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #6b7280;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  padding: 0;
}

.clientModalHeader .iconBtn:hover{
  background: #f9fafb;
  border-color: #d1d5db;
  color: #111827;
}

.clientModalHeader .iconBtn:active{
  background: #f3f4f6;
  transform: scale(0.95);
}

/* Client Modal Body Sections */
.clientPickerSimple,
.clientView,
.clientEditView {
  padding: 0 24px 24px;
  overflow: auto;
  flex: 1;
}

.clientFooter {
  padding: 16px 0px 0px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  background: #fff;
  flex-shrink: 0;
}

.iconBtn{
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: #fff;
  font-size: 26px;
  line-height: 0;
  cursor: pointer;
	padding: 18px 12px 22px 12px;
}
.iconBtn:hover{ background:#f9fafb; }

.clientList{
  margin-top: 20px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 14px 40px rgba(0,0,0,.08);
}

.clientwrap{
}

#clientsTable {
  /* Inherits unified table styles */
  margin-bottom: 0;
}

.clientRow{
  width: 100%;
  text-align: left;
  padding: 16px 18px;
  border: 0;
  background: #fff;
  cursor: pointer;
}
.clientRow + .clientRow{ border-top: 1px solid #f1f5f9; }
.clientRow:hover{ background: #f8fafc; }
.clientRowName{ font-size: 14px; font-weight: 600; color:#0f172a; }
.clientRowMeta{ margin-top: 6px; color:#64748b; font-size: 14px; font-weight: 300}

.clientEmpty{
  padding: 16px 18px;
  color:#64748b;
}

.searchRow{ position: relative; }
.searchRow input{ padding-right: 44px; }
.searchRow .searchIcon{
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color:#0f172a;
  opacity:.8;
}

.clientFooter{
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 22px;
}

/* Dropdown styles for new Hnry-style interface */
.clientDropdown{
  margin-top: 0px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
  max-height: 300px;
  overflow-y: auto;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.clientDropdown.fade-in{
  opacity: 1;
  transform: translateY(0);
}

.clientDropdown .clientList{
  margin: 0;
  border: none;
  box-shadow: none;
  max-height: 250px;
  overflow-y: auto;
}

/* Make search field readonly but still look clickable */
.clientPickerSimple .searchRow input[readonly]{
  cursor: pointer;
  background: #fff;
}

.clientPickerSimple .searchRow input[readonly]:hover{
  background: #f9fafb;
}

/* Next button styling */
.btn[disabled]{
  opacity: 0.5;
  cursor: not-allowed;
}

/* Full width button */
.full-width{
  width: 100%;
}

.grid2{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 640px){
  .clientModalHeader h2{ font-size: 32px; }
  .grid2{ grid-template-columns: 1fr; }
}

/* Helpers */
.visually-hidden{position:absolute!important;height:1px;width:1px;overflow:hidden;clip:rect(1px,1px,1px,1px);white-space:nowrap;}

/* Line item VAT selector */
.itemVatSelect{width:100%;min-width:140px;}

/* =========================================================================
   ACCORDION ANIMATIONS - COMPLETE OVERRIDE
   ========================================================================= */

/* CRITICAL: Force all accordion content to always use display:block */
.accordion-content,
.accordion-header[aria-expanded="false"] + .accordion-content,
.accordion-header[aria-expanded="true"] + .accordion-content {
  display: block !important;
  /* Remove any display-based hiding - we use max-height instead */
}

/* Reset accordion container */
.accordion {
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: visible !important; /* Don't let container clip animations */
  margin-bottom: 16px;
}

/* Header styling */
.accordion-header {
  cursor: pointer !important;
  width: 100%;
  background: #f3f4f6 !important;
  border: none !important;
  padding: 16px 20px !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  text-align: left;
  font-weight: 600;
  font-size: 16px;
  transition: background-color 0.2s ease;
}

.accordion-header:hover {
  background-color: #e5e7eb !important;
}

.accordion-header h3 {
  margin: 0 !important;
  pointer-events: none;
  font-size: inherit;
}

/* Icon - override all icon rules */
.accordion-icon {
  font-size: 18px !important;
  color: #64748b !important;
  pointer-events: none;
  min-width: 20px;
  text-align: center;
  transition: none !important; /* JavaScript will handle rotation */
  transform: none !important;
}

/* Override the main CSS icon rotation rules */
.accordion-header[aria-expanded="false"] .accordion-icon,
.accordion-header[aria-expanded="true"] .accordion-icon {
  transform: none !important;
  transition: none !important;
}

/* Content area - JavaScript will handle all animation */
.accordion-content {
  padding: 14px !important;
}

/* Focus state */
.accordion-header:focus {
  outline: 2px solid #5063ad;
  outline-offset: 2px;
  border-radius: 4px;
}


/* =====================================================
   SLIDE-IN PREVIEW PANEL - Full Screen Form with Preview Toggle
   ===================================================== */

/* Override the grid layout to make form full width */
#appShell {
  position: relative;
  max-width: 1200px !important;
  margin: 0 auto !important;
}

/* On desktop, override the two-column grid to single column */
@media (min-width: 1024px) {
  #appShell {
    grid-template-columns: 1fr !important; /* Single column instead of two */
    max-width: 1200px !important;
    margin: 0 auto !important;
  }
}

.appShell-left {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 24px !important;
}

/* Hide preview panel by default - only show on invoice page */
.invoice-preview {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 1200px !important;
  height: 100vh;
  background: var(--bg, #fff);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  transform: translateX(100%); /* Hidden off-screen by default */
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  z-index: 1001;
  display: none; /* Hidden by default */
}

/* Hide the inline preview on desktop (we're using slide-in instead) */
@media (min-width: 1024px) {
  #appShell .invoice-preview {
    position: fixed;
  }
}

/* Only show preview panel when appShell is visible */
#appShell:not([style*="display: none"]):not([style*="display:none"]) .invoice-preview {
  display: block;
  max-width: 1200px !important;
}

/* Show preview ONLY when user clicks toggle button (is-active class) */
.invoice-preview.is-active {
  transform: translateX(0); /* Slide in when active */
}

/* Show preview when active */
.invoice-preview.is-active {
  transform: translateX(0);
}

/* Preview panel header adjustments */
.invoice-preview header.no-print {
  position: sticky;
  top: 0;
  background: var(--bg, #fff);
  z-index: 10;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line, #e5e7eb);
  display: flex;
  align-items: center;
  gap: 12px;
}

.invoice-preview header.no-print .actions {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

/* Close button styling */
.preview-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted, #64748b);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.preview-close-btn:hover {
  background: var(--hover, #f1f5f9);
  color: var(--fg, #0f172a);
}

.preview-close-btn:active {
  transform: scale(0.95);
}

/* Floating preview toggle button - ONLY visible on New Invoice page */
.preview-toggle-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: none; /* Hidden by default */
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  background: var(--accent, #5063ad);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 1000; /* Above form, below preview panel */
}

/* Only show button when appShell is visible (on New Invoice page) */
#appShell:not([style*="display: none"]):not([style*="display:none"]) .preview-toggle-btn {
  display: flex;
}

.preview-toggle-btn:hover {
  background: var(--accent-hover, #607acc);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
  transform: translateY(-2px);
}

.preview-toggle-btn:active {
  transform: translateY(0);
}

.preview-toggle-btn svg {
  flex-shrink: 0;
}

/* Hide preview button when preview is active */
.invoice-preview.is-active ~ * .preview-toggle-btn,
.preview-toggle-btn.is-hidden {
  opacity: 0;
  pointer-events: none;
}

/* Overlay when preview is open */
.preview-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(17,24,39,.55);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 1000; /* Same level as button, below preview */
}

.preview-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .invoice-preview {
    max-width: 100%;
  }

  .preview-toggle-btn {
    bottom: 16px;
    right: 16px;
    padding: 12px 20px;
    font-size: 14px;
  }

  .preview-toggle-btn span {
    display: none;
  }

  /* Show only icon on mobile */
  .preview-toggle-btn svg {
    width: 24px;
    height: 24px;
  }
}

@media (min-width: 1400px) {
  /* On large screens, make preview wider */
  .invoice-preview {
    max-width: 700px;
  }
}

/* Print styles - ensure preview is visible when printing */
@media print {
  /* CRITICAL: Force ALL containers to be fully visible */
  * {
    overflow: visible !important;
    max-height: none !important;
  }
  
  html, body {
    height: auto !important;
    overflow: visible !important;
  }
  
  .invoice-preview {
    position: static !important;
    transform: none !important;
    max-width: none !important;
    box-shadow: none !important;
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
  }
  
  /* Ensure the invoice inside the preview is fully visible */
  .invoice-preview .invoice,
  #invoicePreview {
    position: static !important;
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
  }

  .preview-toggle-btn,
  .preview-close-btn,
  .preview-overlay {
    display: none !important;
  }

  /* Remove wrapper styling on print for saved invoice preview */
  #invoicePreviewWrapper {
    background: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
  }
  
  /* Hide the left input panel when printing */
  .appShell-left {
    display: none !important;
  }
  
  /* Ensure all invoice content is visible */
  .invoice,
  .invoice * {
    page-break-inside: avoid;
  }
}


/* =========================================================================
   FORM ACTIONS & BUTTON STATES (UX Improvements)
   ========================================================================= */

/* Form actions section styling */
.form-actions {
  background: var(--panel, #f8fafc);
  padding: 20px;
  border-radius: 8px;
}

.form-actions .row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
}

@media (max-width: 768px) {
  .form-actions .row {
    flex-direction: column;
    align-items: stretch;
  }

  .form-actions button {
    width: 100%;
  }
}

/* Disabled button states */
button:disabled,
button[disabled] {
  opacity: 0.5;
  cursor: not-allowed !important;
  pointer-events: none;
}

button.primary:disabled,
button.primary[disabled] {
  background: #94a3b8 !important;
  opacity: 0.6;
}

button.btn:disabled,
button.btn[disabled] {
  background: #e2e8f0 !important;
  color: #94a3b8 !important;
  opacity: 0.6;
}

button.danger:disabled,
button.danger[disabled] {
  background: #fca5a5 !important;
  opacity: 0.6;
}

/* Disabled button hover should not change */
button:disabled:hover,
button[disabled]:hover {
  transform: none !important;
  box-shadow: none !important;
}

/* =========================================================================
   CUSTOM MODAL SYSTEM (Replaces browser alert/confirm)
   Styled to match the white client selection modal
   ========================================================================= */

.custom-modal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 10000 !important;
  display: none;
  align-items: center !important;
  justify-content: center !important;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.custom-modal.show {
  opacity: 1;
}

.custom-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(17,24,39,.55);
  backdrop-filter: blur(2px);
}

.custom-modal-content {
  position: relative !important;
  background: white !important;
  border: 1px solid var(--line) !important;
  border-radius: 12px !important; /* ← STANDARDIZED 12px */
  box-shadow: 0 24px 70px rgba(0,0,0,.22) !important;
  width: 90% !important;
  max-width: 500px !important;
  max-height: 90vh !important;
  overflow: hidden;
  display: flex !important;
  flex-direction: column !important;
  animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10001 !important;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.custom-modal-header {
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.custom-modal-header h2 {
  font-size: 24px; /* ← STANDARDIZED */
  font-weight: 600; /* ← STANDARDIZED */
  color: #111827; /* ← STANDARDIZED */
  margin: 0;
  padding: 0;
  line-height: 1.2;
  flex: 1;
}

.custom-modal-close {
  width: 36px; /* ← STANDARDIZED */
  height: 36px; /* ← STANDARDIZED */
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e5e7eb; /* ← STANDARDIZED */
  border-radius: 8px;
  background: #fff;
  color: #6b7280;
  font-size: 24px; /* ← STANDARDIZED */
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  padding: 0;
}

.custom-modal-close:hover {
  background: #f9fafb;
  border-color: #d1d5db;
  color: #111827;
}

.custom-modal-close:active {
  background: #f3f4f6;
  transform: scale(0.95);
}

.custom-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.custom-modal-body p {
  font-size: 16px;
  line-height: 1.6;
  color: #475569;
  margin: 0;
}

.custom-modal-footer {
  padding: 16px 24px 24px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  border-top: 1px solid #f1f5f9;
}

.custom-modal-footer button {
  min-width: 100px;
}

/* Mobile responsive */
@media (max-width: 640px) {
  .custom-modal-content {
    width: calc(100vw - 24px);
    max-width: none;
    border-radius: 12px; /* ← Keep 12px on mobile */
  }

  .custom-modal-header {
    padding: 16px 20px;
  }

  .custom-modal-header h2 {
    font-size: 20px;
  }

  .custom-modal-body {
    padding: 20px;
  }

  .custom-modal-footer {
    padding: 12px 20px 20px;
    flex-direction: column-reverse;
  }

  .custom-modal-footer button {
    width: 100%;
  }
}
/* ========================================
   HNRY-STYLE ENHANCEMENTS - COMPATIBLE
   Uses unique class names to avoid conflicts
   ======================================== */

/* Header */
.invoices-header-hnry {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
  gap: 16px;
}

.btn-create-new-hnry {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #0f172a;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-create-new-hnry:hover {
  background: #1e293b;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

/* Filters Row */
.invoices-filters-hnry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

  .filter-group-hnry {
    display: flex;
    flex-direction: row;
    gap: 12px;
    width: 452px;
  }


.search-box-hnry {
  position: relative;
  flex: 0 0 320px;
  min-width: 200px;
}

.search-box-hnry .search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

.search-box-hnry input {
  width: 100%;
  padding: 11px 42px 11px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 16px;
  color: #0f172a;
  background: white;
  transition: all 0.2s ease;
}

.search-box-hnry input:focus {
  outline: none;
  border-color: #001840;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* DISABLED: /* DISABLED: .search-box-hnry input::placeholder { */ */
  color: #94a3b8;
} */ */

.filter-group-hnry {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.custom-select-hnry {
  position: relative;
  min-width: 200px;
}

.custom-select-hnry select {
  width: 100%;
  padding: 11px 36px 11px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  color: #475569;
  background: white;
  cursor: pointer;
  appearance: none;
  transition: all 0.2s ease;
}

.custom-select-hnry select:hover {
  border-color: #cbd5e1;
}

.custom-select-hnry select:focus {
  outline: none;
  border-color: var(--hnry-navy);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.custom-select-hnry .select-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #64748b;
}

/* Table Styling */
.invoices-table-card-hnry {
  padding: 0 !important;
}

.invoices-table-wrap-hnry {
  overflow-x: auto;
}

.invoices-table-hnry {
  /* Inherits all base table styles */
}

.invoices-table-hnry thead {
  /* Inherits unified header styles */
}

.invoices-table-hnry th {
  /* Inherits unified th styles */
}

.invoices-table-hnry th.text-right {
  /* Already handled by base table th.text-right */
}

.invoices-table-hnry th.actions-col-hnry {
  width: 120px;
}

.invoice-row-hnry {
  /* Inherits base tbody tr styles */
  cursor: pointer;
}

.invoice-row-hnry:last-child {
  /* Already handled by base table tbody tr:last-child */
}

.invoice-row-hnry:hover {
  /* Inherits base tbody tr:hover */
}

/* Buttons now always visible - hover rule removed */

.invoice-row-hnry td {
  /* Inherits base td styles */
}

.invoice-no-hnry {
  font-weight: 600;
  color: #0f172a;
  font-size: 14px;
  /* Uses Inter font from body - no monospace override */
}

.client-name-hnry {
  color: #475569;
}

.due-date-hnry {
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

.invoice-total-hnry {
  text-align: left;
  font-weight: 500;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  display: block;
}

/* Status Badges */
.status-badge-hnry {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  text-transform: capitalize;
}


.status-badge-hnry.status-Sent {
  background: #DFF6DF;
  color: #92400e;
}

.status-badge-hnry.status-draft {
  background: #EDF1F5;
  color: #92400e;
}

.status-badge-hnry.status-sent {
  background: #dbeafe;
  color: #1e40af;
}

.status-badge-hnry.status-paid {
  background: #d1fae5;
  color: #065f46;
}

.status-badge-hnry.status-overdue {
  background: #fee2e2;
  color: #991b1b;
}

/* Row Actions */
.row-actions-hnry {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  opacity: 1;
  visibility: visible;
  transition: all 0.2s ease;
}

.action-btn-hnry {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: #64748b;
}

.action-btn-hnry:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.action-btn-hnry.duplicate:hover {
  background: #dbeafe;
  color: #607acc;
}

.action-btn-hnry.delete:hover {
  background: #fee2e2;
  color: #dc2626;
}

.action-btn-hnry svg {
  width: 18px;
  height: 18px;
}

/* Responsive */
/* Summary Page Styles */
.dash-income-chart-card {
  grid-column: span 2; /* 2/3 width - same as 2 KPI boxes on desktop */
  overflow: hidden; /* Prevent any overflow */
}

.dash-income-chart-card .dash-card-hd {
  margin-bottom: 0; /* Remove any bottom margin */
}

.chart-canvas-wrapper {
  padding: 20px;
  padding-bottom: 20px;
  height: 320px; /* Fixed height for consistent display */
  position: relative;
}

.dash-income-chart-card canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* Mobile: Chart takes full width */
@media (max-width: 980px) {
  .dash-income-chart-card {
    grid-column: span 1; /* Full width on mobile */
  }

  .chart-canvas-wrapper {
    padding: 16px;
    height: 280px; /* Slightly smaller on tablet */
  }
}

@media (max-width: 480px) {
  .chart-canvas-wrapper {
    padding: 12px;
    height: 240px; /* Smaller on phone */
  }
}

#summaryWrap {
}

#summaryWrap table {
  margin-bottom: 0; /* No extra margin inside wrapper */
  table-layout: fixed; /* Fixed layout for consistent column widths across currency tables */
  width: 100%;
}

#summaryWrap table:not(:last-child) {
  margin-bottom: 20px; /* Space between multiple currency tables */
}

.btn-export-hnry {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: white;
  color: #64748b;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-export-hnry:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

.btn-export-hnry svg {
  flex-shrink: 0;
  color: #94a3b8;
}

@media (max-width: 768px) {
  .summary-export-btn {
    flex: 1;
    justify-content: center;
  }

  .filter-group-hnry {
    display: flex;
    flex-direction: row;
    gap: 12px;
    flex-wrap: wrap;
  }
}

/* Invoice Preview View Styles */
#invoicePreviewShell .page-wrap {
  max-width: 900px;
  margin: 0 auto;
}

/* DISABLED - using inherited .invoice styles instead */ // #invoicePreviewView {
/* DISABLED - using inherited .invoice styles instead */ //   background: white;
/* DISABLED - using inherited .invoice styles instead */ //   font-size: 14px;
/* DISABLED - using inherited .invoice styles instead */ //   line-height: 1.6;
/* DISABLED - using inherited .invoice styles instead */ // }
/* DISABLED - using inherited .invoice styles instead */ //
/* DISABLED - using inherited .invoice styles instead */ // #invoicePreviewView .inv-top {
/* DISABLED - using inherited .invoice styles instead */ //   display: flex;
/* DISABLED - using inherited .invoice styles instead */ //   justify-content: space-between;
/* DISABLED - using inherited .invoice styles instead */ //   gap: 40px;
/* DISABLED - using inherited .invoice styles instead */ //   margin-bottom: 32px;
/* DISABLED - using inherited .invoice styles instead */ //   padding-bottom: 24px;
/* DISABLED - using inherited .invoice styles instead */ //   border-bottom: 2px solid #e2e8f0;
/* DISABLED - using inherited .invoice styles instead */ // }
/* DISABLED - using inherited .invoice styles instead */ //
/* DISABLED - using inherited .invoice styles instead */ // #invoicePreviewView .inv-brand h2 {
/* DISABLED - using inherited .invoice styles instead */ //   font-size: 24px;
/* DISABLED - using inherited .invoice styles instead */ //   margin: 12px 0 8px 0;
/* DISABLED - using inherited .invoice styles instead */ //   color: #0f172a;
/* DISABLED - using inherited .invoice styles instead */ // }
/* DISABLED - using inherited .invoice styles instead */ //
/* DISABLED - using inherited .invoice styles instead */ // #invoicePreviewView .inv-brand .meta {
/* DISABLED - using inherited .invoice styles instead */ //   color: #64748b;
/* DISABLED - using inherited .invoice styles instead */ //   font-size: 13px;
/* DISABLED - using inherited .invoice styles instead */ //   line-height: 1.6;
/* DISABLED - using inherited .invoice styles instead */ //   white-space: pre-wrap;
/* DISABLED - using inherited .invoice styles instead */ // }
/* DISABLED - using inherited .invoice styles instead */ //
/* DISABLED - using inherited .invoice styles instead */ // #invoicePreviewView .inv-right h3 {
/* DISABLED - using inherited .invoice styles instead */ //   font-size: 32px;
/* DISABLED - using inherited .invoice styles instead */ //   font-weight: 700;
/* DISABLED - using inherited .invoice styles instead */ //   color: #0f172a;
/* DISABLED - using inherited .invoice styles instead */ //   margin: 0 0 16px 0;
/* DISABLED - using inherited .invoice styles instead */ //   text-align: right;
/* DISABLED - using inherited .invoice styles instead */ // }
/* DISABLED - using inherited .invoice styles instead */ //
/* DISABLED - using inherited .invoice styles instead */ // #invoicePreviewView .kv {
/* DISABLED - using inherited .invoice styles instead */ //   display: grid;
/* DISABLED - using inherited .invoice styles instead */ //   grid-template-columns: auto auto;
/* DISABLED - using inherited .invoice styles instead */ //   gap: 8px 16px;
/* DISABLED - using inherited .invoice styles instead */ //   font-size: 13px;
/* DISABLED - using inherited .invoice styles instead */ // }
/* DISABLED - using inherited .invoice styles instead */ //
/* DISABLED - using inherited .invoice styles instead */ // #invoicePreviewView .kv > div:nth-child(odd) {
/* DISABLED - using inherited .invoice styles instead */ //   color: #64748b;
/* DISABLED - using inherited .invoice styles instead */ //   text-align: right;
/* DISABLED - using inherited .invoice styles instead */ // }
/* DISABLED - using inherited .invoice styles instead */ //
/* DISABLED - using inherited .invoice styles instead */ // #invoicePreviewView .kv > div:nth-child(even) {
/* DISABLED - using inherited .invoice styles instead */ //   color: #0f172a;
/* DISABLED - using inherited .invoice styles instead */ //   font-weight: 500;
/* DISABLED - using inherited .invoice styles instead */ // }
/* DISABLED - using inherited .invoice styles instead */ //
/* DISABLED - using inherited .invoice styles instead */ // #invoicePreviewView .inv-client {
/* DISABLED - using inherited .invoice styles instead */ //   margin-bottom: 32px;
/* DISABLED - using inherited .invoice styles instead */ //   padding: 20px;
/* DISABLED - using inherited .invoice styles instead */ //   background: #f8fafc;
/* DISABLED - using inherited .invoice styles instead */ //   border-radius: 8px;
/* DISABLED - using inherited .invoice styles instead */ // }
/* DISABLED - using inherited .invoice styles instead */ //
/* DISABLED - using inherited .invoice styles instead */ // #invoicePreviewView .inv-client h4 {
/* DISABLED - using inherited .invoice styles instead */ //   margin: 0 0 12px 0;
/* DISABLED - using inherited .invoice styles instead */ //   font-size: 13px;
/* DISABLED - using inherited .invoice styles instead */ //   font-weight: 600;
/* DISABLED - using inherited .invoice styles instead */ //   color: #64748b;
/* DISABLED - using inherited .invoice styles instead */ //   text-transform: uppercase;
/* DISABLED - using inherited .invoice styles instead */ //   letter-spacing: 0.05em;
/* DISABLED - using inherited .invoice styles instead */ // }
/* DISABLED - using inherited .invoice styles instead */ //
/* DISABLED - using inherited .invoice styles instead */ // #invoicePreviewView .client-block {
/* DISABLED - using inherited .invoice styles instead */ //   margin: 0;
/* DISABLED - using inherited .invoice styles instead */ //   font-family: inherit;
/* DISABLED - using inherited .invoice styles instead */ //   color: #0f172a;
/* DISABLED - using inherited .invoice styles instead */ //   white-space: pre-wrap;
/* DISABLED - using inherited .invoice styles instead */ //   font-size: 14px;
/* DISABLED - using inherited .invoice styles instead */ // }
/* DISABLED - using inherited .invoice styles instead */ //
/* DISABLED - using inherited .invoice styles instead */ // #invoicePreviewView .inv-table {
/* DISABLED - using inherited .invoice styles instead */ //   width: 100%;
/* DISABLED - using inherited .invoice styles instead */ //   margin-bottom: 32px;
/* DISABLED - using inherited .invoice styles instead */ //   border-collapse: collapse;
/* DISABLED - using inherited .invoice styles instead */ // }
/* DISABLED - using inherited .invoice styles instead */ //
/* DISABLED - using inherited .invoice styles instead */ // #invoicePreviewView .inv-table th,
/* DISABLED - using inherited .invoice styles instead */ // #invoicePreviewView .inv-table td {
/* DISABLED - using inherited .invoice styles instead */ //   padding: 12px;
/* DISABLED - using inherited .invoice styles instead */ //   text-align: left;
/* DISABLED - using inherited .invoice styles instead */ //   border-bottom: 1px solid #e2e8f0;
/* DISABLED - using inherited .invoice styles instead */ // }
/* DISABLED - using inherited .invoice styles instead */ //
/* DISABLED - using inherited .invoice styles instead */ // #invoicePreviewView .inv-table th {
/* DISABLED - using inherited .invoice styles instead */ //   background: #f8fafc;
/* DISABLED - using inherited .invoice styles instead */ //   font-weight: 600;
/* DISABLED - using inherited .invoice styles instead */ //   font-size: 13px;
/* DISABLED - using inherited .invoice styles instead */ //   color: #64748b;
/* DISABLED - using inherited .invoice styles instead */ //   text-transform: uppercase;
/* DISABLED - using inherited .invoice styles instead */ //   letter-spacing: 0.05em;
/* DISABLED - using inherited .invoice styles instead */ // }
/* DISABLED - using inherited .invoice styles instead */ //
/* DISABLED - using inherited .invoice styles instead */ // #invoicePreviewView .inv-table td.num,
/* DISABLED - using inherited .invoice styles instead */ // #invoicePreviewView .inv-table th.num {
/* DISABLED - using inherited .invoice styles instead */ //   text-align: right;
/* DISABLED - using inherited .invoice styles instead */ // }
/* DISABLED - using inherited .invoice styles instead */ //
/* DISABLED - using inherited .invoice styles instead */ // #invoicePreviewView .inv-table tfoot th {
/* DISABLED - using inherited .invoice styles instead */ //   background: white;
/* DISABLED - using inherited .invoice styles instead */ //   font-weight: 600;
/* DISABLED - using inherited .invoice styles instead */ //   color: #0f172a;
/* DISABLED - using inherited .invoice styles instead */ //   font-size: 14px;
/* DISABLED - using inherited .invoice styles instead */ // }
/* DISABLED - using inherited .invoice styles instead */ //
/* DISABLED - using inherited .invoice styles instead */ // #invoicePreviewView .inv-table tfoot tr.total-row th {
/* DISABLED - using inherited .invoice styles instead */ //   font-size: 16px;
/* DISABLED - using inherited .invoice styles instead */ //   padding-top: 16px;
/* DISABLED - using inherited .invoice styles instead */ //   border-top: 2px solid #0f172a;
/* DISABLED - using inherited .invoice styles instead */ // }
/* DISABLED - using inherited .invoice styles instead */ //
/* DISABLED - using inherited .invoice styles instead */ // #invoicePreviewView .inv-foot {
/* DISABLED - using inherited .invoice styles instead */ //   display: grid;
/* DISABLED - using inherited .invoice styles instead */ //   grid-template-columns: 1fr 1fr;
/* DISABLED - using inherited .invoice styles instead */ //   gap: 24px;
/* DISABLED - using inherited .invoice styles instead */ // }
/* DISABLED - using inherited .invoice styles instead */ //
/* DISABLED - using inherited .invoice styles instead */ // #invoicePreviewView .notes h4 {
/* DISABLED - using inherited .invoice styles instead */ //   margin: 0 0 8px 0;
/* DISABLED - using inherited .invoice styles instead */ //   font-size: 13px;
/* DISABLED - using inherited .invoice styles instead */ //   font-weight: 600;
/* DISABLED - using inherited .invoice styles instead */ //   color: #64748b;
/* DISABLED - using inherited .invoice styles instead */ //   text-transform: uppercase;
/* DISABLED - using inherited .invoice styles instead */ //   letter-spacing: 0.05em;
/* DISABLED - using inherited .invoice styles instead */ // }
/* DISABLED - using inherited .invoice styles instead */ //
/* DISABLED - using inherited .invoice styles instead */ // #invoicePreviewView .notes pre {
/* DISABLED - using inherited .invoice styles instead */ //   margin: 0;
/* DISABLED - using inherited .invoice styles instead */ //   font-family: inherit;
/* DISABLED - using inherited .invoice styles instead */ //   color: #0f172a;
/* DISABLED - using inherited .invoice styles instead */ //   white-space: pre-wrap;
/* DISABLED - using inherited .invoice styles instead */ //   font-size: 14px;
/* DISABLED - using inherited .invoice styles instead */ // }
/* DISABLED - using inherited .invoice styles instead */ //
/* DISABLED - using inherited .invoice styles instead */ // /* Mobile responsive for preview */
/* DISABLED - using inherited .invoice styles instead */ // @media (max-width: 768px) {
/* DISABLED - using inherited .invoice styles instead */ //   #invoicePreviewView .inv-top {
/* DISABLED - using inherited .invoice styles instead */ //     flex-direction: column;
/* DISABLED - using inherited .invoice styles instead */ //     gap: 24px;
/* DISABLED - using inherited .invoice styles instead */ //   }
/* DISABLED - using inherited .invoice styles instead */ //
/* DISABLED - using inherited .invoice styles instead */ //   #invoicePreviewView .inv-right h3 {
/* DISABLED - using inherited .invoice styles instead */ //     text-align: left;
/* DISABLED - using inherited .invoice styles instead */ //   }
/* DISABLED - using inherited .invoice styles instead */ //
/* DISABLED - using inherited .invoice styles instead */ //   #invoicePreviewView .kv {
/* DISABLED - using inherited .invoice styles instead */ //     grid-template-columns: 1fr 1fr;
/* DISABLED - using inherited .invoice styles instead */ //   }
/* DISABLED - using inherited .invoice styles instead */ //
/* DISABLED - using inherited .invoice styles instead */ //   #invoicePreviewView .kv > div:nth-child(odd) {
/* DISABLED - using inherited .invoice styles instead */ //     text-align: left;
/* DISABLED - using inherited .invoice styles instead */ //   }
/* DISABLED - using inherited .invoice styles instead */ //
/* DISABLED - using inherited .invoice styles instead */ //   #invoicePreviewView .inv-foot {
/* DISABLED - using inherited .invoice styles instead */ //     grid-template-columns: 1fr;
/* DISABLED - using inherited .invoice styles instead */ //   }
/* DISABLED - using inherited .invoice styles instead */ // }


/* Email Preview Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.modal-content {
  background: white;
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-height: 90vh;
  overflow-y: auto;
  width: 100%;
}

@media (max-width: 640px) {
  .modal-content {
    padding: 24px;
  }
}


/* Email Success Modal Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

#emailSuccessModal .modal-content {
  animation: fadeIn 0.3s ease-out;
}

/* =====================================================
   PRINT STYLES - Clean invoice output
   Fixes: QR code visibility, full width, no modal chrome
   ===================================================== */


@media print {
  /* ============================================================
     SAVED INVOICE MODAL - PRINT STYLES
     Uses body.printing-saved-invoice class for precise control
     ============================================================ */
  
  /* When printing saved invoice, hide everything except modal */
  body.printing-saved-invoice > *:not(#savedInvoiceModal) {
    display: none !important;
  }
  
  body.printing-saved-invoice #savedInvoiceModal {
    display: block !important;
    position: static !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: white !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
    transform: none !important;
  }
  
  /* Hide modal chrome when printing */
  body.printing-saved-invoice #savedInvoiceModal > .modal-header,
  body.printing-saved-invoice #savedInvoiceModal .modal-header h2,
  body.printing-saved-invoice #savedInvoiceModal .actions,
  body.printing-saved-invoice #btnCloseSavedInvoiceModal,
  body.printing-saved-invoice #btnPrintSavedInvoice,
  body.printing-saved-invoice #btnEmailSavedInvoice,
  body.printing-saved-invoice #btnEditSavedInvoice,
  body.printing-saved-invoice .invoice-paid-row,
  body.printing-saved-invoice .modal-backdrop {
    display: none !important;
  }
  
  /* Modal structure */
  body.printing-saved-invoice #savedInvoiceModal .modal-dialog {
    position: static !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    box-shadow: none !important;
  }
  
  body.printing-saved-invoice #savedInvoiceModal .modal-body,
  body.printing-saved-invoice #savedInvoiceModal .custom-modal-body {
    position: static !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
  }
  
  /* Invoice content */
  body.printing-saved-invoice #savedInvoiceModalContent {
    position: static !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 40px !important;
    overflow: visible !important;
    display: block !important;
  }
  
  body.printing-saved-invoice #savedInvoiceModalContent .invoice {
    position: static !important;
    width: 100% !important;
    max-width: none !important;
    overflow: visible !important;
    height: auto !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  
  body.printing-saved-invoice #savedInvoiceModalContent .invoice * {
    overflow: visible !important;
  }
  
  body.printing-saved-invoice #savedInvoiceModalContent img {
    display: inline-block !important;
    visibility: visible !important;
  }
  
  /* Hide other modals (fallback for non-saved-invoice prints) */
  #clientModal,
  #emailPreviewModal,
  #emailVerificationModal {
    display: none !important;
  }
  
  /* Custom font sizes for PDF/Print */
  .inv-brand h2 {
    font-size: 18px !important;
  }
  
  table td {
    font-size: 12px !important;
  }
  
  .totals .line {
    font-size: 12px !important;
  }
  
  .totals .grand {
    font-size: 12px !important;
  }
  
  .inv-brand .meta,
  .kv {
    font-size: 11px !important;
  }
  
  .inv-right h3 {
    font-size: 14px !important;
  }
  
  table th {
    font-size: 11px !important;
  }
  
  .box .txt {
    font-size: 11px !important;
  }
  
  .box h4 {
    font-size: 10px !important;
  }

  @page {
    margin: 0;
  }
}
/* =====================================================
/* =====================================================
   NAVIGATION TEXT COLOR FIX
   White text by default, dark grey on hover
   ===================================================== */

/* Navigation items - white text by default */
.nav-item,
button.nav-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: white; /* White text by default */
  background: transparent;
  border: none;
  width: 100%;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: var(--space-1);
  text-align: left;
}

/* Icon color - white by default */
.nav-item .nav-ico,
.nav-item svg {
  width: 24px;
  min-width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: white; /* White icon */
}

/* Label color - white by default */
.nav-item .nav-label {
  text-align: left;
  flex: 1;
  white-space: nowrap;
  color: white; /* White text */
}

/* Hover state - dark grey text */
.nav-item:hover {
  background: var(--apple-gray-100);
  color: var(--apple-gray-900); /* Dark grey text on hover */
}

.nav-item:hover .nav-ico,
.nav-item:hover svg,
.nav-item:hover .nav-label {
  color: var(--apple-gray-900); /* Dark grey on hover */
}

/* Active state - white text on blue background */
.nav-item.active,
.nav-item.is-active {
  background: var(--apple-blue);
  color: white;
  font-weight: var(--weight-semibold);
}

.nav-item.active .nav-ico,
.nav-item.active svg,
.nav-item.active .nav-label,
.nav-item.is-active .nav-ico,
.nav-item.is-active svg,
.nav-item.is-active .nav-label {
  color: white; /* White text when active */
}

/* =====================================================
   SINGLE FONT FAMILY - Global Override
   Ensure Inter is used everywhere
   ===================================================== */

/* Global font family - applies to everything */
* {
  font-family: inherit;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif !important;
}

/* Force all interactive elements to use Inter */
button,
.btn,
input,
textarea,
select,
option {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif !important;
}

/* Force headings to use Inter */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif !important;
}

/* Force code/pre elements to use Inter (no mono font) */
code,
pre,
kbd,
samp,
.code {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif !important;
}

/* Force table elements to use Inter */
table,
th,
td {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif !important;
}

/* Force navigation to use Inter */
.nav-item,
.nav-label {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif !important;
}

/* Force all text elements to use Inter */
p,
span,
div,
a,
label {
  font-family: inherit;
}
/* =====================================================
   APPLE-STYLE ICON SYSTEM
   Clean, consistent SVG icons throughout the app
   ===================================================== */

/* Icon wrapper - consistent sizing */
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.icon-sm {
  width: 16px;
  height: 16px;
}

.icon-md {
  width: 20px;
  height: 20px;
}

.icon-lg {
  width: 24px;
  height: 24px;
}

/* Icon colors */
.icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Button icon spacing */
button .icon {
  margin-right: 6px;
}

button .icon:only-child {
  margin-right: 0;
}

/* Table action icons */
.actions .icon {
  width: 18px;
  height: 18px;
}

/* Icon-only buttons */
button.icon-only {
  padding: 8px;
  min-width: auto;
}

button.icon-only .icon {
  margin: 0;
}

/* =====================================================
   HNRY-STYLE RECENT INVOICES LIST
   Clean, minimal list with chevron arrows
   ===================================================== */

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.recent-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background-color 150ms ease;
  min-height: 72px;
}

.recent-list-item:first-child {
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
}

.recent-list-item:last-child {
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
  border-bottom: none;
}

.recent-list-item:hover {
  background: var(--apple-gray-100);
}

.recent-list-item:active {
  background: var(--apple-gray-200);
}

.recent-list-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.recent-list-client {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

.recent-list-date {
  font-size: 14px;
  color: var(--muted);
  font-weight: 400;
}

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

.recent-list-amount {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  text-align: right;
}

.recent-list-chevron {
  width: 20px;
  height: 20px;
  color: var(--muted);
  flex-shrink: 0;
}

/* View all link in header */
.dash-card-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash-view-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background-color 150ms ease;
}

.dash-view-all:hover {
  background: var(--apple-gray-100);
}

.dash-view-all svg {
  width: 16px;
  height: 16px;
}

/* Empty state updates */
.dash-empty {
  padding: 40px 20px;
}

/* Hide empty state when items exist */
.dash-card.has-items .dash-empty {
  display: none;
}

.dash-card.has-items .recent-list {
  display: flex;
}

.dash-card:not(.has-items) .recent-list {
  display: none;
}

/* =============================================================================
   HNRY-STYLE CLIENT MODAL - Modern & Sleek Design
   ============================================================================= */

/* Overlay */
.client-overlay {
  position: absolute;  /* Absolute within wrapper, not fixed */
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 0;  /* Behind modal content */
  animation: fadeIn 0.2s ease;
}

/* ============================================
   CUSTOM CONFIRM MODAL (Hnry-style)
   ============================================ */

.confirm-modal.hnry-style {
  /* NO TRANSFORM: Use inset + margin for stable centering */
  position: fixed;
  inset: 0;
  margin: auto;
  width: 90%;
  max-width: 480px;
  height: fit-content;
  max-height: calc(100vh - 40px);
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  z-index: 10001;
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* Modal Header - matches client modal */
.confirm-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 20px 24px;
  border-bottom: 1px solid #f1f5f9;
}

.confirm-modal-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  line-height: 1.2;
}

.confirm-modal-header .close-btn {
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.confirm-modal-header .close-btn:hover {
  background: #f1f5f9;
  color: #64748b;
}

/* Modal Content */
.confirm-modal-content {
  padding: 32px;
  text-align: center;
}

.confirm-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.confirm-icon svg {
  width: 80px;
  height: 80px;
}

.confirm-message {
  font-size: 15px;
  color: #64748b;
  line-height: 1.6;
  margin: 0 0 28px 0;
  white-space: pre-line;
}

.confirm-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.confirm-buttons button {
  min-width: 100px;
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 500;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.confirm-buttons .btn-secondary {
  background: #f1f5f9;
  color: #64748b;
}

.confirm-buttons .btn-secondary:hover {
  background: #e2e8f0;
}

.confirm-buttons .btn-primary {
  background: var(--hnry-navy);
  color: white;
}

.confirm-buttons .btn-primary:hover {
  background: #607acc;
}

.confirm-buttons .btn-danger {
  background: #ef4444;
  color: white;
}

.confirm-buttons .btn-danger:hover {
  background: #dc2626;
}

/* Modal Container */
.client-modal.hnry-style {
  /* NO TRANSFORM: Use inset + margin for stable centering */
  position: fixed;
  inset: 0;
  margin: auto;
  width: 90%;
  max-width: 580px;
  /* Explicit height so flex children (picker/create views) can fill it */
  height: 620px;
  min-height: 400px;
  max-height: 92vh;
  max-height: 92dvh;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Modal Header */
.client-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 20px 24px;
  border-bottom: 1px solid #f1f5f9;
}

.client-modal-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  line-height: 1.2;
}

.close-btn {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 28px;
  line-height: 1;
  font-weight: 300;
}

.close-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.close-btn:active {
  transform: scale(0.95);
}

/* Picker View */
.client-picker-view {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 0px;
  overflow-y: auto;
  flex: 1;
  min-height: 0; /* Safari flex scroll fix */
  /* Remove fixed max-height - let modal control height */
  max-height: none;
}

/* Create View */
.client-create-view {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  max-height: none;
}

/* Create New Button (Hnry style - outside dropdown) */
.create-new-wrapper {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0px;
}

.create-new-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #334155;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.create-new-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.create-new-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.create-new-btn svg {
  transition: transform 0.2s ease;
}

.create-new-btn:hover svg {
  transform: rotate(90deg);
}

/* Choose Existing Button */
.choose-existing-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: transparent;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #64748b;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.choose-existing-btn:hover {
  background: #f8fafc;
  color: #334155;
  border-color: #cbd5e1;
}

.choose-existing-btn:active {
  transform: scale(0.98);
}

/* Field Label */
.field-label {
  font-size: 15px;
  font-weight: 600;
  color: #334155;
  margin-bottom: -12px;
}

/* Search Field Wrapper */
.search-field-wrapper {
  position: relative;
}

.search-field {
  width: 100%;
  padding: 14px 44px 14px 16px;
  font-size: 16px;
  color: #0f172a;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  outline: none;
  transition: all 0.2s ease;
}

/* DISABLED: /* DISABLED: .search-field::placeholder { */ */
  color: #94a3b8;
} */ */

.search-field:focus {
  border-color: #5063ad;
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
}

.search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

/* Client Dropdown */
.client-dropdown {
  margin-top: -12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  max-height: 280px;
  overflow-y: auto;
}

.client-dropdown.fade-in {
  animation: dropdownFadeIn 0.25s ease;
}

/* Client List */
.client-list {
  padding: 4px;
}

/* Client Item */
.client-item {
  padding: 12px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.client-item:hover {
  background: #f8fafc;
  transform: translateX(2px);
}

.client-item:active {
  background: #f1f5f9;
  transform: scale(0.98);
}

.client-item-name {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 2px;
}

.client-item-email {
  font-size: 13px;
  color: #64748b;
}

/* No Results */
.no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  gap: 12px;
}

.no-results p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
}

/* Form Grid */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* Field Group */
.field-group {
  display: flex;
  flex-direction: column;
  padding: 4px 0;
}

.field-group label {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 4px;
}

.field-group input,
.field-group textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  color: #0f172a;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
}

/* DISABLED: /* DISABLED: .field-group input::placeholder, */ */
/* DISABLED: /* DISABLED: .field-group textarea::placeholder { */ */
  color: #94a3b8;
} */ */

.field-group input:focus,
.field-group textarea:focus {
  border-color: #5063ad;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.field-group textarea {
  resize: vertical;
  min-height: 60px;
}

/* Footer Buttons */
.client-footer {
  display: flex;
  gap: 12px;
  padding-top: 16px;
  margin-top: auto;
}

.btn-secondary {
  flex: 1;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  color: #64748b;
  background: transparent;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #334155;
}

.btn-secondary:active {
  transform: scale(0.98);
}

.btn-primary {
  flex: 1.5;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  background: var(--apple-blue);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: var(--apple-blue-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.25);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-primary:disabled {
  background: #cbd5e1;
  color: #94a3b8;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary.pulse {
  animation: buttonPulse 0.6s ease;
}

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

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(-2%);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes buttonPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
  100% {
    transform: scale(1);
  }
}

.slide-out-left {
  animation: slideOutLeft 0.3s ease forwards;
}

.slide-in-left {
  animation: slideInLeft 0.3s ease forwards;
}

.slide-out-right {
  animation: slideOutRight 0.3s ease forwards;
}

.slide-in-right {
  animation: slideInRight 0.3s ease forwards;
}

@keyframes slideOutLeft {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-20px);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(20px);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
  .client-modal.hnry-style {
    width: 95%;
    height: 75vh;
    height: 75dvh;
    min-height: 400px;
    max-height: 90vh;
    max-height: 90dvh;
    border-radius: 12px;
  }

  .client-modal-header {
    padding: 20px 20px 16px 20px;
  }

  .client-modal-header h2 {
    font-size: 20px;
  }

  .client-picker-view,
  .client-create-view {
    padding: 20px;
    gap: 16px;
  }

  .search-field {
    font-size: 16px;
    padding: 12px 40px 12px 14px;
  }

  .client-footer {
    flex-direction: column-reverse;
  }

  .btn-secondary,
  .btn-primary {
    width: 100%;
  }
}

/* Smooth scrollbar */
.client-dropdown::-webkit-scrollbar,
.client-picker-view::-webkit-scrollbar,
.client-create-view::-webkit-scrollbar {
  width: 6px;
}

.client-dropdown::-webkit-scrollbar-track,
.client-picker-view::-webkit-scrollbar-track,
.client-create-view::-webkit-scrollbar-track {
  background: transparent;
}

.client-dropdown::-webkit-scrollbar-thumb,
.client-picker-view::-webkit-scrollbar-thumb,
.client-create-view::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.client-dropdown::-webkit-scrollbar-thumb:hover,
.client-picker-view::-webkit-scrollbar-thumb:hover,
.client-create-view::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Critical fix for hidden attribute */
[hidden] {
  display: none !important;
}

/* Ensure only one view shows at a time */
.client-picker-view[hidden],
.client-create-view[hidden] {
  display: none !important;
}

.client-picker-view:not([hidden]) {
  display: flex !important;
}

.client-create-view:not([hidden]) {
  display: flex !important;
}
/* ===== SETTINGS TABS (Apple-style LIGHT) - v1.0.2 ===== */
.settings-tabs {
  display: flex;
  gap: 6px;
  background: #e8e8ed;
  padding: 6px;
  border-radius: 32px;
  margin-bottom: 32px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: fit-content;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}

.settings-tab {
  display: inline-block !important; /* Force inline-block instead of flex item */
  background: transparent;
  border: none;
  padding: 16px 24px;
  font-size: 14px;
  font-weight: 500;
  color: #1d1d1f;
  cursor: pointer;
  border-radius: 32px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  min-width: fit-content !important;
  max-width: none !important;
  width: auto !important;
  position: relative;
  letter-spacing: -0.01em;
  overflow: visible !important; /* Ensure text isn't clipped */
  text-overflow: clip !important; /* Don't use ellipsis */
  vertical-align: top; /* Align inline-block elements properly */
}

.settings-tab:hover:not(.active) {
  color: #000;
  background: rgba(0, 0, 0, 0.04);
}

.settings-tab.active {
  background: #1d1d1f;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12),
              0 1px 2px rgba(0, 0, 0, 0.08);
  font-weight: 600;
}

.settings-content {
  max-width: 800px;
  margin-top: 32px;
}

.settings-tab-content {
  display: none;
  animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-tab-content.active {
  display: block;
}

.settings-actions {
  padding-top: 24px;
  border-top: 1px solid #e5e5e7;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Save button visibility is controlled by JS (initSettingsTabs → updateSaveButtons) */

/* Half width for side-by-side fields */
.auth-grid .half {
  grid-column: span 1;
}

/* Apple-style page heading */
.page-head {
  margin-bottom: 24px;
}

.page-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #1d1d1f;
  margin: 0 0 8px 0;
}

.page-sub {
  font-size: 16px;
  color: #6e6e73;
  margin: 0;
  font-weight: 400;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .settings-tabs {
    width: 100%;
    gap: 8px;
    padding: 6px;
    padding-right: 6px; /* Reduced - no gradient overlay anymore */
    border-radius: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity; /* proximity instead of mandatory for better UX */
    scrollbar-width: none; /* Hide scrollbar on Firefox */
    -ms-overflow-style: none; /* Hide scrollbar on IE/Edge */
    position: relative;
    scroll-padding-left: 6px; /* Padding when scrolling */
  }
  
  /* Hide scrollbar on Chrome/Safari */
  .settings-tabs::-webkit-scrollbar {
    display: none;
  }
  
  /* Gradient removed - was covering tab text */
  .settings-tabs::after {
    display: none;
  }

  .settings-tab {
    display: inline-block !important; /* Force inline-block instead of flex item */
    padding: 12px 24px;
    font-size: 14px;
    flex-shrink: 0 !important; /* Prevent tabs from shrinking */
    min-width: fit-content !important; /* Let tabs be their natural width */
    white-space: nowrap !important; /* Prevent text wrapping */
    max-width: none !important; /* Remove any max-width constraints */
    border-radius: 12px;
    scroll-snap-align: start;
    scroll-margin-left: 6px;
    touch-action: pan-x; /* Optimize for horizontal scrolling */
  }

  .settings-content {
    max-width: 100%;
    margin-top: 24px;
  }

  .auth-grid .half {
    grid-column: span 2; /* Full width on mobile */
  }

  .settings-actions {
    flex-direction: column;
  }

  .settings-actions button {
    width: 100%;
  }

  .page-title {
    font-size: 28px;
  }

  .page-sub {
    font-size: 15px;
  }
}

/* Extra small phones - more compact tabs */
@media (max-width: 480px) {
  .settings-tabs {
    gap: 6px;
    padding: 5px;
    padding-right: 5px; /* Reduced - no gradient overlay */
  }
  
  .settings-tab {
    display: inline-block !important; /* Force inline-block instead of flex item */
    padding: 10px 18px;
    font-size: 13px;
    flex-shrink: 0 !important; /* Prevent tabs from shrinking */
    min-width: fit-content !important; /* Let tabs be their natural width */
    white-space: nowrap !important; /* Prevent text wrapping */
    max-width: none !important; /* Remove any max-width constraints */
    width: auto !important; /* Auto width based on content */
  }
  
  .page-title {
    font-size: 24px;
  }
  
  .page-sub {
    font-size: 14px;
  }
}

/* Smooth fade in animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Focus styles for accessibility */
.settings-tab:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 125, 250, 0.3);
}

.settings-tab:focus:not(:focus-visible) {
  box-shadow: none;
}

/* NO DARK MODE - Keep light theme always */
@media (prefers-color-scheme: dark) {
  .settings-tabs {
    background: #e8e8ed;
  }

  .settings-tab {
    color: #1d1d1f;
  }

  .settings-tab:hover:not(.active) {
    background: rgba(0, 0, 0, 0.04);
    color: #000;
  }

  .settings-tab.active {
    background: #1d1d1f;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12),
                0 1px 2px rgba(0, 0, 0, 0.08);
  }

  .page-title {
    color: #1d1d1f;
  }

  .page-sub {
    color: #6e6e73;
  }

  .settings-actions {
    border-top-color: #e5e5e7;
  }
}

/* ═══════════════════════════════════════════════════════════
   FORCE WHITE INPUTS - NUCLEAR OPTION
   This overrides EVERYTHING including browser defaults
   ═══════════════════════════════════════════════════════════ */

/* FORCE ALL INPUTS TO BE WHITE - NO EXCEPTIONS */
input,
input[type],
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="url"],
input[type="search"],
textarea,
select,
.auth-grid input,
.auth-grid textarea,
.auth-grid select,
#authShell input,
#authShell textarea,
#authShell select {
  background-color: #ffffff !important;
  background: #ffffff !important;
  background-image: none !important;
  color: #1d1d1f !important;
  border: 1px solid #d2d2d7 !important;
  border-radius: 8px !important;
  padding: 10px 12px !important;
  font-size: 16px !important;
/* DISABLED FOR PLACEHOLDERS: /* DISABLED FOR PLACEHOLDERS:   -webkit-text-fill-color: #1d1d1f !important; */ */
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
  transition: background-color 5000s ease-in-out 0s !important;
}

/* OVERRIDE AUTOFILL STYLES */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
textarea:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
/* DISABLED FOR PLACEHOLDERS: /* DISABLED FOR PLACEHOLDERS:   -webkit-text-fill-color: #1d1d1f !important; */ */
  background-color: #ffffff !important;
  background: #ffffff !important;
  border: 1px solid #d2d2d7 !important;
  transition: background-color 5000s ease-in-out 0s !important;
}

/* FOCUS STATE */
input:focus,
input[type]:focus,
textarea:focus,
select:focus {
  background-color: #ffffff !important;
  background: #ffffff !important;
  color: #1d1d1f !important;
  border-color: #0071e3 !important;
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1) !important;
  outline: none !important;
/* DISABLED FOR PLACEHOLDERS: /* DISABLED FOR PLACEHOLDERS:   -webkit-text-fill-color: #1d1d1f !important; */ */
}

/* HOVER STATE */
input:hover:not(:focus),
textarea:hover:not(:focus),
select:hover:not(:focus) {
  border-color: #a1a1a6 !important;
  background: #ffffff !important;
}

/* DISABLED STATE */
input:disabled,
textarea:disabled,
select:disabled {
  background: #f5f5f7 !important;
  background-color: #f5f5f7 !important;
  color: #86868b !important;
/* DISABLED FOR PLACEHOLDERS: /* DISABLED FOR PLACEHOLDERS:   -webkit-text-fill-color: #86868b !important; */ */
  cursor: not-allowed !important;
}

/* READONLY STATE */
input[readonly],
textarea[readonly] {
  background: #f8f9fa !important;
  background-color: #f8f9fa !important;
  color: #6e6e73 !important;
/* DISABLED FOR PLACEHOLDERS: /* DISABLED FOR PLACEHOLDERS:   -webkit-text-fill-color: #6e6e73 !important; */ */
}

/* PLACEHOLDER */
/* DISABLED: /* DISABLED: input::placeholder, */ */
/* DISABLED: /* DISABLED: textarea::placeholder { */ */
  color: #86868b !important;
  opacity: 1 !important;
} */ */

/* DISABLED: /* DISABLED: input::-webkit-input-placeholder { */ */
  color: #86868b !important;
} */ */

/* DISABLED: /* DISABLED: input::-moz-placeholder { */ */
  color: #86868b !important;
  opacity: 1 !important;
} */ */

/* DISABLED: /* DISABLED: input:-ms-input-placeholder { */ */
  color: #86868b !important;
} */ */

/* DISABLED: /* DISABLED: textarea::-webkit-input-placeholder { */ */
  color: #86868b !important;
} */ */

/* DISABLED: /* DISABLED: textarea::-moz-placeholder { */ */
  color: #86868b !important;
  opacity: 1 !important;
} */ */

/* DISABLED: /* DISABLED: textarea:-ms-input-placeholder { */ */
  color: #86868b !important;
} */ */

/* SELECT DROPDOWN ARROW */
select {
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%236e6e73' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-color: #ffffff !important;
  padding-right: 36px !important;
  cursor: pointer !important;
}

/* REMOVE ANY DARK MODE */
@media (prefers-color-scheme: dark) {
  input,
  input[type],
  textarea,
  select {
    background-color: #ffffff !important;
    background: #ffffff !important;
    color: #1d1d1f !important;
    border-color: #d2d2d7 !important;
/* DISABLED FOR PLACEHOLDERS: /* DISABLED FOR PLACEHOLDERS:     -webkit-text-fill-color: #1d1d1f !important; */ */
  }

  input:focus,
  textarea:focus,
  select:focus {
    background-color: #ffffff !important;
    background: #ffffff !important;
/* DISABLED FOR PLACEHOLDERS: /* DISABLED FOR PLACEHOLDERS:     -webkit-text-fill-color: #1d1d1f !important; */ */
  }
}

/* ═══════════════════════════════════════════════════════════
   CONSISTENT TYPOGRAPHY - ALL FORMS LOOK THE SAME
   ═══════════════════════════════════════════════════════════ */

/* FORCE CONSISTENT LABELS EVERYWHERE */
label,
.auth-grid label,
.form-grid label,
.client-create-view label,
.clientModal label,
#profileView label,
#authShell label,
.invoice-form label,
.field label,
.form-field label {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #1d1d1f !important;
  margin-bottom: 8px !important;
  display: block !important;
  letter-spacing: -0.01em !important;
  line-height: 1.4 !important;
}

/* FORCE CONSISTENT INPUTS EVERYWHERE */
input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="url"],
.auth-grid input,
.form-grid input,
.client-create-view input,
.clientModal input,
#profileView input,
#authShell input,
.invoice-form input,
.field input,
.form-field input {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  color: #1d1d1f !important;
  line-height: 1.5 !important;
  letter-spacing: -0.01em !important;
}

/* FORCE CONSISTENT TEXTAREAS EVERYWHERE */
textarea,
.auth-grid textarea,
.form-grid textarea,
.client-create-view textarea,
.clientModal textarea,
#profileView textarea,
#authShell textarea,
.invoice-form textarea,
.field textarea,
.form-field textarea {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  color: #1d1d1f !important;
  line-height: 1.6 !important;
  letter-spacing: -0.01em !important;
}

/* FORCE CONSISTENT SELECT DROPDOWNS */
select,
.auth-grid select,
.form-grid select,
.client-create-view select,
.clientModal select,
#profileView select,
#authShell select,
.invoice-form select,
.field select,
.form-field select {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  color: #1d1d1f !important;
  line-height: 1.5 !important;
}

/* FORCE CONSISTENT PLACEHOLDERS */
/* DISABLED: /* DISABLED: input::placeholder, */ */
/* DISABLED: /* DISABLED: textarea::placeholder, */ */
/* DISABLED: /* DISABLED: .auth-grid input::placeholder, */ */
/* DISABLED: /* DISABLED: .form-grid input::placeholder, */ */
/* DISABLED: /* DISABLED: .client-create-view input::placeholder, */ */
/* DISABLED: /* DISABLED: .clientModal input::placeholder, */ */
/* DISABLED: /* DISABLED: #profileView input::placeholder, */ */
/* DISABLED: /* DISABLED: #authShell input::placeholder { */ */
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  color: #86868b !important;
  opacity: 1 !important;
} */ */

/* DISABLED: /* DISABLED: input::-webkit-input-placeholder, */ */
/* DISABLED: /* DISABLED: textarea::-webkit-input-placeholder { */ */
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  color: #86868b !important;
} */ */

/* DISABLED: /* DISABLED: input::-moz-placeholder, */ */
/* DISABLED: /* DISABLED: textarea::-moz-placeholder { */ */
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  color: #86868b !important;
  opacity: 1 !important;
} */ */

/* FORCE CONSISTENT HELPER TEXT */
.hint,
.auth-help,
.field-help,
.form-help,
.auth-grid .hint,
.form-grid .hint,
.client-create-view .hint,
.clientModal .hint,
#profileView .hint,
#authShell .hint {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  color: #6e6e73 !important;
  line-height: 1.4 !important;
  margin-top: 6px !important;
}

/* FORCE CONSISTENT BUTTONS */
button,
.btn,
.cta,
.secondary,
.danger,
.auth-grid button,
.form-grid button,
.client-create-view button,
.clientModal button,
#profileView button,
#authShell button {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em !important;
}

/* FORCE CONSISTENT HEADINGS IN FORMS */
h1, h2, h3, h4, h5, h6,
.page-title,
.form-section-title,
.auth-grid h1,
.auth-grid h2,
.auth-grid h3,
.form-grid h1,
.form-grid h2,
.form-grid h3 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  letter-spacing: -0.02em !important;
}

/* Specific heading sizes */
h1, .page-title {
  font-size: 32px !important;
  font-weight: 700 !important;
}

h2 {
  font-size: 24px !important;
  font-weight: 700 !important;
}

h3, .form-section-title {
  font-size: 18px !important;
  font-weight: 600 !important;
}

/* FORCE CONSISTENT BODY TEXT */
p,
.page-sub,
.form-section-description,
.auth-grid p,
.form-grid p {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  font-size: 15px !important;
  font-weight: 400 !important;
  color: #1d1d1f !important;
  line-height: 1.5 !important;
}

/* Remove any conflicting styles */
* {
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
}

/* ============================================
   MOBILE CARD LAYOUTS (Replaces tables on mobile)
   ============================================ */

/* Card containers - hidden by default, shown on mobile */
.clients-cards,
.invoices-cards,
.summary-cards {
  display: none !important;
}

/* Table views - shown by default, hidden on mobile */
.clients-table-view,
.invoices-table-wrap-hnry,
#summaryWrap {
  display: block;
}

/* Individual card styling */
.client-card,
.invoice-card,
.summary-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.2s ease;
}

.client-card:active,
.invoice-card:active {
  background: #f8fafc;
  transform: scale(0.98);
}

/* Summary card specific */
.summary-card {
  background: white;
}

.summary-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.summary-card-month {
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
  margin: 0;
}

.summary-card-count {
  font-size: 13px;
  color: #64748b;
}

.summary-year-total {
  background: #f8fafc;
  border: 2px solid var(--hnry-navy);
  margin-top: 16px;
}

.summary-year-total .summary-card-month {
  color: var(--hnry-navy);
}

/* Card header (name/invoice number) */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
  margin: 0;
  flex: 1;
}

.card-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  margin-left: 8px;
}

.card-status.paid {
  background: #d1fae5;
  color: #065f46;
}

.card-status.pending {
  background: #fef3c7;
  color: #92400e;
}

.card-status.overdue {
  background: #fee2e2;
  color: #991b1b;
}

/* Card details (key-value pairs) */
.card-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.card-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.card-detail-label {
  color: #64748b;
  font-weight: 500;
}

.card-detail-value {
  color: #0f172a;
  font-weight: 400;
  text-align: right;
}

.card-detail-value.highlight {
  font-weight: 600;
  color: var(--hnry-navy);
}

/* Card actions */
.card-actions {
  display: flex;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}

.card-actions button {
  flex: 1;
}

/* Mobile: Show cards, hide tables */
@media (max-width: 768px) {
  /* Hide all table wrappers */
  .invoices-table-wrap-hnry,
  .clients-table-view,
  #summaryWrap {
    display: none !important;
  }

  /* Show card containers */
  .clients-cards,
  .invoices-cards,
  .summary-cards {
    display: block !important;
  }

  /* Adjust card spacing for mobile */
  .client-card,
  .invoice-card,
  .summary-card {
    padding: 14px;
    margin-bottom: 10px;
  }

  .card-title {
    font-size: 15px;
  }

  .card-detail-row {
    font-size: 13px;
  }
}

/* ================================================================================
   FREEMIUM & PRICING STYLES
   Add this to your styles-all-in-one.css file
   ================================================================================ */

/* ===== UPGRADE MODAL ===== */
.upgrade-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.upgrade-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.upgrade-modal-content {
  position: relative;
  background: white;
  border-radius: 16px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
              0 10px 10px -5px rgba(0, 0, 0, 0.04);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.upgrade-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border: none;
  background: #f8f9fa;
  border-radius: 8px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
  transition: all 0.2s;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upgrade-modal-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.upgrade-modal-header {
  text-align: center;
  padding: 40px 40px 32px;
  background: #001840;
  border-bottom: 1px solid #e2e8f0;
  border-radius: 16px 16px 0 0;
}

.upgrade-modal-header h2 {
  margin: 0 0 12px;
  font-size: 28px;
  font-weight: 700;
  color: #ffffff;
}

.upgrade-social-proof {
  margin: 8px 0 0;
  font-size: 15px;
  color: #64748b;
  font-weight: 400;
}

.upgrade-modal-body {
  padding: 40px;
}

/* ===== PLAN COMPARISON ===== */

.plan-price sup{
	font-size: 22px;
}
.plan-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

@media (max-width: 640px) {
  .plan-comparison {
    grid-template-columns: 1fr;
  }
}

.plan-column {
  position: relative;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
  background: white;
  transition: all 0.3s;
}

.plan-column:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.plan-pro {
  border-color: #0ea5e9;
  background: #fafbfc;
}

.plan-pro:hover {
  border-color: #0284c7;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.1);
}

.plan-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: #0ea5e9;
  color: white;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 4px rgba(14, 165, 233, 0.2);
}

.plan-header {
  text-align: center;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 2px solid #e5e7eb;
}

.plan-header h3 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 600;
  color: #111827;
}

.plan-price {
  font-size: 40px;
  font-weight: 700;
  color: #111827;
	margin-bottom: 16px;
}

.plan-price span {
  font-size: 16px;
  font-weight: 400;
  color: #6b7280;
}

.plan-subtitle{
	font-size: 14px;
	margin-bottom: 8px;
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
}

.plan-features li {
  padding: 12px 0;
  font-size: 15px;
  color: #374151;
  border-bottom: 1px solid #f3f4f6;
}

.plan-features li svg{
  padding: 0;
	margin: 0;
}

#upgradeModalMessage{
	color: #ffffff !important;
}

.plan-features li:last-child {
  border-bottom: none;
}

.plan-button {
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.plan-button-primary {
  background: var(--apple-green);
  color: white;
}

.plan-button-primary:hover {
  background: var(--apple-green-hover);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.25);
}

.plan-button-secondary {
  background: white;
  color: #64748b;
  border: 2px solid #e2e8f0;
}

.plan-button-secondary:hover {
  background: #f8f9fa;
  border-color: #cbd5e1;
  color: #475569;
}

/* ===== TRUST BADGES ===== */
.upgrade-trust-badges {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
  padding-top: 24px;
  border-top: 1px solid #e2e8f0;
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #64748b;
}

.trust-badge svg {
  color: #0ea5e9;
}

/* ===== USAGE WIDGET ===== */
.freemium-widget {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  margin-bottom: 24px;
}

.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.widget-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}

.plan-badge-small {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.plan-badge-small.plan-free {
  background: #f3f4f6;
  color: #64748b;
}

.plan-badge-small.plan-pro {
  background: #0ea5e9;
  color: white;
}

.usage-stats {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.usage-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.usage-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #6b7280;
  font-weight: 500;
}

.usage-label svg {
  color: #9ca3af;
}

.usage-value {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: 24px;
  font-weight: 700;
  color: #111827;
}

.usage-separator,
.usage-limit {
  font-size: 18px;
  font-weight: 400;
  color: #9ca3af;
}

.usage-bar {
  height: 8px;
  background: #f3f4f6;
  border-radius: 4px;
  overflow: hidden;
}

.usage-bar-fill {
  height: 100%;
  background: #10b981;
  border-radius: 4px;
  transition: width 0.3s ease, background 0.3s ease;
}

.upgrade-cta {
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
  text-align: center;
}

.upgrade-cta p {
  margin: 0 0 12px;
  font-size: 14px;
  color: #6b7280;
}

.btn-upgrade {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-upgrade:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(102, 126, 234, 0.4);
}

.btn-upgrade svg {
  width: 16px;
  height: 16px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .upgrade-modal-content {
    border-radius: 16px 16px 0 0;
    max-height: 95vh;
  }

  .upgrade-modal-header,
  .upgrade-modal-body {
    padding: 24px;
  }

  .upgrade-trust-badges {
    gap: 16px;
  }

  .trust-badge {
    font-size: 12px;
  }
}

/* ============================================
   SECURITY TAB - FORCE WHITE INPUTS
   Nuclear option for password fields
   ============================================ */

/* Security tab inputs - highest specificity */
#profileView input[type="password"],
.settings-tab-content[data-tab-content="security"] input,
.settings-tab-content[data-tab-content="security"] input[type="password"],
#currentPassword,
#newPassword,
#confirmNewPassword {
  background-color: #ffffff !important;
  background: #ffffff !important;
  background-image: none !important;
  color: #1d1d1f !important;
  border: 1px solid #d2d2d7 !important;
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
/* DISABLED FOR PLACEHOLDERS: /* DISABLED FOR PLACEHOLDERS:   -webkit-text-fill-color: #1d1d1f !important; */ */
}

/* Override ANY disabled/readonly styles */
#profileView input[type="password"]:not(:disabled):not([readonly]),
.settings-tab-content[data-tab-content="security"] input:not(:disabled):not([readonly]) {
  background: #ffffff !important;
  background-color: #ffffff !important;
  cursor: text !important;
}

/* Force white on focus */
#profileView input[type="password"]:focus,
.settings-tab-content[data-tab-content="security"] input:focus {
  background: #ffffff !important;
  background-color: #ffffff !important;
  border-color: #0071e3 !important;
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1) !important;
}

/* Force white on ALL other profile inputs too */
#profileView input,
#profileView textarea,
#profileView select,
.settings-tab-content input,
.settings-tab-content textarea,
.settings-tab-content select {
  background: #ffffff !important;
  background-color: #ffffff !important;
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
}

/* Remove any gray/disabled appearance */
.settings-tab-content .auth-card input,
.settings-tab-content .auth-grid input {
  background: #ffffff !important;
  opacity: 1 !important;
}

/* ================================================================================
   SETTINGS PAGE - SOFT MODERN BANNER STYLES
   Add this to your styles-all-in-one.css file
   ================================================================================ */

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

/* ===== Settings Banner Container ===== */
.settings-banner {
  position: relative;
  background: linear-gradient(135deg, #ede9fe 0%, #fce7f3 50%, #fed7aa 100%);
  border-radius: 24px;
  padding: 48px;
  overflow: hidden;
  margin-bottom: 32px;
}

/* Animated Background Orbs */
.settings-banner-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  transition: transform 1s ease-in-out;
  pointer-events: none;
}

.settings-banner-orb-1 {
  top: 0;
  left: 0;
  width: 384px;
  height: 384px;
  background: rgba(167, 139, 250, 0.3);
}

.settings-banner-orb-2 {
  bottom: 0;
  right: 0;
  width: 320px;
  height: 320px;
  background: rgba(251, 146, 60, 0.3);
}

.settings-banner:hover .settings-banner-orb {
  transform: scale(1.25);
}

/* Banner Content */
.settings-banner-content {
  position: relative;
  z-index: 10;
}

/* Banner Header */
.settings-banner-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.settings-banner-left {
  flex: 1;
  min-width: 300px;
}

/* Plan Badge */
.settings-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 999px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  margin-bottom: 20px;
}

.settings-badge-dots {
  display: flex;
  gap: -4px;
  margin-left: -4px;
}

.settings-badge-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  margin-left: -4px;
}

.settings-badge-dot-1 {
  background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
}

.settings-badge-dot-2 {
  background: linear-gradient(135deg, #f472b6 0%, #ec4899 100%);
}

.settings-badge-dot-3 {
  background: linear-gradient(135deg, #fb923c 0%, #f59e0b 100%);
}

.settings-badge-text {
  font-size: 14px;
  font-weight: 600;
  background: linear-gradient(90deg, #7c3aed 0%, #fb923c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Title */
.settings-title-wrap {
  margin-top: 0;
}

.settings-title {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 48px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 12px 0;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.settings-subtitle {
  font-size: 18px;
  color: #475569;
  margin: 0;
  max-width: 600px;
  line-height: 1.6;
}

/* Upgrade Button */
.settings-upgrade-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  background: linear-gradient(90deg, #7c3aed 0%, #fb923c 100%);
  color: white;
  border: none;
  border-radius: 16px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 20px 25px -5px rgba(124, 58, 237, 0.3), 0 10px 10px -5px rgba(124, 58, 237, 0.2);
  transition: all 0.3s ease;
  white-space: nowrap;
}

.settings-upgrade-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 25px 50px -12px rgba(124, 58, 237, 0.4), 0 15px 15px -5px rgba(124, 58, 237, 0.25);
}

.settings-upgrade-arrow {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}

.settings-upgrade-btn:hover .settings-upgrade-arrow {
  transform: translateX(4px);
}

/* Stats Grid */
.settings-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.settings-stat-card {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
}

.settings-stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.settings-stat-icon {
  font-size: 28px;
  margin-bottom: 12px;
}

.settings-stat-value {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.settings-stat-card:nth-child(1) .settings-stat-value {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.settings-stat-card:nth-child(2) .settings-stat-value {
  background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.settings-stat-card:nth-child(3) .settings-stat-value {
  background: linear-gradient(135deg, #fb923c 0%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.settings-stat-card:nth-child(4) .settings-stat-value {
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.settings-stat-label {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}

/* ===== Settings Content ===== */
.settings-content {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.settings-section {
  /* Section container */
}

.settings-section-title {
  font-size: 18px;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0 16px 0;
}

.settings-section-title-danger {
  color: #dc2626;
}

.settings-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}

.settings-card-danger {
  border-color: #fecaca;
  background: #fef2f2;
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  gap: 24px;
  border-bottom: 1px solid #f1f5f9;
  transition: background-color 0.2s ease;
}

.settings-item:last-child {
  border-bottom: none;
}

.settings-item:hover {
  background: #f8fafc;
}

.settings-item-info {
  flex: 1;
}

.settings-item-label {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 4px;
}

.settings-item-value {
  font-size: 14px;
  color: #64748b;
}

.settings-item-btn {
  padding: 8px 16px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.settings-item-btn:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.settings-item-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.settings-item-btn-primary {
  background: linear-gradient(90deg, #7c3aed 0%, #fb923c 100%);
  color: white;
  border: none;
}

.settings-item-btn-primary:hover:not(:disabled) {
  transform: scale(1.02);
  box-shadow: 0 4px 6px -1px rgba(124, 58, 237, 0.3);
}

.settings-item-btn-danger {
  background: white;
  color: #dc2626;
  border-color: #fecaca;
}

.settings-item-btn-danger:hover:not(:disabled) {
  background: #fef2f2;
  border-color: #fca5a5;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
  .settings-banner {
    padding: 32px 24px;
  }

  .settings-banner-header {
    flex-direction: column;
  }

  .settings-banner-left {
    min-width: 100%;
  }

  .settings-title {
    font-size: 36px;
  }

  .settings-subtitle {
    font-size: 16px;
  }

  .settings-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .settings-upgrade-btn {
    width: 100%;
    justify-content: center;
  }

  .settings-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .settings-item-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .settings-stats-grid {
    grid-template-columns: 1fr;
  }

  .settings-title {
    font-size: 28px;
  }
}

/* ================================================================================
   PROFILE PAGE BANNER - SOFT MODERN (NO STATS)
   Add this to your styles-all-in-one.css file
   ================================================================================ */

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

/* ===== Profile Banner Container ===== */
.profile-banner {
  margin-bottom: 32px;
}

/* Animated Background Orbs */
.profile-banner-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  transition: transform 1s ease-in-out;
  pointer-events: none;
}

.profile-banner-orb-1 {
  top: 0;
  left: 0;
  width: 384px;
  height: 384px;
  background: rgba(167, 139, 250, 0.3);
}

.profile-banner-orb-2 {
  bottom: 0;
  right: 0;
  width: 320px;
  height: 320px;
  background: rgba(251, 146, 60, 0.3);
}

.profile-banner:hover .profile-banner-orb {
  transform: scale(1.25);
}

/* Banner Content */
.profile-banner-content {
  position: relative;
  z-index: 10;
}

/* Banner Header */
.profile-banner-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.profile-banner-left {
  flex: 1;
  min-width: 300px;
}

/* Plan Badge */
.profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 999px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  margin-bottom: 20px;
}

.profile-badge-dots {
  display: flex;
  gap: -4px;
  margin-left: -4px;
}

.profile-badge-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  margin-left: -4px;
}

.profile-badge-dot-1 {
  background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
}

.profile-badge-dot-2 {
  background: linear-gradient(135deg, #f472b6 0%, #ec4899 100%);
}

.profile-badge-dot-3 {
  background: linear-gradient(135deg, #fb923c 0%, #f59e0b 100%);
}

.profile-badge-text {
  font-size: 14px;
  font-weight: 600;
  background: linear-gradient(90deg, #7c3aed 0%, #fb923c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Title */
.profile-title-wrap {
  margin-top: 0;
}

.profile-title {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 48px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 12px 0;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.profile-subtitle {
  font-size: 18px;
  color: #475569;
  margin: 0;
  max-width: 600px;
  line-height: 1.6;
}

/* Upgrade Button */
/* ===== Responsive Design ===== */
@media (max-width: 768px) {
  .profile-banner {
    padding: 32px 24px;
  }

  .profile-banner-header {
    flex-direction: column;
  }

  .profile-banner-left {
    min-width: 100%;
  }

  .profile-title {
    font-size: 36px;
  }

  .profile-subtitle {
    font-size: 16px;
  }

  .freemium-upgrade-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .profile-title {
    font-size: 28px;
  }
}
/* ================================================================================

/* ===== MODAL POSITIONING FIX ONLY ===== */
.client-modal.hnry-style[hidden],
.client-modal[hidden] {
  display: none !important;
}

.client-modal.hnry-style {
  /* NO TRANSFORM: Use inset + margin for stable centering */
  position: fixed;
  inset: 0;
  margin: auto;
  height: 620px;
  min-height: 400px;
  z-index: 9999;
}

/* body.modal-open overflow:hidden removed - scroll locking now handled entirely by JS (modalOpenNoJump) */

.client-overlay {
  position: absolute;  /* Absolute within wrapper */
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  background: rgba(0, 0, 0, 0.5);
}

.client-overlay[hidden] {
  display: none !important;
}

/* ============================================================================
   MODAL JUMP FIX - CSS Support
   Add this to your styles-all-in-one.css or include separately
   ============================================================================ */

/* Override conflicting modal-open classes */
/* Conflicting modal-open rules removed - they were causing modal jump by overriding the scrollbar fix */

/* Smooth padding transition when modals open */
body {
  transition: padding-right 0.15s ease-out;
}

/* Sidebar smooth transition */
#sidebar {
  transition: padding-right 0.15s ease-out;
}

/* Header smooth transition (if you have a fixed header) */
header {
  transition: padding-right 0.15s ease-out;
}

/* Modal fade-in animation */
#savedInvoiceModal,
#clientModal,
#emailPreviewModal,
#emailVerificationModal {
  opacity: 0;
  transition: opacity 0.2s ease-out;
}

#savedInvoiceModal[style*="display: flex"],
#clientModal:not([hidden]),
#emailPreviewModal.is-open,
#emailVerificationModal.is-open {
  opacity: 1;
}

/* Prevent flash of unstyled content */
.modal-backdrop {
  background: rgba(0, 0, 0, 0, 0.4);
  transition: background 0.2s ease-out;
}

.modal-backdrop.active {
  background: rgba(0, 0, 0, 0.4);
}

/* Ensure modal content doesn't shift */
.modal-content,
.modal-body {
  position: relative;
  max-width: 100%;
  overflow-x: hidden;
}

/* Smooth modal animations */
@media (prefers-reduced-motion: no-preference) {
  .modal {
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Accessibility - respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
  body,
  #sidebar,
  header,
  .modal,
  .modal-backdrop {
    transition: none !important;
    animation: none !important;
  }
}

/* Print styles - hide modals when printing */
@media print {
  /* Hide OTHER modals, but NOT savedInvoiceModal */
  #clientModal,
  #emailPreviewModal,
  #emailVerificationModal {
    display: none !important;
  }
}

/* ============================================================================
   MODERN FREEMIUM WIDGET - Matching Profile Banner Style
   ============================================================================ */

.freemium-widget-modern {
  margin-bottom: 32px;
}

/* Gradient Banner */
.freemium-banner {
  position: relative;
background: linear-gradient(
  90deg,
  #71ceb4 0%,
  #8fd5b8 15%,
  #a3d9b9 30%,
  #c7e0c1 45%,
  #e1decb 55%,
  #d2d5d4 70%,
  #c3c5dc 100%
);
  border-radius: 24px;
  padding: 40px;
  overflow: hidden;
}

/* Animated Background Orbs */
.freemium-banner-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  transition: transform 1s ease-in-out;
  pointer-events: none;
}

.freemium-banner-orb-1 {
  top: -50px;
  left: -50px;
  width: 300px;
  height: 300px;
}

.freemium-banner-orb-2 {
  bottom: -50px;
  right: -50px;
  width: 250px;
  height: 250px;
}

.freemium-banner:hover .freemium-banner-orb {
  transform: scale(1.25);
}

/* Banner Content */
.freemium-banner-content {
  position: relative;
  z-index: 10;
}

/* Banner Header */
.freemium-banner-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.freemium-banner-left {
  flex: 1;
  min-width: 250px;
}

/* Plan Badge */
.freemium-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 999px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  margin-bottom: 16px;
}

.freemium-badge-dots {
  display: flex;
  gap: -4px;
  margin-left: -4px;
}

.freemium-badge-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  margin-left: -4px;
}

.freemium-badge-dot-1 {
  background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
}

.freemium-badge-dot-2 {
  background: linear-gradient(135deg, #f472b6 0%, #ec4899 100%);
}

.freemium-badge-dot-3 {
  background: linear-gradient(135deg, #fb923c 0%, #f59e0b 100%);
}

.freemium-badge-text {
  font-size: 14px;
  font-weight: 600;
  background: linear-gradient(90deg, #7c3aed 0%, #fb923c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Title */
.freemium-title-wrap {
  margin-top: 0;
}

.freemium-title {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 36px;
  font-weight: 800;
  color: #111827;
  margin: 0 0 8px 0;
  line-height: 1.1;
}

.freemium-subtitle {
  font-size: 16px;
  color: #6b7280;
  margin: 0;
  font-weight: 500;
}

/* Upgrade Button */
.freemium-upgrade-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  background: white;
  color: #7c3aed;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  white-space: nowrap;
}

.freemium-upgrade-btn[style*="display: none"],
.freemium-upgrade-btn.hidden {
  display: none !important;
}

.freemium-upgrade-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.15);
  background: white;
}

.freemium-upgrade-arrow {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
  flex-shrink: 0;
  display: block;
}

.freemium-upgrade-btn:hover .freemium-upgrade-arrow {
  transform: translateX(4px);
}

/* Usage Cards */
.freemium-usage-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

.freemium-usage-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
}

.freemium-usage-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.freemium-usage-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.freemium-usage-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.freemium-usage-icon-purple {
  background: #5063ad;
  color: white;
}

.freemium-usage-icon-orange {
  background: #ff9200;
  color: white;
}

.freemium-usage-label {
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.freemium-usage-value {
  font-size: 32px;
  font-weight: 800;
  color: #111827;
  margin-bottom: 12px;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.freemium-usage-current {
  color: #5063ad;
}

.freemium-usage-separator {
  color: #d1d5db;
  margin: 0 4px;
}

.freemium-usage-limit {
  color: #9ca3af;
}

.freemium-usage-bar-container {
  margin-bottom: 8px;
}

.freemium-usage-bar {
  width: 100%;
  height: 8px;
  background: #f3f4f6;
  border-radius: 999px;
  overflow: hidden;
}

.freemium-usage-bar-purple .freemium-usage-bar-fill {
  background: #5063ad;
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s ease;
}

.freemium-usage-bar-orange .freemium-usage-bar-fill {
  background: #ff9200;
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s ease;
}

.freemium-usage-warning {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #f59e0b;
  margin-top: 8px;
}

.freemium-usage-warning svg {
  flex-shrink: 0;
}

/* Benefits Footer */
.freemium-benefits-footer {
  background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
  border-radius: 20px;
  padding: 24px 32px;
  margin-top: 20px;
  border: 2px solid rgba(124, 58, 237, 0.1);
}

.freemium-benefits-title {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 16px;
}

.freemium-benefits-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.freemium-benefit-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #4b5563;
  font-weight: 500;
}

.freemium-benefit-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .freemium-banner {
    padding: 32px 24px;
  }

  .freemium-banner-header {
    margin-bottom: 24px;
  }

  .freemium-title {
    font-size: 28px;
  }

  .freemium-subtitle {
    font-size: 14px;
  }

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

  .freemium-upgrade-btn {
    width: 100%;
    justify-content: center;
  }

  .freemium-benefits-list {
    grid-template-columns: 1fr;
  }

  .freemium-benefits-footer {
    padding: 20px;
  }
}


/* ============================================================================
   UNIFIED PLACEHOLDER STYLES - Single source of truth
   ========================================================================== */

/* Standard placeholder - Light grey */
input::placeholder,
textarea::placeholder,
select::placeholder {
  color: #c7c7cc !important;
  opacity: 1 !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  font-size: inherit !important;
  font-weight: 400 !important;
}

/* Placeholder disappears on focus */
input:focus::placeholder,
textarea:focus::placeholder,
select:focus::placeholder {
  color: transparent !important;
  opacity: 0 !important;
}

/* WebKit browsers (Chrome, Safari, Edge) - Light grey */
input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder,
select::-webkit-input-placeholder {
  color: #c7c7cc !important;
  -webkit-text-fill-color: #c7c7cc !important;
  opacity: 1 !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  font-size: inherit !important;
  font-weight: 400 !important;
}

/* WebKit placeholder disappears on focus */
input:focus::-webkit-input-placeholder,
textarea:focus::-webkit-input-placeholder,
select:focus::-webkit-input-placeholder {
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  opacity: 0 !important;
}

/* Firefox - Light grey */
input::-moz-placeholder,
textarea::-moz-placeholder,
select::-moz-placeholder {
  color: #c7c7cc !important;
  opacity: 1 !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  font-size: inherit !important;
  font-weight: 400 !important;
}

/* Firefox placeholder disappears on focus */
input:focus::-moz-placeholder,
textarea:focus::-moz-placeholder,
select:focus::-moz-placeholder {
  color: transparent !important;
  opacity: 0 !important;
}

/* IE/Old Edge - Light grey */
input:-ms-input-placeholder,
textarea:-ms-input-placeholder,
select:-ms-input-placeholder {
  color: #c7c7cc !important;
  opacity: 1 !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  font-size: inherit !important;
  font-weight: 400 !important;
}

/* IE/Old Edge placeholder disappears on focus */
input:focus:-ms-input-placeholder,
textarea:focus:-ms-input-placeholder,
select:focus:-ms-input-placeholder {
  color: transparent !important;
  opacity: 0 !important;
}


/* ============================================================================
   INVOICE PAID TOGGLE - Modern soft toggle switch
   ========================================================================== */

.invoice-paid-toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  cursor: pointer;
}

.invoice-paid-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.invoice-paid-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #e5e7eb;
  border-radius: 34px;
  transition: all 0.3s ease;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.invoice-paid-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.invoice-paid-toggle input:checked + .invoice-paid-slider {
  background-color: #10b981;
  box-shadow: inset 0 1px 3px rgba(16, 185, 129, 0.3);
}

.invoice-paid-toggle input:focus + .invoice-paid-slider {
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1), inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.invoice-paid-toggle input:checked + .invoice-paid-slider:before {
  transform: translateX(20px);
}

.invoice-paid-toggle:hover .invoice-paid-slider {
  background-color: #d1d5db;
}

.invoice-paid-toggle:hover input:checked + .invoice-paid-slider {
  background-color: #059669;
}

/* =====================================================
   LINE ITEMS - MOBILE RESPONSIVE CARDS
   ===================================================== */

/* Container for line item cards (hidden on desktop) */
#lineItemsCards {
  display: none;
}

/* Line item card */
.line-item-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.2s ease;
}

.line-item-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.line-item-card-number {
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
}

/* Line item card fields */
.line-item-card-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.line-item-card-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.line-item-card-label {
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.line-item-card-field textarea {
  width: 100%;
  min-height: 60px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  font-family: inherit;
}

.line-item-card-field input,
.line-item-card-field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 14px;
}

.line-item-card-field input:focus,
.line-item-card-field textarea:focus,
.line-item-card-field select:focus {
  outline: none;
  border-color: var(--hnry-navy);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Two column layout for Qty/Rate */
.line-item-card-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Read-only values */
.line-item-card-value {
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 14px;
  color: #0f172a;
  font-weight: 500;
}

.line-item-card-value.highlight {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: var(--hnry-navy);
  font-weight: 600;
}

/* Card actions */
.line-item-card-actions {
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}

.line-item-card-actions button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.line-item-card-actions button svg {
  flex-shrink: 0;
}

/* Mobile: Switch to cards */
@media (max-width: 768px) {
  /* Hide table wrapper (removes border line above cards) */
  .items > div:first-child {
    display: none !important;
  }
  
  /* Hide table */
  #itemsTable {
    display: none !important;
  }
  
  /* Show cards */
  #lineItemsCards {
    display: block !important;
  }
  
  /* Adjust card spacing */
  .line-item-card {
    padding: 14px;
    margin-bottom: 10px;
  }
  
  /* Make remove button full width on mobile */
  .line-item-card-actions .danger {
    padding: 10px 16px;
  }
  
  /* Remove left padding on mobile */
  .appShell-left {
    padding: 0 !important;
  }
}

/* ============================================================
   INVOICE PREVIEW — MOBILE LINE ITEMS (stacked cards)
   Applies to both the slide-in preview panel and the full
   Invoice Preview page. Does NOT affect print / PDF output.
   ============================================================ */

@media screen and (max-width: 680px) {

  /* ── Table → card layout ── */
  .inv-table table thead {
    display: none !important;
  }

  .inv-table table,
  .inv-table table tbody,
  .inv-table table tr {
    display: block !important;
  }

  .inv-table table tr {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  }

  /* All cells block by default */
  .inv-table table td {
    display: block !important;
    padding: 0 !important;
    border: none !important;
    text-align: left !important;
  }

  /* 1: Description — prominent */
  .inv-table table td:nth-child(1) {
    font-weight: 600;
    font-size: 15px;
    color: #111827;
    margin-bottom: 8px;
    padding-bottom: 8px !important;
    border-bottom: 1px solid #f3f4f6 !important;
  }

  /* 2, 3, 4 (Qty, Rate, Amount) — inline flex row with labels */
  .inv-table table td:nth-child(2),
  .inv-table table td:nth-child(3),
  .inv-table table td:nth-child(4) {
    display: inline-block !important;
    margin-right: 16px;
    margin-top: 6px;
    font-size: 13px;
    color: #374151;
  }

  .inv-table table td:nth-child(2)::before { content: "Qty: "; color: #9ca3af; font-size: 11px; display: block; }
  .inv-table table td:nth-child(3)::before { content: "Rate: "; color: #9ca3af; font-size: 11px; display: block; }
  .inv-table table td:nth-child(4)::before { content: "Amount: "; color: #9ca3af; font-size: 11px; display: block; }

  /* 5: VAT — pill badge */
  .inv-table table td:nth-child(5) {
    display: inline-block !important;
    background: #f0fdf4;
    border: 1px solid #bbf7d0 !important;
    border-radius: 5px;
    padding: 2px 8px !important;
    font-size: 12px !important;
    color: #166534;
    margin-top: 8px;
    margin-right: 8px;
    font-weight: 500;
  }
  .inv-table table td:nth-child(5)::before {
    content: "VAT ";
  }

  /* 6: Total (inc VAT) — strong, right-aligned */
  .inv-table table td:nth-child(6) {
    display: block !important;
    font-weight: 700;
    font-size: 15px;
    color: #111827;
    margin-top: 8px;
    text-align: right !important;
    border-top: 1px dashed #e5e7eb !important;
    padding-top: 8px !important;
  }
  .inv-table table td:nth-child(6)::before {
    content: "Total ";
    font-weight: 400;
    font-size: 12px;
    color: #9ca3af;
    float: left;
    margin-top: 2px;
  }

  /* ── Totals card — full width ── */
  .totals {
    justify-content: stretch !important;
  }
  .totals .card {
    min-width: 0 !important;
    width: 100% !important;
    box-sizing: border-box;
  }

  /* Bigger tap targets for totals rows */
  .totals .line {
    font-size: 14px !important;
    padding: 9px 0 !important;
  }
  .totals .grand {
    font-size: 16px !important;
    padding-top: 12px !important;
    margin-top: 8px !important;
  }
}

/* ── Safari iOS: Client modal safe height ── */
@media screen and (max-width: 768px) {
  .client-modal-wrapper {
    align-items: flex-end; /* Slide up from bottom on mobile */
    padding: 0;
  }

  .clientModal {
    width: 100%;
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    /* Fixed height on mobile so content always fills the sheet */
    height: 75vh;
    height: 75dvh;
    min-height: 400px;
    max-height: 90vh;
    max-height: 90dvh;
  }

  .client-picker-view,
  .client-create-view {
    padding: 16px 20px;
    /* Extra bottom padding for Safari home indicator */
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }
}


/* ============================================================================
   APP LOADING SCREEN
   ============================================================================ */

#appLoader {
  position: fixed;
  inset: 0;
  background: #001840;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  z-index: 99999;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

#appLoader.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.app-loader-ring-wrap {
  position: relative;
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-loader-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 160px;
  height: 160px;
  animation: loader-spin 1.6s linear infinite;
}

.app-loader-logo {
  width: 110px;
  height: 110px;
  animation: loader-pulse 1.6s ease-in-out infinite;
}

.app-loader-logo svg {
  width: 100%;
  height: 100%;
}

.app-loader-dots {
  display: flex;
  gap: 10px;
  align-items: center;
}

.app-loader-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0bac80;
  display: inline-block;
  animation: loader-bounce 1.2s ease-in-out infinite;
}

.app-loader-dot:nth-child(2) {
  animation-delay: 0.2s;
  background: #5063ad;
}

.app-loader-dot:nth-child(3) {
  animation-delay: 0.4s;
  background: #f5cf39;
}

.app-loader-text {
  color: rgba(255, 255, 255, 0.45);
  font-size: 13px;
  letter-spacing: 0.08em;
  animation: loader-fade 1.6s ease-in-out infinite;
  margin: 0;
}

@keyframes loader-spin {
  to { transform: rotate(360deg); }
}

@keyframes loader-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.94); opacity: 0.85; }
}

@keyframes loader-bounce {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(-8px); opacity: 1; }
}

@keyframes loader-fade {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.9; }
}

@media print {
  #appLoader { display: none !important; }
}

/* ============================================================================
   PAGE LOADING SPINNER (Saved Invoices, Summary, Clients)
   ============================================================================ */

.page-loading-cell {
  text-align: center;
  padding: 60px 20px !important;
}

.page-loading-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 60px 20px;
  color: #94a3b8;
  font-size: 14px;
}

.page-loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e2e8f0;
  border-top-color: #0bac80;
  border-radius: 50%;
  animation: page-spin 0.7s linear infinite;
}

@keyframes page-spin {
  to { transform: rotate(360deg); }
}

/* ============================================================================
   MOBILE NAV LOADING OVERLAY
   Full-screen branded overlay during mobile page transitions
   ============================================================================ */

#mobileNavLoader {
  position: fixed;
  inset: 0;
  background: #001840;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  z-index: 99998;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: all;
}

#mobileNavLoader.mnl-show {
  opacity: 1;
}

#mobileNavLoader.mnl-hide {
  opacity: 0;
}

.mnl-ring-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mnl-ring {
  position: absolute;
  top: 0; left: 0;
  width: 140px;
  height: 140px;
  animation: loader-spin 1.6s linear infinite;
}

.mnl-logo {
  width: 96px;
  height: 96px;
  animation: loader-pulse 1.6s ease-in-out infinite;
}

.mnl-logo svg {
  width: 100%;
  height: 100%;
}

.mnl-dots {
  display: flex;
  gap: 10px;
  align-items: center;
}

.mnl-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0bac80;
  display: inline-block;
  animation: loader-bounce 1.2s ease-in-out infinite;
}

.mnl-dot:nth-child(2) {
  animation-delay: 0.2s;
  background: #5063ad;
}

.mnl-dot:nth-child(3) {
  animation-delay: 0.4s;
  background: #f5cf39;
}

/* Only relevant on mobile — hide on desktop just in case */
@media (min-width: 1024px) {
  #mobileNavLoader { display: none !important; }
}

@media print {
  #mobileNavLoader { display: none !important; }
}

/* ============================================================================
   iOS DATE INPUT FIX
   Force date inputs to stay within their container on Safari/iOS
   ============================================================================ */

@media (max-width: 600px) {
  input[type="date"] {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    display: block !important;
    text-align: left !important;
  }

  .grid3 > div {
    overflow: hidden;
    min-width: 0;
  }
}
