/* Reset and Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --card-bg: #ffffff;
  --text-dark: #0f172a;
  --text-medium: #334155;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --border-color-light: #f1f5f9;
  
  --indigo: #4f46e5;
  --indigo-hover: #4338ca;
  --indigo-light: #e0e7ff;
  
  --emerald: #10b981;
  --emerald-hover: #059669;
  --emerald-light: #d1fae5;
  
  --teal: #0d9488;
  --teal-hover: #0f766e;
  --teal-light: #ccfbf1;
  
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-light: #fee2e2;
  
  --border-radius-lg: 16px;
  --border-radius-md: 10px;
  --border-radius-sm: 6px;
  --transition-speed: 0.2s;
  
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.03), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.04), 0 4px 6px -4px rgba(15, 23, 42, 0.02);
  --shadow-premium: 0 20px 25px -5px rgba(15, 23, 42, 0.05), 0 8px 10px -6px rgba(15, 23, 42, 0.03);
}

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

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* App Header */
.app-header {
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border-color-light);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.9rem 0;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.02);
}

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

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

.brand-icon {
  font-size: 1.85rem;
  color: var(--indigo);
  transform: rotate(-15deg);
  transition: transform 0.3s ease;
}

.brand:hover .brand-icon {
  transform: rotate(0deg) scale(1.1);
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

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

.user-info-bar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background-color: var(--bg-primary);
  padding: 0.35rem 0.5rem 0.35rem 0.85rem;
  border-radius: 9999px;
  border: 1px solid var(--border-color-light);
}

.user-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-medium);
}

/* Badges */
.badge {
  font-size: 0.72rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.badge.bg-indigo { background-color: var(--indigo-light); color: var(--indigo); }
.badge.bg-teal { background-color: var(--teal-light); color: var(--teal); }
.badge.badge-success { background-color: var(--emerald-light); color: var(--emerald); }
.badge.bg-teal-light { background-color: var(--teal-light); color: var(--teal); }

/* Grid Layout & Containers */
.main-content {
  padding-top: 2rem;
  padding-bottom: 4rem;
  flex: 1;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -0.75rem;
}

.col-md-3, .col-md-4, .col-md-6, .col-lg-5, .col-lg-7 {
  padding: 0 0.75rem;
  width: 100%;
}

@media(min-width: 576px) {
  .col-sm-6 { width: 50%; }
}

@media(min-width: 768px) {
  .col-md-3 { width: 25%; }
  .col-md-4 { width: 33.3333%; }
  .col-md-6 { width: 50%; }
}

@media(min-width: 992px) {
  .col-lg-5 { width: 41.6666%; }
  .col-lg-7 { width: 58.3333%; }
}

/* Utilities classes */
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.py-5 { padding-top: 3rem; padding-bottom: 3rem; }
.text-center { text-align: center; }
.text-end { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-indigo { color: var(--indigo); }
.text-emerald { color: var(--emerald); }
.text-teal { color: var(--teal); }
.small { font-size: 0.8rem; }
.font-weight-bold { font-weight: 700; }
.d-flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }

/* Cards Styling */
.card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color-light);
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
  overflow: hidden;
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

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

.card-header {
  padding: 1.25rem 1.5rem;
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border-color-light);
}

.card-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.card-header p.text-muted {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  font-weight: 400;
}

.card-body {
  padding: 1.5rem;
}

/* Background classes */
.bg-light-green {
  background-color: #f0fdf4;
  border: 1px solid #dcfce7;
}

.border-left-indigo { border-left: 4px solid var(--indigo); }
.border-left-teal { border-left: 4px solid var(--teal); }
.border-left-emerald { border-left: 4px solid var(--emerald); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border-radius: var(--border-radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
}

.btn-block {
  display: flex;
  width: 100%;
}

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

.btn-primary:hover {
  background-color: var(--indigo-hover);
  transform: translateY(-1px);
}

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

.btn-success:hover {
  background-color: var(--emerald-hover);
  transform: translateY(-1px);
}

.btn-outline {
  border-color: var(--border-color);
  background-color: transparent;
  color: var(--text-medium);
}

.btn-outline:hover {
  background-color: var(--bg-primary);
  border-color: var(--text-muted);
}

.btn-outline-danger {
  border-color: #fecaca;
  background-color: transparent;
  color: var(--danger);
}

.btn-outline-danger:hover {
  background-color: var(--danger-light);
  border-color: var(--danger);
}

.btn-outline-primary {
  border-color: var(--indigo-light);
  background-color: transparent;
  color: var(--indigo);
}

.btn-outline-primary:hover {
  background-color: var(--indigo-light);
  border-color: var(--indigo);
}

.btn-sm {
  font-size: 0.78rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--border-radius-sm);
}

.btn-lg {
  font-size: 1.05rem;
  padding: 0.85rem 1.75rem;
  border-radius: var(--border-radius-md);
}

.btn-record {
  animation: pulse-button 2s infinite;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
}

@keyframes pulse-button {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-medium);
}

.form-control {
  width: 100%;
  padding: 0.6rem 0.85rem;
  font-family: inherit;
  font-size: 0.9rem;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
  background-color: #fff;
  color: var(--text-dark);
  transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.form-control:disabled {
  background-color: var(--bg-primary);
  color: var(--text-muted);
}

/* Alert Banners */
.alert {
  padding: 0.85rem 1.15rem;
  border-radius: var(--border-radius-md);
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}

.alert-danger {
  background-color: var(--danger-light);
  border-color: #fecaca;
  color: var(--danger);
}

.alert-warning {
  background-color: #fffbeb;
  border-color: #fde68a;
  color: #b45309;
}

/* Welcome Hero Banner with Gradient & Glassmorphism */
.welcome-banner {
  background: linear-gradient(135deg, var(--indigo) 0%, var(--teal) 100%);
  color: white;
  border: none;
  position: relative;
}

.welcome-text {
  padding: 2.25rem;
  position: relative;
  z-index: 2;
}

.welcome-text h2 {
  font-weight: 800;
  font-size: 1.65rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.welcome-text p {
  opacity: 0.88;
  font-weight: 400;
  font-size: 0.95rem;
}

.company-logo-wrapper {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  padding: 1rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Login Card styling */
.login-card {
  max-width: 440px;
  margin: 4rem auto;
  background-color: var(--card-bg);
  border-radius: 20px;
  border: 1px solid var(--border-color-light);
  box-shadow: var(--shadow-premium);
  padding: 2.5rem;
}

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

.login-logo {
  font-size: 3rem;
  color: var(--indigo);
  margin-bottom: 1rem;
}

.login-header h2 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-dark);
}

.login-header p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

/* Action Card (Branch Dashboard) */
.action-card {
  border-top: 4px solid var(--indigo);
}

.action-icon-wrapper {
  display: inline-flex;
  padding: 1.25rem;
  background-color: var(--indigo-light);
  border-radius: 50%;
  font-size: 2.25rem;
}

.tariff-display {
  background-color: var(--bg-primary);
  border-radius: var(--border-radius-md);
  padding: 1.25rem;
  border: 1px solid var(--border-color-light);
  display: inline-block;
  min-width: 250px;
}

.tariff-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 700;
}

.tariff-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-top: 0.25rem;
}

.split-info {
  font-size: 0.8rem;
  font-weight: 600;
}

/* Stats Card */
.balance-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0.75rem 0;
}

.balance-item .label {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.balance-item .value {
  font-size: 1.15rem;
  font-weight: 700;
}

hr {
  border: 0;
  border-top: 1px solid var(--border-color-light);
  margin: 1rem 0;
}

.info-alert {
  background-color: #eff6ff;
  border-left: 3px solid #3b82f6;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.8rem;
  color: #1e3a8a;
  line-height: 1.4;
}

/* Tables styling (Sleek and Spacious) */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  vertical-align: middle;
}

.table th {
  background-color: #f8fafc;
  color: var(--text-medium);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border-color-light);
}

.table td {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border-color-light);
  font-size: 0.85rem;
  color: var(--text-medium);
}

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

.table tr {
  transition: background-color var(--transition-speed) ease;
}

.table tr:hover {
  background-color: #fdfdfd;
}

.align-middle {
  vertical-align: middle;
}

/* Summary Cards (Owner Dashboard) */
.summary-card {
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color-light);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.summary-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.summary-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.summary-value {
  font-size: 1.35rem;
  font-weight: 800;
  margin-top: 0.25rem;
  letter-spacing: -0.01em;
}

.summary-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.bg-light-indigo { background-color: var(--indigo-light); color: var(--indigo); }
.bg-light-teal { background-color: var(--teal-light); color: var(--teal); }
.bg-light-emerald { background-color: var(--emerald-light); color: var(--emerald); }

/* Navigation Tabs (Stripe / Apple Style Pills) */
.tab-container {
  display: inline-flex;
  background-color: #e2e8f0;
  padding: 0.35rem;
  border-radius: 14px;
  gap: 0.25rem;
  border-bottom: none;
  width: auto;
  max-width: 100%;
}

.tab-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-medium);
  padding: 0.55rem 1.25rem;
  cursor: pointer;
  border-radius: 10px;
  position: relative;
  transition: all var(--transition-speed) ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tab-btn:hover {
  color: var(--text-dark);
  background-color: rgba(255, 255, 255, 0.4);
}

.tab-btn.active {
  color: var(--indigo);
  background-color: var(--card-bg);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.tab-btn.active::after {
  display: none;
}

/* Modals */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity var(--transition-speed) ease;
}

.modal-content {
  background-color: var(--card-bg);
  border-radius: 20px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.15);
  animation: slide-up 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slide-up {
  from { transform: translateY(15px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

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

.modal-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.close-modal {
  font-size: 1.75rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  transition: color var(--transition-speed) ease;
}

.close-modal:hover {
  color: var(--text-dark);
}

.modal-body {
  padding: 1.75rem;
}

.modal-footer {
  padding: 1.15rem 1.75rem;
  border-top: 1px solid var(--border-color-light);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background-color: var(--bg-primary);
  margin: 1.75rem -1.75rem -1.75rem -1.75rem;
}

/* App Footer */
.app-footer {
  border-top: 1px solid var(--border-color-light);
  padding: 1.75rem 0;
  background-color: var(--card-bg);
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: auto;
}

/* Utilities */
.hidden {
  display: none !important;
}

/* Row highlight animation */
.row-highlight {
  animation: flash-row 1.5s ease-out;
}

@keyframes flash-row {
  0% { background-color: var(--emerald-light); }
  100% { background-color: transparent; }
}

/* Add custom animations for tab content switching */
.owner-tab-content {
  animation: fade-in 0.25s ease-in-out;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Active states for service/payment options */
.option-service-label.active {
  background-color: var(--indigo-light) !important;
  border-color: var(--indigo) !important;
  color: var(--indigo) !important;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
  font-weight: 700;
}

.option-payment-label.active-tunai {
  background-color: var(--emerald-light) !important;
  border-color: var(--emerald) !important;
  color: var(--emerald) !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
  font-weight: 700;
}

.option-payment-label.active-qris {
  background-color: var(--indigo-light) !important;
  border-color: var(--indigo) !important;
  color: var(--indigo) !important;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
  font-weight: 700;
}

