/* INFISOFT PWA - Glassmorphic Dark & Light Theme System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Roboto+Condensed:wght@400;500;600;700&family=JetBrains+Mono:wght@500;600&display=swap');

:root {
  --bg-dark: #090d16;
  --bg-card: rgba(18, 24, 38, 0.85);
  --bg-card-hover: rgba(26, 35, 54, 0.95);
  --bg-header: rgba(9, 13, 22, 0.9);
  --bg-sidebar: rgba(15, 23, 42, 0.95);
  --bg-input: rgba(15, 23, 42, 0.7);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-glow: rgba(59, 130, 246, 0.4);

  --primary: #3b82f6;
  --primary-glow: rgba(59, 130, 246, 0.25);
  --accent-cyan: #06b6d4;
  --accent-purple: #8b5cf6;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-gold: #eab308;
  --accent-whatsapp: #25d366;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
}

/* Light Theme Variable Overrides */
[data-theme="light"] {
  --bg-dark: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-header: rgba(255, 255, 255, 0.95);
  --bg-sidebar: #ffffff;
  --bg-input: #f8fafc;
  --border-color: rgba(0, 0, 0, 0.08);
  --border-color-glow: rgba(37, 99, 235, 0.3);

  --primary: #2563eb;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.12);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(59, 130, 246, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(139, 92, 246, 0.08) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
}

/* ---------------------------------------------------- */
/* BRAND LOGO IMAGE STYLES */
/* ---------------------------------------------------- */
.brand-logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(59, 130, 246, 0.3));
}

.login-logo-img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  margin-bottom: 0.6rem;
  filter: drop-shadow(0 4px 12px rgba(59, 130, 246, 0.4));
}

/* ---------------------------------------------------- */
/* FULLSCREEN LOGIN VIEW */
/* ---------------------------------------------------- */
.login-view-container {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.15) 0%, transparent 50%);
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-view-container.active {
  display: flex;
}

.login-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  max-width: 440px;
  width: 100%;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  animation: loginIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes loginIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  font-family: 'Roboto Condensed', sans-serif;
  letter-spacing: -0.3px;
}

.login-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.demo-chips-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--border-color);
}

.demo-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}

.demo-chip:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--primary);
}

/* ---------------------------------------------------- */
/* APP LAYOUT & SIDEBAR */
/* ---------------------------------------------------- */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 250px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 150;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(16px);
}

/* HIDE SIDEBAR COMPLETELY WHEN COLLAPSED */
.sidebar.collapsed {
  transform: translateX(-100%);
}

.sidebar-header {
  padding: 1rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  overflow: hidden;
}

.sidebar-logo-text {
  display: flex;
  flex-direction: column;
  white-space: nowrap;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  font-family: 'Roboto Condensed', sans-serif;
  color: var(--text-main);
  letter-spacing: -0.3px;
}

.brand-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
}

.sidebar-toggle-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s;
}

.sidebar-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* SIDEBAR CONFIGURATION MENU SECTION */
.sidebar-config-section {
  padding: 0.75rem 0.65rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  background: rgba(0, 0, 0, 0.08);
}

.sidebar-config-title {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  padding: 0 0.25rem 0.25rem 0.25rem;
  text-transform: uppercase;
}

.sidebar-config-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.35rem 0.55rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  font-size: 0.76rem;
  color: var(--text-muted);
}

.fy-select {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--accent-cyan);
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-md);
  outline: none;
  cursor: pointer;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.fy-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.fy-select option {
  background: #0f172a;
  color: #fff;
}

/* USER ROLE COMBO BOX MATCHING FINANCIAL YEAR STYLE */
.role-select-box {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.role-select-box:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.role-select-box option {
  background: #0f172a;
  color: #fff;
}

.badge-offline {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-offline.active {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border-color: rgba(244, 63, 94, 0.3);
}

/* Sidebar Nav Items */
.sidebar-nav {
  padding: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
  overflow-y: auto;
}

.sidebar-nav-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: -0.2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  white-space: nowrap;
  transition: all 0.2s ease;
  width: 100%;
  text-align: left;
}

.sidebar-nav-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-nav-btn.active {
  background: linear-gradient(135deg, var(--primary), #2563eb);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

/* Sidebar User Info & Footer */
.sidebar-user-panel {
  padding: 0.85rem;
  border-top: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.05);
}

.user-card-sm {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  overflow: hidden;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-purple), var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 0.82rem;
  flex-shrink: 0;
}

.user-details {
  display: flex;
  flex-direction: column;
  white-space: nowrap;
  overflow: hidden;
  flex: 1;
}

.user-name {
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: -0.2px;
  color: var(--text-main);
}

.user-role-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  display: inline-block;
}

.role-super-admin { background: rgba(234, 179, 8, 0.18); color: var(--accent-gold); border: 1px solid rgba(234, 179, 8, 0.3); }
.role-admin { background: rgba(6, 182, 212, 0.18); color: var(--accent-cyan); border: 1px solid rgba(6, 182, 212, 0.3); }
.role-staff { background: rgba(16, 185, 129, 0.18); color: var(--accent-emerald); border: 1px solid rgba(16, 185, 129, 0.3); }

/* ---------------------------------------------------- */
/* MAIN CONTENT WRAPPER */
/* ---------------------------------------------------- */
.main-wrapper {
  flex: 1;
  margin-left: 250px;
  transition: margin-left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* EXPAND MAIN CONTENT TO 100% FULL WIDTH WHEN SIDEBAR IS COLLAPSED */
.main-wrapper.sidebar-collapsed {
  margin-left: 0;
}

/* Header Bar */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  padding: 0.65rem 1.25rem;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.header-menu-trigger {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.header-menu-trigger:hover {
  background: rgba(255, 255, 255, 0.12);
}

.mobile-menu-trigger {
  display: none;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  cursor: pointer;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* Main Container */
main {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 1.25rem;
  flex: 1;
}

/* Section Header */
.view-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 1.25rem;
}

.view-title {
  font-size: 1.3rem;
  font-weight: 600;
  font-family: 'Roboto Condensed', sans-serif;
  color: var(--text-main);
  letter-spacing: -0.3px;
}

.view-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.view-stats-badge {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 0.35rem 0.85rem;
  border-radius: 16px;
  font-weight: 600;
  font-size: 0.8rem;
}

/* Views */
.view-section {
  display: none;
  animation: fadeIn 0.3s ease forwards;
}

.view-section.active {
  display: block;
}

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

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.clickable-metric {
  cursor: pointer;
}

.clickable-metric:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  border-color: var(--border-color-glow);
}

.metric-card.cyan { border-left: 3px solid var(--accent-cyan); }
.metric-card.emerald { border-left: 3px solid var(--accent-emerald); }
.metric-card.purple { border-left: 3px solid var(--accent-purple); }
.metric-card.gold { border-left: 3px solid var(--accent-gold); }

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  letter-spacing: 0.3px;
}

.metric-value {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.5px;
  margin-bottom: 0.2rem;
  font-family: 'JetBrains Mono', monospace;
}

.metric-trend {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* Dashboard Split Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

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

.card-panel {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border-color);
}

.panel-title {
  font-size: 0.98rem;
  font-weight: 600;
  font-family: 'Roboto Condensed', sans-serif;
  letter-spacing: -0.2px;
  color: var(--text-main);
}

/* Search Filters */
.search-filter-box {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.9rem 1rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.search-input-group {
  position: relative;
  width: 100%;
}

.search-input-group.large-search input {
  font-size: 0.92rem;
  padding: 0.75rem 1rem 0.75rem 2.65rem;
  background: var(--bg-input);
  border-color: rgba(59, 130, 246, 0.4);
}

.search-input-group input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.65rem 1rem 0.65rem 2.5rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  letter-spacing: -0.2px;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.search-input-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
}

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

.custom-table th {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-weight: 600;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.custom-table td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

.custom-table.table-compact th {
  padding: 0.4rem 0.65rem;
  font-size: 0.76rem;
}

.custom-table.table-compact td {
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  line-height: 1.25;
}

.custom-table.clickable-table tbody tr {
  cursor: pointer;
}

.custom-table.clickable-table tbody tr:hover {
  background: rgba(59, 130, 246, 0.08);
}

.fy-badge {
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-purple);
  border: 1px solid rgba(139, 92, 246, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 500;
}

.date-text {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
}

.currency-text {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: var(--text-main);
}

.status-badge {
  padding: 0.2rem 0.5rem;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 500;
}

.status-instock { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
.status-sold { background: rgba(59, 130, 246, 0.15); color: var(--primary); }

/* ---------------------------------------------------- */
/* TABLE & MOBILE CARD COMPACT SVG ICON BADGES */
/* ---------------------------------------------------- */
.table-pdf-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 5px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.table-pdf-icon:hover {
  background: rgba(239, 68, 68, 0.28);
  transform: scale(1.12);
}

.table-wa-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 5px;
  background: rgba(37, 211, 102, 0.12);
  border: 1px solid rgba(37, 211, 102, 0.3);
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.table-wa-icon:hover {
  background: rgba(37, 211, 102, 0.28);
  transform: scale(1.12);
}

.icon-btn-pdf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn-pdf:hover {
  background: rgba(239, 68, 68, 0.35);
  transform: scale(1.08);
}

.icon-btn-wa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: rgba(37, 211, 102, 0.15);
  border: 1px solid rgba(37, 211, 102, 0.3);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn-wa:hover {
  background: rgba(37, 211, 102, 0.35);
  transform: scale(1.08);
}

/* ---------------------------------------------------- */
/* MOBILE CARD LIST VIEW (NARROW CLEAN SMALL TYPOGRAPHY) */
/* ---------------------------------------------------- */
.mobile-card-list {
  display: none;
  flex-direction: column;
  gap: 0.3rem; /* ultra fine spacing */
}

.mobile-invoice-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  padding: 0.4rem 0.6rem; /* narrow compact padding */
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}

.mobile-invoice-card:hover {
  transform: translateY(-1px);
  border-color: var(--border-color-glow);
}

.mobile-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mobile-vchno {
  font-family: 'Roboto Condensed', sans-serif;
  font-weight: 600;
  color: var(--primary);
  font-size: 0.78rem;
  letter-spacing: -0.3px;
}

.mobile-card-middle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
}

.mobile-card-party {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.78rem;
  color: var(--text-main);
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.mobile-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.1rem;
  padding-top: 0.2rem;
  border-top: 1px dashed var(--border-color);
}

.mobile-amount {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: -0.3px;
  color: var(--accent-emerald);
  flex-shrink: 0;
}

/* RESPONSIVE LAYOUT BREAKPOINTS */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
    width: 250px !important;
  }

  .main-wrapper {
    margin-left: 0 !important;
  }

  .mobile-menu-trigger {
    display: flex;
  }

  .desktop-table-container {
    display: none !important;
  }

  .mobile-card-list {
    display: flex !important;
  }

  main {
    padding: 0.5rem; /* fine compact main container padding on mobile */
  }

  .card-panel {
    padding: 0.65rem; /* fine panel padding on mobile */
  }
}

/* Buttons */
.btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.82rem;
  letter-spacing: -0.2px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-sm {
  padding: 0.25rem 0.55rem;
  font-size: 0.74rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #2563eb);
  color: #fff;
  border: none;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.5);
  transform: translateY(-1px);
}

.btn-warning {
  background: rgba(234, 179, 8, 0.15);
  color: var(--accent-gold);
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.btn-warning:hover {
  background: rgba(234, 179, 8, 0.3);
}

.btn-danger {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
  background: rgba(244, 63, 94, 0.3);
}

.btn-whatsapp {
  background: rgba(37, 211, 102, 0.15);
  color: var(--accent-whatsapp);
  border: 1px solid rgba(37, 211, 102, 0.3);
}

.btn-whatsapp:hover {
  background: rgba(37, 211, 102, 0.3);
}

.btn-close {
  background: rgba(255, 255, 255, 0.05);
  border: none;
  font-size: 0.9rem;
  padding: 0.3rem 0.6rem;
}

/* Modals */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  position: relative;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  max-width: 600px;
  width: 100%;
  padding: 1rem;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s ease forwards;
  display: flex;
  flex-direction: column;
  max-height: 85vh; /* Ensure modal never exceeds viewport height */
  overflow: hidden; /* Header stays pinned, body scrolls */
}

.modal-card > .modal-header .btn-close,
.modal-card > .btn-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 60;
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-card > .modal-header .btn-close:hover,
.modal-card > .btn-close:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #ffffff;
  border-color: rgba(239, 68, 68, 0.4);
  transform: scale(1.08);
}

.modal-card.modal-large {
  max-width: 850px;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

/* ALWAYS PINNED STICKY HEADER BLOCK FOR MODAL */
.modal-single-header-block {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex-shrink: 0; /* Never shrink or scroll out! */
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.modal-header-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-vchno-title {
  font-family: 'Roboto Condensed', sans-serif;
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: -0.3px;
  color: var(--primary);
}

.modal-customer-name {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.82rem;
  letter-spacing: -0.2px;
  color: var(--text-main);
}

.modal-meta-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.74rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  margin-top: 0.1rem;
  padding-top: 0.25rem;
  border-top: 1px dashed var(--border-color);
}

.modal-meta-divider {
  opacity: 0.35;
}

.highlight-amt {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: var(--accent-emerald);
}

/* SCROLLABLE MODAL BODY FOR LONG LIST OF ITEMS */
.modal-body {
  flex: 1;
  overflow-y: auto; /* Enable scroll ONLY for the list of items */
  padding-right: 0.2rem;
  min-height: 0;
}

/* MOBILE LINE ITEM HIGH DENSITY CARDS IN MODAL */
.modal-mobile-item-list {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
}

.modal-mobile-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  padding: 0.35rem 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.modal-mobile-item-name {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: -0.2px;
  color: var(--text-main);
}

.modal-mobile-item-slno {
  font-family: 'Roboto Condensed', monospace;
  font-size: 0.68rem;
  color: var(--accent-gold);
  margin-left: 0.25rem;
}

.modal-mobile-item-metrics {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.68rem;
  color: var(--text-muted);
}

.modal-mobile-item-metrics .amt {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: var(--text-main);
}

@media (max-width: 768px) {
  .modal-desktop-table-container {
    display: none !important;
  }

  .modal-mobile-item-list {
    display: flex !important;
  }
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 600;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* ====================================================
   COMPACT & THEME-STYLED PAGINATION BAR
   ==================================================== */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding: 0.75rem 0.5rem 0.25rem 0.5rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.pagination-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.pagination-info strong {
  color: var(--accent-gold);
  font-weight: 600;
}

.page-size-select {
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.5rem;
  font-size: 0.78rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.page-size-select:focus,
.page-size-select:hover {
  border-color: var(--primary);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.page-btn {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  min-width: 28px;
  height: 28px;
  padding: 0 0.5rem;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  user-select: none;
}

.page-btn:hover:not(:disabled):not(.active) {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.page-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(13, 110, 253, 0.4);
}

.page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.page-btn.btn-prev,
.page-btn.btn-next {
  padding: 0 0.65rem;
  font-size: 0.76rem;
}

/* =============================================
   REDESIGNED DASHBOARD STYLES
   ============================================= */

/* Hero Welcome Bar */
.dash-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(59,130,246,0.12) 0%, rgba(139,92,246,0.10) 50%, rgba(16,185,129,0.08) 100%);
  border: 1px solid rgba(59,130,246,0.18);
  border-radius: var(--radius-xl);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.25rem;
  position: relative;
  overflow: hidden;
}

.dash-hero::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,0.15), transparent 70%);
  pointer-events: none;
}

.dash-hero-greeting {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-cyan);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.dash-hero-name {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 0.3rem 0;
  line-height: 1.15;
  background: linear-gradient(135deg, var(--text-main), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dash-hero-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.dash-hero-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-emerald);
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.2);
  padding: 0.4rem 0.85rem;
  border-radius: 99px;
  white-space: nowrap;
  flex-shrink: 0;
}

.dash-live-dot {
  width: 7px; height: 7px;
  background: var(--accent-emerald);
  border-radius: 50%;
  display: inline-block;
  animation: pulse-live 1.5s infinite;
}

@keyframes pulse-live {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.75); }
}

/* KPI Cards Row */
.dash-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.9rem;
  margin-bottom: 1.1rem;
}

.dash-kpi-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  position: relative;
  overflow: hidden;
}

.dash-kpi-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  opacity: 0;
  transition: opacity 0.2s;
}

.dash-kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.dash-kpi-card:hover::after { opacity: 1; }

.kpi-emerald { border-left: 3px solid var(--accent-emerald); }
.kpi-emerald::after { background: var(--accent-emerald); }
.kpi-emerald:hover { border-color: var(--accent-emerald); box-shadow: 0 8px 24px rgba(16,185,129,0.18); }

.kpi-purple { border-left: 3px solid var(--accent-purple); }
.kpi-purple::after { background: var(--accent-purple); }
.kpi-purple:hover { border-color: var(--accent-purple); box-shadow: 0 8px 24px rgba(139,92,246,0.18); }

.kpi-cyan { border-left: 3px solid var(--accent-cyan); }
.kpi-cyan::after { background: var(--accent-cyan); }
.kpi-cyan:hover { border-color: var(--accent-cyan); box-shadow: 0 8px 24px rgba(6,182,212,0.18); }

.kpi-gold { border-left: 3px solid var(--accent-gold); }
.kpi-gold::after { background: var(--accent-gold); }
.kpi-gold:hover { border-color: var(--accent-gold); box-shadow: 0 8px 24px rgba(234,179,8,0.18); }

.dash-kpi-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.dash-kpi-body {
  flex: 1;
  min-width: 0;
}

.dash-kpi-label {
  font-size: 0.67rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

.dash-kpi-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-kpi-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.dash-kpi-arrow {
  font-size: 1rem;
  color: var(--text-dim);
  flex-shrink: 0;
  transition: transform 0.18s ease, color 0.18s ease;
}

.dash-kpi-card:hover .dash-kpi-arrow {
  transform: translateX(4px);
  color: var(--primary);
}

/* Quick Shortcut Buttons */
.dash-shortcuts {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}

.dash-shortcut-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 99px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.dash-shortcut-btn:hover {
  background: rgba(59,130,246,0.12);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.dash-shortcut-btn span {
  font-size: 0.95rem;
}

/* Activity Feed Grid */
.dash-activity-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.dash-activity-panel {
  display: flex;
  flex-direction: column;
}

.dash-panel-title {
  cursor: pointer;
  transition: color 0.15s;
}
.dash-panel-title:hover { color: var(--primary); }

/* Feed Items */
.dash-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.dash-feed-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.15s ease;
  border-radius: var(--radius-sm);
  gap: 0.75rem;
}

.dash-feed-item:last-child { border-bottom: none; }

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

.dash-feed-left {
  flex: 1;
  min-width: 0;
}

.dash-feed-vchno {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-feed-party {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.15rem;
}

.dash-feed-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  flex-shrink: 0;
}

.dash-feed-amount {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

.dash-feed-date {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.dash-feed-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.1rem;
}

.dash-feed-pdf,
.dash-feed-wa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  padding: 0;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
}

.dash-feed-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.82rem;
}

/* Responsive: 2-col KPIs on tablet, 1-col on mobile */
@media (max-width: 1100px) {
  .dash-kpi-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .dash-kpi-row { grid-template-columns: repeat(2, 1fr); gap: 0.65rem; }
  .dash-kpi-card { padding: 0.85rem 0.9rem; }
  .dash-kpi-value { font-size: 0.95rem; }
  .dash-kpi-icon { font-size: 1.2rem; }
  .dash-activity-grid { grid-template-columns: 1fr; }
  .dash-hero { padding: 1.1rem 1.2rem; }
  .dash-hero-name { font-size: 1.3rem; }
}

@media (max-width: 480px) {
  .dash-kpi-row { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .dash-kpi-card { padding: 0.75rem 0.75rem; }
  .dash-kpi-arrow { display: none; }
}

/* =============================================
   ITEM MASTERS & DRAFT INVOICE STYLES
   ============================================= */

/* Master & Filter Tab Buttons */
.master-tab-btn,
.draft-filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-weight: 600;
  transition: all 0.2s ease;
}

.master-tab-btn:hover,
.draft-filter-btn:hover {
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary);
  border-color: var(--primary);
}

.master-tab-btn.active,
.draft-filter-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.3);
}

/* Draft Cards Grid */
.draft-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.draft-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.draft-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.6rem;
}

.draft-id-tag {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--primary);
}

.draft-status-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-pending {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-approved {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-rejected {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.draft-item-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.draft-category-sub {
  font-size: 0.76rem;
  color: var(--accent-cyan);
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.draft-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-top: 1px dashed var(--border-color);
  border-bottom: 1px dashed var(--border-color);
  margin-bottom: 0.65rem;
  font-size: 0.8rem;
}

.draft-amt {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--accent-emerald);
}

/* Image Thumbnails */
.draft-img-thumb {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: transform 0.15s;
}

.draft-img-thumb:hover {
  transform: scale(1.08);
}

.draft-img-container {
  position: relative;
  display: inline-block;
}

.draft-img-remove {
  position: absolute;
  top: -6px; right: -6px;
  background: var(--accent-rose);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 18px; height: 18px;
  font-size: 0.65rem;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* GPS Map Link */
.gps-location-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.1);
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.gps-location-tag:hover {
  background: rgba(6, 182, 212, 0.2);
}

/* =============================================
   MODAL OVERLAY SYSTEM
   ============================================= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.active {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  transform: scale(0.92);
  transition: transform 0.25s ease;
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-medium {
  max-width: 620px;
}

.modal-large {
  max-width: 850px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-badge {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--primary);
  text-transform: uppercase;
}

.btn-close {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.btn-close:hover {
  background: var(--accent-rose);
  color: #ffffff;
  border-color: var(--accent-rose);
}


