/* ==========================================================================
   Sri Murugan Industries (SMI) - Enterprise Admin & Quotation Suite CSS
   Theme: Industrial Navy (#0B2545), Safety Accent (#0056B3, #0EA5E9), & Clean Slate
   ========================================================================== */

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

:root {
  --admin-navy: #0B2545;
  --admin-dark: #07172C;
  --admin-blue: #0056B3;
  --admin-light-blue: #EBF3FC;
  --admin-accent: #0EA5E9;
  
  --admin-bg: #F8FAFC;
  --admin-card-bg: #FFFFFF;
  --admin-border: #E2E8F0;
  --admin-border-dark: #CBD5E1;
  
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  
  --badge-green-bg: #DCFCE7;
  --badge-green-text: #15803D;
  --badge-blue-bg: #E0F2FE;
  --badge-blue-text: #0284C7;
  --badge-yellow-bg: #FEF3C7;
  --badge-yellow-text: #B45309;
  --badge-red-bg: #FEE2E2;
  --badge-red-text: #B91C1C;
  --badge-purple-bg: #F3E8FF;
  --badge-purple-text: #7E22CE;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(11, 37, 69, 0.08);
  --shadow-lg: 0 10px 25px rgba(11, 37, 69, 0.12);
  --shadow-xl: 0 20px 35px rgba(11, 37, 69, 0.16);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  --font-heading: 'Plus Jakarta Sans', sans-serif;
  --font-body: 'Inter', sans-serif;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--admin-bg);
  color: var(--text-primary);
  line-height: 1.5;
  display: flex;
  min-height: 100vh;
}

/* ==========================================================================
   Admin Sidebar Navigation
   ========================================================================== */
.admin-sidebar {
  width: 270px;
  background: var(--admin-dark);
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-header {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--admin-blue) 0%, #0070E0 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.2rem;
  color: #FFFFFF;
  box-shadow: 0 4px 10px rgba(0, 86, 179, 0.4);
}

.sidebar-brand-text h2 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.2;
}

.sidebar-brand-text span {
  font-size: 0.72rem;
  color: var(--admin-accent);
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.sidebar-nav {
  padding: 24px 14px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-section-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  font-weight: 700;
  padding: 10px 12px 4px 12px;
}

.sidebar-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: #CBD5E1;
  background: none;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: all 0.2s ease;
}

.sidebar-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #FFFFFF;
}

.sidebar-btn.active {
  background: linear-gradient(135deg, var(--admin-blue) 0%, #083468 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(0, 86, 179, 0.35);
}

.sidebar-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex-shrink: 0;
}

.sidebar-badge {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
}

.sidebar-footer {
  padding: 18px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-view-site {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #E2E8F0;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-view-site:hover {
  background: var(--admin-blue);
  color: #FFFFFF;
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */
.admin-main {
  margin-left: 270px;
  flex-grow: 1;
  padding: 30px 36px;
  background: var(--admin-bg);
  min-height: 100vh;
}

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

.header-title-box h1 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--admin-navy);
  line-height: 1.2;
}

.header-title-box p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 4px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ==========================================================================
   KPI Summary Metric Cards
   ========================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.kpi-card {
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 18px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--admin-accent);
}

.kpi-icon-box {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon-box svg {
  width: 26px;
  height: 26px;
}

.kpi-data-box {
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
  font-weight: 700;
}

.kpi-value {
  font-family: var(--font-heading);
  font-size: 1.7rem;
  font-weight: 900;
  color: var(--admin-navy);
  line-height: 1.1;
  margin: 2px 0;
}

.kpi-subtext {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Colors for KPI */
.kpi-blue { background: #E0F2FE; color: #0284C7; }
.kpi-orange { background: #FFEDD5; color: #EA580C; }
.kpi-green { background: #DCFCE7; color: #16A34A; }
.kpi-purple { background: #F3E8FF; color: #9333EA; }

/* ==========================================================================
   Tabs Management (Overview / Leads / Generator / Store)
   ========================================================================== */
.admin-tab-content {
  display: none;
}

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

/* Standard Panel / Card */
.admin-panel {
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 30px;
}

.panel-header {
  padding: 20px 26px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  background: #FFFFFF;
}

.panel-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--admin-navy);
}

.panel-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-input {
  padding: 8px 14px;
  border: 1.5px solid var(--admin-border);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  color: var(--text-primary);
  background: #F8FAFC;
  min-width: 240px;
}

.search-input:focus {
  outline: none;
  border-color: var(--admin-blue);
  background: #FFFFFF;
}

.filter-select {
  padding: 8px 14px;
  border: 1.5px solid var(--admin-border);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  color: var(--text-primary);
  background: #F8FAFC;
}

.filter-select:focus {
  outline: none;
  border-color: var(--admin-blue);
}

/* ==========================================================================
   Tables (Leads & Quotations)
   ========================================================================== */
.data-table-wrapper {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.data-table th {
  background: #F8FAFC;
  color: var(--text-secondary);
  font-weight: 700;
  padding: 12px 18px;
  border-bottom: 1px solid var(--admin-border);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--admin-border);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tr:hover {
  background: #F1F5F9;
}

.table-client-name {
  font-weight: 700;
  color: var(--admin-navy);
}

.table-client-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-sale { background: var(--badge-blue-bg); color: var(--badge-blue-text); }
.badge-rent { background: var(--badge-purple-bg); color: var(--badge-purple-text); }
.badge-new { background: var(--badge-yellow-bg); color: var(--badge-yellow-text); }
.badge-quoted { background: #DBEAFE; color: #1D4ED8; }
.badge-won { background: var(--badge-green-bg); color: var(--badge-green-text); }
.badge-lost { background: var(--badge-red-bg); color: var(--badge-red-text); }

.table-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-table-action {
  background: #FFFFFF;
  border: 1px solid var(--admin-border);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-table-action:hover {
  border-color: var(--admin-blue);
  color: var(--admin-blue);
  background: #F8FAFC;
}

.btn-table-action.primary {
  background: var(--admin-blue);
  color: #FFFFFF;
  border-color: var(--admin-blue);
}

.btn-table-action.primary:hover {
  background: #004694;
}

.btn-table-action.danger {
  color: #EF4444;
}

.btn-table-action.danger:hover {
  background: #FEF2F2;
  border-color: #F87171;
}

/* ==========================================================================
   Quotation Generator Interface
   ========================================================================== */
.generator-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 30px;
  align-items: start;
}

.quote-form-card {
  background: #FFFFFF;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-sm);
}

.quote-mode-toggle {
  display: flex;
  background: #F1F5F9;
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.quote-mode-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: none;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.quote-mode-btn.active {
  background: #FFFFFF;
  color: var(--admin-navy);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.form-section-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--admin-navy);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.form-field {
  display: flex;
  flex-direction: column;
}

.field-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.field-input, .field-select, .field-textarea {
  padding: 10px 12px;
  border: 1.5px solid var(--admin-border);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  color: var(--text-primary);
  background: #F8FAFC;
  transition: border-color 0.2s;
}

.field-input:focus, .field-select:focus, .field-textarea:focus {
  outline: none;
  border-color: var(--admin-blue);
  background: #FFFFFF;
}

/* Line Items Table in Form */
.line-items-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 0.85rem;
}

.line-items-table th {
  background: #F1F5F9;
  padding: 8px 10px;
  text-align: left;
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--admin-border);
}

.line-items-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--admin-border);
}

.btn-add-item {
  background: #EBF3FC;
  color: var(--admin-blue);
  border: 1px dashed var(--admin-blue);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 24px;
}

.btn-add-item:hover {
  background: #DBEAFE;
}

/* Rental Specific Box */
.rental-terms-box {
  background: #FAF5FF;
  border: 1px solid #E9D5FF;
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 20px;
}

/* ==========================================================================
   Quotation Live A4 Preview & Letterhead
   ========================================================================== */
.quote-preview-sticky {
  position: sticky;
  top: 30px;
}

.quote-document-sheet {
  background: #FFFFFF;
  border: 1px solid var(--admin-border);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-md);
  padding: 36px 40px;
  font-size: 0.84rem;
  color: #1E293B;
  position: relative;
}

/* Letterhead Top */
.letterhead-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid var(--admin-navy);
  padding-bottom: 18px;
  margin-bottom: 18px;
}

.letterhead-brand {
  display: flex;
  gap: 12px;
}

.letterhead-logo {
  width: 44px;
  height: 44px;
  background: var(--admin-navy);
  color: #FFFFFF;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.2rem;
}

.letterhead-titles h2 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--admin-navy);
  line-height: 1.1;
}

.letterhead-titles p {
  font-size: 0.72rem;
  color: var(--admin-blue);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.letterhead-titles .org-specs {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.3;
}

.letterhead-badge-col {
  text-align: right;
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.quote-type-watermark {
  background: var(--admin-light-blue);
  color: var(--admin-blue);
  border: 1px solid #BFDBFE;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  display: inline-block;
  margin-bottom: 6px;
}

/* Quote Meta Row */
.doc-meta-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
  font-size: 0.82rem;
}

.doc-client-card, .doc-info-card {
  background: #F8FAFC;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.doc-card-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  font-weight: 800;
  margin-bottom: 6px;
  border-bottom: 1px dashed var(--admin-border);
  padding-bottom: 4px;
}

/* Items Preview Table */
.doc-items-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 18px;
  font-size: 0.82rem;
}

.doc-items-table th {
  background: var(--admin-navy);
  color: #FFFFFF;
  padding: 8px 10px;
  font-weight: 700;
  text-align: left;
}

.doc-items-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--admin-border);
}

/* Totals Box */
.doc-totals-box {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 18px;
}

.doc-totals-list {
  width: 260px;
  font-size: 0.82rem;
}

.doc-total-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px dashed var(--admin-border);
}

.doc-total-row.grand-total {
  border-top: 2px solid var(--admin-navy);
  border-bottom: 2px solid var(--admin-navy);
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--admin-navy);
  padding: 8px 0;
  margin-top: 4px;
}

/* Terms & Signatures */
.doc-terms {
  font-size: 0.72rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--admin-border);
  padding-top: 12px;
  margin-bottom: 18px;
}

.doc-terms ol {
  padding-left: 14px;
  margin-top: 4px;
  line-height: 1.4;
}

.doc-footer-sign {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-top: 1px dashed var(--admin-border);
  padding-top: 14px;
  font-size: 0.75rem;
}

.bank-details {
  line-height: 1.35;
  color: var(--text-secondary);
}

.signature-box {
  text-align: center;
  font-weight: 700;
  color: var(--admin-navy);
}

.signature-line {
  margin-top: 40px;
  border-top: 1px solid var(--admin-navy);
  padding-top: 4px;
}

/* Floating Action Toolbar on Preview */
.preview-toolbar {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.btn-doc {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-doc.primary {
  background: var(--admin-blue);
  color: #FFFFFF;
}

.btn-doc.primary:hover {
  background: #004694;
}

.btn-doc.whatsapp {
  background: #25D366;
  color: #FFFFFF;
}

.btn-doc.whatsapp:hover {
  background: #1EBE5D;
}

.btn-doc.secondary {
  background: #FFFFFF;
  border: 1.5px solid var(--admin-border);
  color: var(--admin-navy);
}

.btn-doc.secondary:hover {
  background: #F1F5F9;
}

/* ==========================================================================
   Modals
   ========================================================================== */
.admin-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(7, 23, 44, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
  padding: 20px;
}

.admin-modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.admin-modal-box {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.admin-modal-header {
  padding: 18px 24px;
  background: #F8FAFC;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-modal-header h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--admin-navy);
}

.admin-modal-body {
  padding: 24px;
}

/* Toast */
.admin-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--admin-navy);
  color: #FFFFFF;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  border-left: 4px solid #10B981;
  font-size: 0.88rem;
  font-weight: 600;
  z-index: 2000;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Exact Official Quotation Styles (Sale & Rental - Matching User Images)
   ========================================================================== */

/* Outer Sheet Reset */
.quote-document-sheet {
  background: #FFFFFF;
  border: 1px solid var(--admin-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  padding: 0;
  font-family: Arial, Helvetica, 'Plus Jakarta Sans', sans-serif;
  color: #111827;
  position: relative;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   SALE QUOTATION (Image 1 Exact Layout)
   -------------------------------------------------------------------------- */
.smi-sale-container {
  padding: 24px 28px 28px 28px;
  background: #FFFFFF;
  position: relative;
  font-size: 8.5pt;
  color: #222222;
  line-height: 1.35;
  box-sizing: border-box;
}

/* Top Accent Curved Bar */
.smi-sale-top-bar {
  position: absolute;
  top: 0;
  right: 0;
  width: 280px;
  height: 14px;
  background: #DC2626;
  border-bottom-left-radius: 12px;
}

/* Header 3-Column */
.smi-sale-header {
  display: grid;
  grid-template-columns: 1.3fr 1.3fr 1.3fr;
  gap: 14px;
  align-items: flex-start;
  margin-top: 10px;
  margin-bottom: 8px;
}

.smi-brand-block {
  display: flex;
  flex-direction: column;
}

.smi-brand-logo-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.smi-brand-name {
  font-size: 13pt;
  font-weight: 900;
  color: #0B2545;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: -0.3px;
}

.smi-brand-cert {
  font-size: 7pt;
  font-weight: 700;
  color: #D32F2F;
  margin-top: 2px;
}

.smi-brand-web {
  font-size: 7pt;
  color: #D32F2F;
  font-weight: 600;
}

.smi-header-address-box {
  font-size: 7.2pt;
  color: #333;
  line-height: 1.35;
}

.smi-header-address-box strong {
  font-size: 8pt;
  color: #000;
  display: block;
  margin-bottom: 2px;
}

/* Centered Red GST Row */
.smi-sale-gst-line {
  text-align: center;
  color: #D32F2F;
  font-weight: 800;
  font-size: 8.5pt;
  margin: 6px 0 12px 0;
  letter-spacing: 0.5px;
}

/* Quotation Title Right */
.smi-sale-quotation-title {
  text-align: right;
  font-size: 20pt;
  font-weight: 500;
  color: #2D3748;
  margin-bottom: 14px;
  font-family: 'Plus Jakarta Sans', Arial, sans-serif;
}

/* 3-Column Metadata Row */
.smi-sale-meta-grid {
  display: grid;
  grid-template-columns: 1.25fr 1.25fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
  font-size: 7.8pt;
}

.smi-sale-meta-col {
  line-height: 1.35;
}

.smi-meta-tag {
  font-size: 7.5pt;
  color: #555;
  font-weight: 600;
  margin-bottom: 2px;
}

.smi-meta-title {
  font-size: 9pt;
  font-weight: 800;
  color: #000;
  margin-bottom: 3px;
}

.smi-meta-right-table {
  width: 100%;
  border-collapse: collapse;
}

.smi-meta-right-table td {
  padding: 2px 0;
  font-size: 7.8pt;
}

.smi-meta-right-table td:last-child {
  text-align: right;
  font-weight: 700;
  color: #1E293B;
}

/* Main Table (Sale) */
.smi-table-sale {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 14px;
  border: 1px solid #222;
  font-size: 7.8pt;
}

.smi-table-sale th {
  background: #FBE4D5 !important;
  border: 1px solid #222;
  padding: 6px 8px;
  font-weight: 700;
  color: #000;
  text-align: center;
}

.smi-table-sale td {
  border: 1px solid #222;
  padding: 8px;
  vertical-align: top;
}

.smi-item-layout {
  display: flex;
  gap: 10px;
}

.smi-item-img {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border: 1px solid #CCC;
  border-radius: 3px;
  flex-shrink: 0;
}

.smi-item-text {
  flex: 1;
}

.smi-item-title {
  font-weight: 800;
  color: #000;
  font-size: 8pt;
  margin-bottom: 4px;
  line-height: 1.3;
}

.smi-item-specs {
  font-size: 7pt;
  color: #444;
  line-height: 1.35;
  white-space: pre-line;
}

.smi-item-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

.smi-metric-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 700;
  font-size: 7pt;
  line-height: 1.3;
}

.smi-metric-chip.capacity {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}

.smi-metric-chip.weight {
  background: #F1F5F9;
  color: #334155;
  border: 1px solid #CBD5E1;
}

/* Lower Split: Terms & Amount Box */
.smi-sale-lower-split {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 16px;
  margin-bottom: 14px;
}

.smi-sale-terms-title {
  font-weight: 800;
  font-size: 8pt;
  color: #000;
  margin-bottom: 4px;
}

.smi-sale-terms-ol {
  padding-left: 14px;
  font-size: 6.8pt;
  line-height: 1.45;
  color: #333;
  margin: 0;
}

/* Amount Box Table */
.smi-sale-amt-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #222;
  font-size: 7.8pt;
  margin-bottom: 6px;
}

.smi-sale-amt-table td {
  border: 1px solid #222;
  padding: 4px 8px;
}

.smi-sale-amt-table td:last-child {
  text-align: right;
  font-weight: 600;
}

.smi-sale-total-row {
  background: #F38B21 !important;
  font-weight: 800;
  color: #000 !important;
}

.smi-sale-words-box {
  font-size: 7.2pt;
  line-height: 1.35;
  color: #222;
  margin-top: 4px;
}

/* Tax Breakdown Table */
.smi-tax-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #222;
  font-size: 7.5pt;
  margin-bottom: 12px;
}

.smi-tax-table th {
  background: #FBE4D5 !important;
  border: 1px solid #222;
  padding: 4px 6px;
  text-align: center;
  font-weight: 700;
}

.smi-tax-table td {
  border: 1px solid #222;
  padding: 4px 6px;
  text-align: center;
}

.smi-tax-table td.tax-amount-col {
  text-align: right;
}

.smi-tax-words-td {
  text-align: left !important;
  font-weight: 700;
  padding: 5px 8px !important;
  background: #FFF;
  font-size: 7pt;
}

/* Additional Info (Bank) */
.smi-bank-card {
  margin-bottom: 10px;
}

.smi-bank-title {
  font-weight: 800;
  font-size: 7.8pt;
  color: #000;
  margin-bottom: 4px;
}

.smi-bank-table {
  font-size: 7.2pt;
  line-height: 1.4;
}

.smi-bank-table td {
  padding: 1px 0;
}

.smi-bank-table td:first-child {
  font-weight: 700;
  width: 105px;
  color: #333;
}

/* Bottom Enquiry Box */
.smi-sale-contact-box {
  border: 1px solid #444;
  border-radius: 3px;
  padding: 6px 10px;
  text-align: center;
  font-size: 7.2pt;
  color: #111;
  margin-bottom: 10px;
}

.smi-sale-footnote {
  text-align: center;
  font-size: 6.5pt;
  color: #666;
}

/* --------------------------------------------------------------------------
   RENTAL QUOTATION (Image 2 & 3 Exact Layout)
   -------------------------------------------------------------------------- */
.smi-rent-page {
  padding: 24px 28px;
  background: #FFFFFF;
  position: relative;
  font-size: 8pt;
  color: #111;
  line-height: 1.35;
  box-sizing: border-box;
}

/* Header Top */
.smi-rent-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.smi-rent-center-brand {
  text-align: center;
  flex: 1;
  padding: 0 10px;
}

.smi-rent-center-brand h2 {
  font-size: 13pt;
  font-weight: 900;
  color: #000;
  letter-spacing: -0.2px;
  margin: 0;
}

.smi-rent-center-brand .smi-slogan {
  font-size: 7.5pt;
  font-weight: 700;
  color: #000;
  margin-top: 2px;
}

.smi-rent-center-brand .smi-iso-title {
  font-size: 7pt;
  color: #222;
  margin-top: 1px;
}

.smi-rent-center-brand .smi-tin-details {
  font-size: 6.5pt;
  color: #333;
  margin-top: 2px;
  line-height: 1.3;
}

.smi-rent-badges-box {
  display: flex;
  gap: 6px;
  align-items: center;
}

.smi-rent-hr {
  height: 1px;
  background: #000;
  margin: 8px 0 12px 0;
}

.smi-rent-doc-heading {
  text-align: center;
  font-size: 11pt;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.smi-rent-client-quote-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  font-size: 8pt;
}

.smi-rent-client-left {
  line-height: 1.35;
}

.smi-rent-client-left strong {
  font-size: 8.5pt;
}

.smi-rent-quote-right {
  text-align: left;
  line-height: 1.45;
}

.smi-rent-sub-line {
  font-size: 8pt;
  font-weight: 700;
  margin-bottom: 10px;
}

/* Rental Table */
.smi-table-rent {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #000;
  font-size: 7.2pt;
  margin-bottom: 0;
}

.smi-table-rent th {
  border: 1px solid #000;
  padding: 5px 4px;
  font-weight: 700;
  text-align: center;
  background: #FFF;
}

.smi-table-rent td {
  border-left: 1px solid #000;
  border-right: 1px solid #000;
  padding: 6px 4px;
  vertical-align: top;
}

.smi-table-rent tr.smi-row-spacer td {
  height: 110px;
  border-bottom: 1px solid #000;
}

/* Rental Totals Grid */
.smi-rent-calc-container {
  display: flex;
  border: 1px solid #000;
  border-top: none;
  margin-bottom: 12px;
}

.smi-rent-words-side {
  width: 58%;
  padding: 8px 10px;
  border-right: 1px solid #000;
  font-size: 7.5pt;
  line-height: 1.4;
}

.smi-rent-totals-side {
  width: 42%;
}

.smi-rent-totals-side table {
  width: 100%;
  border-collapse: collapse;
  font-size: 7.2pt;
}

.smi-rent-totals-side td {
  padding: 3px 6px;
}

.smi-rent-totals-side td:last-child {
  text-align: right;
  font-weight: 700;
}

.smi-rent-totals-side tr.smi-grand-rent-total {
  border-top: 1px solid #000;
  font-weight: 800;
}

/* Page 1 Terms */
.smi-rent-terms-p1 {
  font-size: 7.2pt;
  line-height: 1.4;
  margin-bottom: 24px;
}

.smi-rent-terms-p1 ol {
  padding-left: 16px;
  margin: 0;
}

/* Red Curved Wave Footer Banner */
.smi-rent-footer-wave {
  margin-top: 20px;
  background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
  border-top-left-radius: 40px;
  border-top-right-radius: 0;
  color: #FFFFFF;
  padding: 10px 18px 8px 18px;
  font-size: 6.8pt;
  line-height: 1.35;
}

.smi-rent-footer-wave strong {
  font-size: 7.5pt;
  color: #FFF;
}

/* Page 2 Specifics */
.smi-rent-p2-terms {
  font-size: 7.2pt;
  line-height: 1.38;
}

.smi-rent-p2-terms p {
  margin-bottom: 6px;
}

.smi-rent-p2-bank {
  margin-top: 10px;
  margin-bottom: 12px;
  font-size: 7.2pt;
  line-height: 1.38;
}

.smi-rent-closing-box {
  margin-top: 14px;
  font-size: 7.5pt;
  line-height: 1.4;
}

.smi-page-break-divider {
  page-break-after: always;
  break-after: page;
  height: 24px;
  background: #E2E8F0;
  border-top: 1px dashed #CBD5E1;
  border-bottom: 1px dashed #CBD5E1;
  margin: 20px -28px;
  text-align: center;
  font-size: 7.5pt;
  color: #64748B;
  line-height: 24px;
}

/* ==========================================================================
   Print Optimization (@media print for A4 PDF download)
   ========================================================================== */
@media print {
  body {
    background: #FFFFFF !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .admin-sidebar, 
  .admin-header, 
  .kpi-grid, 
  .quote-form-card, 
  .preview-toolbar, 
  .admin-panel,
  .admin-toast,
  .smi-page-break-divider {
    display: none !important;
  }
  .admin-main {
    margin: 0 !important;
    padding: 0 !important;
    background: #FFFFFF !important;
  }
  .generator-layout {
    display: block !important;
  }
  .quote-preview-sticky {
    position: static !important;
  }
  .quote-document-sheet {
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  .smi-sale-container {
    padding: 10mm 15mm !important;
    page-break-inside: avoid;
  }
  .smi-rent-page {
    padding: 10mm 15mm !important;
    page-break-after: always;
    break-after: page;
    min-height: auto !important;
  }
  .smi-rent-page:last-child {
    page-break-after: avoid;
    break-after: avoid;
  }
  @page {
    size: A4 portrait;
    margin: 0;
  }
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}

/* Mobile & Tablet Responsiveness */
@media (max-width: 1100px) {
  .generator-layout {
    grid-template-columns: 1fr;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .admin-sidebar {
    width: 70px;
  }
  .sidebar-brand-text, .nav-section-label, .sidebar-btn span, .sidebar-badge, .btn-view-site span {
    display: none;
  }
  .sidebar-btn {
    justify-content: center;
    padding: 12px;
  }
  .admin-main {
    margin-left: 70px;
    padding: 20px;
  }
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .form-row, .form-row-3 {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Admin Authentication & Login Overlay
   ========================================================================== */
#adminLoginOverlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: linear-gradient(135deg, #06182C 0%, #0B2545 50%, #003B73 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(8px);
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#adminLoginOverlay.authenticated {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.admin-login-card {
  background: #FFFFFF;
  border-radius: 16px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
  width: 100%;
  max-width: 460px;
  overflow: hidden;
  animation: adminSlideDown 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.admin-login-header {
  background: linear-gradient(135deg, #0B2545 0%, #0056B3 100%);
  padding: 32px 28px 24px;
  text-align: center;
  color: #FFFFFF;
  position: relative;
}

.admin-login-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: #FFFFFF;
  font-size: 1.4rem;
  font-weight: 900;
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4);
  margin-bottom: 12px;
}

.admin-login-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  color: #FFFFFF;
  margin-bottom: 4px;
}

.admin-login-subtitle {
  font-size: 0.85rem;
  color: #93C5FD;
}

.admin-login-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34D399;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  margin-top: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-login-body {
  padding: 28px;
}

.admin-login-alert {
  display: none;
  background: #FEF2F2;
  border: 1px solid #FCA5A5;
  color: #B91C1C;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  margin-bottom: 18px;
  line-height: 1.4;
}

.admin-login-alert.show {
  display: block;
}

.admin-login-form .form-group {
  margin-bottom: 18px;
}

.admin-login-form label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.admin-login-input-wrap {
  position: relative;
}

.admin-login-input-wrap input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #CBD5E1;
  border-radius: 8px;
  font-size: 0.92rem;
  color: #0F172A;
  background: #F8FAFC;
  transition: all 0.2s ease;
  font-family: inherit;
}

.admin-login-input-wrap input:focus {
  outline: none;
  border-color: #0284C7;
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.btn-toggle-login-pass {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #64748B;
  font-size: 0.78rem;
  cursor: pointer;
  padding: 4px 6px;
  font-weight: 600;
}

.btn-toggle-login-pass:hover {
  color: #0284C7;
}

.admin-login-btn {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #0056B3 0%, #0B2545 100%);
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 86, 179, 0.25);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.admin-login-btn:hover {
  background: linear-gradient(135deg, #0284C7 0%, #0056B3 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.35);
}

.login-credentials-helper {
  margin-top: 20px;
  background: #F0F9FF;
  border: 1px solid #BAE6FD;
  border-radius: 10px;
  padding: 14px;
}

.login-credentials-helper .cred-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 700;
  color: #0369A1;
  margin-bottom: 8px;
}

.login-credentials-helper .cred-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: #334155;
  padding: 3px 0;
}

.login-credentials-helper .cred-code {
  font-family: monospace;
  background: #E0F2FE;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  color: #0284C7;
}

.btn-autofill-creds {
  margin-top: 10px;
  width: 100%;
  padding: 7px;
  background: #E0F2FE;
  border: 1px dashed #0284C7;
  color: #0284C7;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-autofill-creds:hover {
  background: #0284C7;
  color: #FFFFFF;
}

/* User Status Chip in Top Header */
.admin-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 30px;
  padding: 5px 14px 5px 6px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

.admin-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284C7 0%, #0369A1 100%);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
}

.admin-user-details {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.admin-user-name {
  font-size: 0.82rem;
  font-weight: 800;
  color: #0F172A;
}

.admin-user-role {
  font-size: 0.68rem;
  color: #10B981;
  font-weight: 700;
}

.btn-logout {
  background: #FEE2E2;
  border: 1px solid #FCA5A5;
  color: #DC2626;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  background: #DC2626;
  color: #FFFFFF;
  border-color: #DC2626;
}

