/* Vinbay v2.0 - Modern Workshop Management System */
/* Dark/Light Mode Support with Premium Design */

@font-face {
  font-family: 'Inter';
  src: local('Inter'), local('Inter-Regular');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  /* Primary Colors */
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --primary-bg: #eef2ff;

  /* Secondary/Accent */
  --accent: #ec4899;
  --accent-light: #f472b6;

  /* Status Colors */
  --success: #10b981;
  --success-bg: #d1fae5;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --danger: #ef4444;
  --danger-bg: #fee2e2;
  --info: #3b82f6;
  --info-bg: #dbeafe;

  /* Neutrals - Light Mode */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  /* Spacing */
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Transitions */
  --transition: all 0.2s ease;
  --transition-fast: all 0.15s ease;
}

/* Dark Mode */
[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --border: #334155;
  --border-light: #1e293b;
  --primary-bg: #312e81;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ============================================
   LAYOUT - Sidebar Navigation
   ============================================ */

.app-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  width: 280px;
  height: 100vh;
  z-index: 100;
  transition: var(--transition);
}

.sidebar-header {
  padding: 24px;
  border-bottom: 1px solid var(--border);
}

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

.logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 18px;
}

.logo-text {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.logo-text span {
  color: var(--primary);
}

.logo-badge {
  font-size: 9px;
  background: var(--primary-bg);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
  margin-left: 8px;
}

/* Workshop Selector */
.workshop-selector {
  margin: 20px 16px;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition);
}

.workshop-selector:hover {
  background: var(--border);
}

.workshop-current {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.workshop-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.workshop-avatar {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 14px;
}

.workshop-name {
  font-weight: 600;
  font-size: 13px;
}

.workshop-plan {
  font-size: 11px;
  color: var(--text-muted);
}

.workshop-switch-icon {
  color: var(--text-muted);
}

/* Navigation */
.nav-section {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
}

.nav-group {
  margin-bottom: 8px;
}

.nav-group-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 12px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition-fast);
  margin-bottom: 2px;
}

.nav-item:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--primary-bg);
  color: var(--primary);
}

.nav-item-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.nav-item-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition-fast);
}

.user-menu:hover {
  background: var(--bg-tertiary);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 14px;
}

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

.user-name {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */

.main-content {
  margin-left: 280px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top Bar */
.topbar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb-sep {
  color: var(--border);
}

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

/* Search Bar */
.global-search {
  position: relative;
  width: 320px;
}

.global-search input {
  width: 100%;
  padding: 10px 16px 10px 44px;
  background: var(--bg-tertiary);
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  font-size: 13px;
  transition: var(--transition);
}

.global-search input:focus {
  background: var(--bg-secondary);
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-bg);
}

.global-search input::placeholder {
  color: var(--text-muted);
}

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

/* Icon Buttons */
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  position: relative;
  transition: var(--transition-fast);
}

.icon-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.icon-btn .badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 600;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Theme Toggle */
.theme-toggle {
  padding: 4px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  display: flex;
}

.theme-toggle button {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.theme-toggle button.active {
  background: var(--bg-secondary);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* ============================================
   PAGE CONTENT
   ============================================ */

.page-content {
  flex: 1;
  padding: 32px;
}

/* Page Header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.page-header-info h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.page-header-info p {
  color: var(--text-muted);
  font-size: 14px;
}

.page-actions {
  display: flex;
  gap: 12px;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius);
  transition: var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  filter: brightness(1.1);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  filter: brightness(1.1);
}

.btn-ghost {
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-tertiary);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 15px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
}

/* ============================================
   CARDS
   ============================================ */

.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
}

.card-body {
  padding: 24px;
}

.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-tertiary);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ============================================
   STATS CARDS
   ============================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: var(--transition);
}

.stat-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.stat-icon.purple {
  background: var(--primary-bg);
  color: var(--primary);
}

.stat-icon.green {
  background: var(--success-bg);
  color: var(--success);
}

.stat-icon.orange {
  background: var(--warning-bg);
  color: var(--warning);
}

.stat-icon.blue {
  background: var(--info-bg);
  color: var(--info);
}

.stat-icon.pink {
  background: #fce7f3;
  color: var(--accent);
}

.stat-content {
  flex: 1;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
}

.stat-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  margin-top: 8px;
}

.stat-change.up {
  color: var(--success);
}

.stat-change.down {
  color: var(--danger);
}

/* ============================================
   TABLES
   ============================================ */

.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: var(--bg-tertiary);
}

th {
  padding: 14px 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: left;
  white-space: nowrap;
}

td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}

tbody tr:hover {
  background: var(--bg-tertiary);
}

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

.table-actions {
  display: flex;
  gap: 8px;
}

/* ============================================
   FORMS
   ============================================ */

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-label .required {
  color: var(--danger);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  transition: var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

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

.form-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

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

/* ============================================
   BADGES & STATUS
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-full);
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.badge-info {
  background: var(--info-bg);
  color: var(--info);
}

.badge-primary {
  background: var(--primary-bg);
  color: var(--primary);
}

/* ============================================
   ALERTS
   ============================================ */

.alert {
  padding: 16px 20px;
  border-radius: var(--radius);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}

.alert-success {
  background: var(--success-bg);
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-danger {
  background: var(--danger-bg);
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-warning {
  background: var(--warning-bg);
  color: #92400e;
  border: 1px solid #fde68a;
}

.alert-info {
  background: var(--info-bg);
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

/* ============================================
   POS / CART SYSTEM
   ============================================ */

.pos-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 24px;
  height: calc(100vh - 134px);
}

.pos-products {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pos-search {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.pos-search input {
  flex: 1;
}

.pos-categories {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.pos-category {
  padding: 8px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: var(--transition-fast);
}

.pos-category:hover,
.pos-category.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.pos-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  overflow-y: auto;
  padding-right: 8px;
}

.pos-product-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: var(--transition);
}

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

.pos-product-image {
  width: 100%;
  aspect-ratio: 1;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--text-muted);
}

.pos-product-name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pos-product-code {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.pos-product-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

.pos-product-stock {
  font-size: 11px;
  color: var(--success);
}

.pos-product-stock.low {
  color: var(--danger);
}

/* Cart Panel */
.pos-cart {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.cart-title {
  font-size: 18px;
  font-weight: 700;
}

.cart-count {
  background: var(--primary);
  color: white;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
}

.cart-customer {
  padding: 16px 20px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
}

.cart-customer-select {
  display: flex;
  gap: 8px;
}

.cart-customer-select select {
  flex: 1;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-light);
}

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

.cart-item-image {
  width: 48px;
  height: 48px;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-muted);
}

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

.cart-item-name {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-price {
  font-size: 12px;
  color: var(--text-muted);
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-item-qty button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: var(--transition-fast);
}

.cart-item-qty button:hover {
  background: var(--bg-tertiary);
}

.cart-item-qty input {
  width: 40px;
  text-align: center;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.cart-item-total {
  font-weight: 700;
  font-size: 14px;
  min-width: 70px;
  text-align: right;
}

.cart-item-remove {
  color: var(--danger);
  opacity: 0.6;
  font-size: 18px;
}

.cart-item-remove:hover {
  opacity: 1;
}

/* Cart Summary */
.cart-summary {
  padding: 20px;
  background: var(--bg-tertiary);
  border-top: 1px solid var(--border);
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 14px;
}

.cart-summary-row.total {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  padding-top: 12px;
  border-top: 1px solid var(--border);
  margin-bottom: 0;
}

.cart-discount {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.cart-discount input {
  flex: 1;
}

/* Cart Actions */
.cart-actions {
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.cart-actions .btn-primary {
  grid-column: 1 / -1;
  padding: 16px;
  font-size: 16px;
}

/* Empty Cart */
.cart-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
}

.cart-empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.cart-empty h3 {
  font-size: 16px;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

/* ============================================
   AUTH PAGES
   ============================================ */

.auth-layout {
  min-height: 100vh;
  display: flex;
}

.auth-left {
  flex: 1;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px;
  color: white;
  position: relative;
  overflow: hidden;
}

.auth-left::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
  animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

.auth-left-content {
  position: relative;
  z-index: 1;
  max-width: 480px;
}

.auth-left h1 {
  font-size: 42px;
  font-weight: 800;
  margin-bottom: 24px;
  line-height: 1.2;
}

.auth-left p {
  font-size: 18px;
  opacity: 0.9;
  line-height: 1.7;
}

.auth-features {
  margin-top: 48px;
}

.auth-feature {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.auth-feature-icon {
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.2);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.auth-feature-text {
  font-size: 15px;
  font-weight: 500;
}

.auth-right {
  width: 520px;
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px;
}

.auth-form {
  max-width: 380px;
  margin: 0 auto;
  width: 100%;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
}

.auth-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.auth-subtitle {
  color: var(--text-muted);
  margin-bottom: 32px;
}

.auth-tabs {
  display: flex;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius);
  transition: var(--transition-fast);
}

.auth-tab.active {
  background: var(--bg-secondary);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.auth-form .form-group {
  margin-bottom: 20px;
}

.auth-form .btn-primary {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  margin-top: 8px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-links {
  text-align: center;
  margin-top: 24px;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-links a {
  color: var(--primary);
  font-weight: 500;
}

.auth-links a:hover {
  text-decoration: underline;
}

.auth-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

.auth-checkbox input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.auth-forgot {
  text-align: right;
  margin-top: -12px;
  margin-bottom: 20px;
}

.auth-forgot a {
  font-size: 13px;
  color: var(--primary);
}

/* ============================================
   SUBSCRIPTION PLANS
   ============================================ */

.plans-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 48px;
}

.plans-header h1 {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 16px;
}

.plans-header p {
  font-size: 18px;
  color: var(--text-muted);
}

.plans-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 40px;
}

.plans-tab {
  padding: 10px 24px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  transition: var(--transition-fast);
}

.plans-tab:hover,
.plans-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.plan-card {
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  position: relative;
  transition: var(--transition);
}

.plan-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-xl);
}

.plan-card.featured {
  border-color: var(--primary);
  transform: scale(1.05);
}

.plan-card.featured::before {
  content: 'Most Popular';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  padding: 4px 16px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
}

.plan-name {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.plan-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.plan-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 24px;
}

.plan-currency {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-secondary);
}

.plan-amount {
  font-size: 48px;
  font-weight: 800;
}

.plan-period {
  font-size: 14px;
  color: var(--text-muted);
}

.plan-features {
  list-style: none;
  margin-bottom: 32px;
}

.plan-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--border-light);
}

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

.plan-features li::before {
  content: '✓';
  width: 20px;
  height: 20px;
  background: var(--success-bg);
  color: var(--success);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.plan-card .btn {
  width: 100%;
  padding: 14px;
}

/* ============================================
   INVOICE / DOCUMENT
   ============================================ */

.invoice-container {
  max-width: 900px;
  margin: 0 auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.invoice-header {
  display: flex;
  justify-content: space-between;
  padding: 40px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
}

.invoice-brand h1 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 8px;
}

.invoice-brand p {
  opacity: 0.9;
}

.invoice-meta {
  text-align: right;
}

.invoice-number {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 8px;
}

.invoice-date {
  font-size: 24px;
  font-weight: 700;
}

.invoice-status {
  margin-top: 12px;
  display: inline-block;
  padding: 6px 16px;
  background: rgba(255,255,255,0.2);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
}

.invoice-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding: 40px;
  border-bottom: 1px solid var(--border);
}

.invoice-party h3 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.invoice-party p {
  font-size: 14px;
  line-height: 1.8;
}

.invoice-items {
  padding: 0 40px;
}

.invoice-items table {
  margin: 0;
}

.invoice-items th {
  background: transparent;
  border-bottom: 2px solid var(--border);
}

.invoice-totals {
  padding: 40px;
  display: flex;
  justify-content: flex-end;
}

.invoice-totals-table {
  width: 300px;
}

.invoice-totals-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 14px;
}

.invoice-totals-row.total {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  border-top: 2px solid var(--border);
  margin-top: 12px;
  padding-top: 16px;
}

.invoice-footer {
  padding: 24px 40px;
  background: var(--bg-tertiary);
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pos-layout {
    grid-template-columns: 1fr 360px;
  }

  .plans-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
  }

  .plan-card.featured {
    transform: none;
  }
}

@media (max-width: 1024px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-xl);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .pos-layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .pos-cart {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 70vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    transform: translateY(calc(100% - 70px));
    transition: var(--transition);
  }

  .pos-cart.open {
    transform: translateY(0);
  }

  .auth-layout {
    flex-direction: column;
  }

  .auth-left {
    display: none;
  }

  .auth-right {
    width: 100%;
    min-height: 100vh;
  }
}

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

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

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .topbar {
    padding: 0 16px;
  }

  .global-search {
    display: none;
  }

  .page-content {
    padding: 20px 16px;
  }

  .invoice-header {
    flex-direction: column;
    gap: 24px;
  }

  .invoice-meta {
    text-align: left;
  }

  .invoice-parties {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* ============================================
   UTILITIES
   ============================================ */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary); }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.p-0 { padding: 0; }
.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

.shadow { box-shadow: var(--shadow); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

.cursor-pointer { cursor: pointer; }
.select-none { user-select: none; }

.transition { transition: var(--transition); }

/* Print Styles */
@media print {
  body {
    background: white;
  }

  .sidebar,
  .topbar,
  .page-actions,
  .no-print {
    display: none !important;
  }

  .main-content {
    margin-left: 0;
  }

  .page-content {
    padding: 0;
  }

  .invoice-container {
    border: none;
    box-shadow: none;
  }
}
