/*
    File: account-dashboard.css
    Location: frontend/css/account-dashboard.css
    Purpose: Styling for customer account dashboard
*/

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: #f5f6fa;
  min-height: 100vh;
}

/* Header */
.dashboard-header {
  background: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo {
  height: 50px;
}

.logo-section h1 {
  font-size: 20px;
  color: #333;
  font-weight: 600;
}

.user-section {
  display: flex;
  align-items: center;
  gap: 20px;
}

.user-name {
  font-weight: 500;
  color: #666;
}

.btn-logout {
  background: #ff6b35;
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.3s ease;
}

.btn-logout:hover {
  background: #e55a2b;
}

/* Dashboard Container */
.dashboard-container {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 30px;
  padding: 30px;
}

/* Sidebar */
.sidebar {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  height: fit-content;
  position: sticky;
  top: 100px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  border-radius: 8px;
  text-decoration: none;
  color: #666;
  transition: all 0.3s ease;
  font-weight: 500;
}

.nav-item:hover {
  background: #f8f9fa;
  color: #ff6b35;
}

.nav-item.active {
  background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
  color: white;
}

.nav-item .icon {
  font-size: 20px;
}

.nav-item-shop {
  border: 2px solid #56ab2f;
  background: linear-gradient(135deg, rgba(86, 171, 47, 0.1) 0%, rgba(168, 224, 99, 0.1) 100%);
  color: #56ab2f;
  font-weight: 600;
  margin-bottom: 10px;
}

.nav-item-shop:hover {
  background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
  color: white;
  border-color: #56ab2f;
}

/* Main Content */
.main-content {
  background: white;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  min-height: 600px;
}

.content-tab {
  display: none;
}

.content-tab.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.content-tab h2 {
  font-size: 24px;
  color: #333;
  margin-bottom: 25px;
}

.content-tab h3 {
  font-size: 18px;
  color: #333;
  margin-bottom: 15px;
  margin-top: 30px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 15px;
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
}

.stat-card:nth-child(1) {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-card:nth-child(2) {
  background: linear-gradient(135deg, #ffa751 0%, #ffe259 100%);
}

.stat-card:nth-child(3) {
  background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
}

.stat-card:nth-child(4) {
  background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
}

.stat-icon {
  font-size: 36px;
}

.stat-label {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 5px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
}

/* Branches Section */
.branches-section {
  margin-top: 30px;
}

.branches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.branch-card {
  background: #f8f9fa;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  padding: 15px;
  transition: all 0.3s ease;
}

.branch-card:hover {
  border-color: #ff6b35;
  box-shadow: 0 5px 15px rgba(255, 107, 53, 0.2);
}

.branch-name {
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
  font-size: 16px;
}

.branch-info {
  font-size: 13px;
  color: #666;
  line-height: 1.6;
}

/* Orders List */
.recent-orders,
.orders-list {
  margin-top: 30px;
}

.tab-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

/* Primary Button Styling */
.btn-primary {
  background: #ff6b35;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  background: #e55a28;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  background: #fca785;
  cursor: not-allowed;
  transform: none;
}

.filters {
  display: flex;
  gap: 10px;
}

.filters .custom-select {
  width: 140px;
  flex-shrink: 0;
}

.filter-select {
  padding: 8px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

.filter-select:focus {
  outline: none;
  border-color: #ff6b35;
}

/* Custom dropdown styles for account dashboard */
.custom-select {
  position: relative;
  width: 100%;
  user-select: none;
}

.custom-select select {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
  border: none;
}

.custom-select-trigger {
  width: 100%;
  padding: 8px 36px 8px 15px;
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
  background-color: white;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  box-sizing: border-box;
}

.custom-select-trigger::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #374151;
  transition: transform 0.2s ease;
}

.custom-select.open .custom-select-trigger::after {
  transform: translateY(-50%) rotate(180deg);
}

.custom-select-trigger:hover {
  border-color: #ff6b35;
}

.custom-select.open .custom-select-trigger {
  border-color: #ff6b35;
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
  border-radius: 6px 6px 0 0;
}

.custom-select-options {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 2px solid #ff6b35;
  border-top: none;
  border-radius: 0 0 6px 6px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.custom-select.open .custom-select-options {
  display: block;
}

.custom-select-option {
  padding: 9px 15px;
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.custom-select-option:hover {
  background: #fff4f0;
  color: #ff6b35;
}

.custom-select-option.selected {
  background: #ff6b35;
  color: white;
}

.custom-select-option.disabled {
  color: #9ca3af;
  cursor: default;
}

.custom-select-option.disabled:hover {
  background: transparent;
  color: #9ca3af;
}

.order-card {
  background: #f8f9fa;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 15px;
  transition: all 0.3s ease;
}

.order-card:hover {
  border-color: #ff6b35;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.order-number {
  font-weight: 600;
  font-size: 16px;
  color: #333;
}

.order-status {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.order-status.processing {
  background: #fff3cd;
  color: #856404;
}

.order-status.shipped {
  background: #cce5ff;
  color: #004085;
}

.order-status.delivered {
  background: #d4edda;
  color: #155724;
}

.order-status.cancelled {
  background: #f8d7da;
  color: #721c24;
}

.order-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-bottom: 15px;
}

.order-detail {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.detail-label {
  font-size: 12px;
  color: #666;
  text-transform: uppercase;
}

.detail-value {
  font-size: 14px;
  color: #333;
  font-weight: 500;
}

.order-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #e0e0e0;
}

.btn-order-action {
  padding: 8px 15px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-view {
  background: #ff6b35;
  color: white;
}

.btn-view:hover {
  background: #e55a2b;
}

.btn-invoice {
  background: #28a745;
  color: white;
}

.btn-invoice:hover {
  background: #218838;
}

/* Profile Form */
.profile-form {
  max-width: 600px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #333;
  font-size: 14px;
}

.form-group input {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.3s ease;
}

.form-group input:focus {
  outline: none;
  border-color: #ff6b35;
}

.form-group input:disabled {
  background: #f0f0f0;
  cursor: not-allowed;
}

.form-group small {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: #666;
}

.btn-submit {
  background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 107, 53, 0.3);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.profile-actions {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 1px solid #e0e0e0;
  max-width: 600px;
}

.btn-secondary {
  display: inline-block;
  background: #6c757d;
  color: white;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.3s ease;
  border: none;
  cursor: pointer;
}

.btn-secondary:hover {
  background: #5a6268;
}

.btn-warning {
  display: inline-block;
  background: #fbbf24;
  color: #1f2937;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.btn-warning:hover {
  background: #f59e0b;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.3);
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  backdrop-filter: blur(2px);
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1;
}

.modal-content {
  background: white;
  border-radius: 12px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 2;
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  padding: 20px 30px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2,
.modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #333;
}

.btn-close,
.modal-close {
  background: none;
  border: none;
  font-size: 32px;
  cursor: pointer;
  color: #999;
  line-height: 1;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.btn-close:hover,
.modal-close:hover {
  color: #ff6b35;
  background: #fff5f0;
  transform: rotate(90deg);
}

.modal-body {
  padding: 30px;
}

/* Loading State */
.loading-state {
  text-align: center;
  padding: 40px;
  color: #666;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #666;
}

.empty-state-icon {
  font-size: 64px;
  margin-bottom: 20px;
}

.empty-state h4 {
  font-size: 20px;
  margin-bottom: 10px;
  color: #333;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 30px;
}

.page-btn {
  padding: 8px 15px;
  border: 2px solid #e0e0e0;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
}

.page-btn:hover {
  border-color: #ff6b35;
  color: #ff6b35;
}

.page-btn.active {
  background: #ff6b35;
  color: white;
  border-color: #ff6b35;
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Message Box */
.message-box {
  position: fixed;
  top: 100px;
  right: 30px;
  max-width: 400px;
  padding: 15px 20px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  z-index: 2000;
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

.message-box.success {
  background: #d4edda;
  color: #155724;
  border-left: 4px solid #28a745;
}

.message-box.error {
  background: #f8d7da;
  color: #721c24;
  border-left: 4px solid #dc3545;
}

.message-box.info {
  background: #d1ecf1;
  color: #0c5460;
  border-left: 4px solid #17a2b8;
}

/* Responsive */

/* iPad Specific Styles (769px to 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  body {
    overflow-x: clip;
  }

  .dashboard-header {
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .header-content {
    max-width: 100%;
    padding: 15px 20px;
    flex-wrap: nowrap;
  }

  .logo {
    height: 45px;
  }

  .logo-section h1 {
    font-size: 18px;
  }

  .user-section {
    gap: 15px;
    flex-wrap: nowrap;
  }

  .user-name {
    font-size: 14px;
  }

  .btn-logout {
    padding: 6px 16px;
    font-size: 13px;
  }

  .dashboard-container {
    max-width: 100%;
    grid-template-columns: 200px 1fr !important;
    gap: 20px;
    padding: 20px;
  }

  .sidebar {
    display: block !important;
    position: sticky !important;
    top: 80px;
    padding: 16px;
  }

  .sidebar-nav {
    flex-direction: column !important;
    overflow-x: visible !important;
    gap: 4px;
  }

  .nav-item {
    white-space: normal !important;
    padding: 10px 12px;
    font-size: 14px;
  }

  .nav-item .icon {
    font-size: 18px;
  }

  .main-content {
    padding: 24px;
    overflow-x: hidden;
  }

  .content-tab h2 {
    font-size: 22px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-value {
    font-size: 24px;
  }

  .stat-label {
    font-size: 13px;
  }

  .branches-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .order-card {
    padding: 16px;
  }

  .order-details {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .profile-form {
    max-width: 100%;
  }
}

@media (max-width: 1024px) {
  .dashboard-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .sidebar {
    position: static;
  }

  .sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
  }

  .nav-item {
    white-space: nowrap;
  }
}

@media (max-width: 768px) {
  /* Header - Compact Mobile Layout */
  .header-content {
    padding: 10px 15px;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .logo-section {
    gap: 8px;
  }

  .logo {
    height: 35px;
  }

  .logo-section h1 {
    font-size: 16px;
  }

  .user-section {
    gap: 8px;
  }

  .user-name {
    display: none;
  }

  .btn-logout {
    padding: 8px 16px;
    font-size: 14px;
  }

  /* Dashboard Container - Single Column */
  .dashboard-container {
    grid-template-columns: 1fr;
    padding: 0;
    gap: 0;
  }

  /* Sidebar - Horizontal Scrollable Tabs */
  .sidebar {
    position: sticky;
    top: 60px;
    z-index: 90;
    border-radius: 0;
    padding: 10px 15px;
    margin: 0;
    overflow-x: auto;
    overflow-y: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    -webkit-overflow-scrolling: touch;
  }

  .sidebar-nav {
    flex-direction: row;
    gap: 8px;
    white-space: nowrap;
  }

  .nav-item {
    flex-shrink: 0;
    padding: 10px 16px;
    font-size: 13px;
    border-radius: 20px;
    min-width: auto;
  }

  .nav-item span:last-child {
    display: inline;
  }

  .nav-item .icon {
    font-size: 16px;
  }

  .nav-item-shop {
    margin-bottom: 0;
  }

  /* Main Content */
  .main-content {
    padding: 20px 15px;
    border-radius: 0;
    box-shadow: none;
  }

  .content-tab h2 {
    font-size: 20px;
    margin-bottom: 20px;
  }

  /* Stats Grid - 2 Columns on Mobile */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .stat-card {
    padding: 15px;
  }

  .stat-icon {
    font-size: 28px;
    margin-bottom: 8px;
  }

  .stat-label {
    font-size: 11px;
  }

  .stat-value {
    font-size: 20px;
  }

  /* Tab Header */
  .tab-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  /* Order Details */
  .order-details {
    grid-template-columns: 1fr;
  }

  /* Order Actions */
  .order-actions {
    flex-direction: column;
    gap: 8px;
  }

  .btn-order-action {
    width: 100%;
  }
}

/* ========================================
   BRANCH MANAGEMENT STYLES
   ======================================== */

/* Branches List */
.branches-list {
  display: grid;
  gap: 1.5rem;
  margin-top: 2rem;
}

.branch-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  transition: all 0.3s ease;
}

.branch-card:hover {
  border-color: #ff6b35;
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.1);
}

.branch-info h4 {
  font-size: 1.25rem;
  color: #1f2937;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.branch-manager {
  font-size: 0.95rem;
  color: #4b5563;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.branch-contact {
  font-size: 0.9rem;
  color: #6b7280;
  margin-bottom: 0.25rem;
}

.branch-date {
  font-size: 0.85rem;
  color: #9ca3af;
  margin-top: 0.75rem;
  font-style: italic;
}

.branch-actions {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-danger {
  background: #dc2626;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.btn-danger:hover {
  background: #b91c1c;
}

/* Empty and Error States */
.empty-state,
.error-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: #6b7280;
  background: #f9fafb;
  border-radius: 12px;
  border: 2px dashed #e5e7eb;
}

.error-state {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

/* Tab Header with Button */
.tab-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.tab-header h2 {
  margin: 0;
}

/* Branch Modal Styling */
#branch-modal .modal-content {
  max-width: 600px;
}

#branch-modal .form-group {
  margin-bottom: 1.25rem;
}

#branch-modal .form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

#branch-modal .btn-secondary,
#branch-modal .btn-primary {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

#branch-modal .btn-secondary {
  background: #f3f4f6;
  color: #4b5563;
  border: 1px solid #d1d5db;
}

#branch-modal .btn-secondary:hover {
  background: #e5e7eb;
}

#branch-modal .btn-primary {
  background: #ff6b35;
  color: white;
  border: none;
}

#branch-modal .btn-primary:hover {
  background: #e55a28;
}

#branch-modal .btn-primary:disabled {
  background: #fca785;
  cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
  .branch-card {
    flex-direction: column;
    gap: 1rem;
  }

  .branch-actions {
    width: 100%;
  }

  .branch-actions button {
    flex: 1;
  }

  .tab-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .tab-header button {
    width: 100%;
  }
}

/* Branch Orders Modal Styles */
.branch-order-item {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 15px;
  transition: box-shadow 0.2s;
}

.branch-order-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.branch-order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0f0f0;
}

.branch-order-header strong {
  font-size: 1.1em;
  color: #333;
  margin-right: 10px;
}

.branch-order-date {
  color: #666;
  font-size: 0.9em;
}

.branch-order-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  color: #666;
}

.branch-order-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.9em;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.btn-primary.btn-sm {
  background: #ff6b35;
  color: white;
}

.btn-primary.btn-sm:hover {
  background: #e55a2b;
  transform: translateY(-1px);
}

.btn-secondary.btn-sm {
  background: #f0f0f0;
  color: #333;
}

.btn-secondary.btn-sm:hover {
  background: #e0e0e0;
}

.order-status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.85em;
  font-weight: 500;
  text-transform: capitalize;
}

.order-status.status-pending,
.order-status.status-processing {
  background: #fff3cd;
  color: #856404;
}

.order-status.status-shipped {
  background: #cce5ff;
  color: #004085;
}

.order-status.status-delivered {
  background: #d4edda;
  color: #155724;
}

.order-status.status-cancelled {
  background: #f8d7da;
  color: #721c24;
}

/* Empty state for branch orders */
.branch-orders-container .empty-state {
  text-align: center;
  padding: 40px;
  color: #999;
  font-size: 1.1em;
}

/* Password Reset Modal Specific Styles */
.reset-password-info {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  padding: 20px;
  border-radius: 8px;
  border-left: 4px solid #f59e0b;
  margin-bottom: 25px;
}

.reset-password-info .info-text {
  font-size: 16px;
  color: #333;
  margin-bottom: 8px;
}

.reset-password-info .info-text strong {
  color: #f97316;
  font-weight: 700;
}

.reset-password-info .info-subtext {
  font-size: 14px;
  color: #666;
  margin: 0;
}

/* Password Strength Indicator */
.password-strength-indicator {
  margin: 20px 0;
  padding: 15px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.strength-bar {
  width: 100%;
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}

.strength-bar-fill {
  height: 100%;
  transition: width 0.3s ease, background-color 0.3s ease;
  border-radius: 4px;
  width: 0;
}

.strength-text {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  text-align: center;
}

/* Form actions in password reset modal */
#password-reset-modal .form-actions {
  display: flex;
  gap: 12px;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
}

#password-reset-modal .form-actions button {
  flex: 1;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.3s ease;
}

#password-reset-modal .btn-warning {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.3);
}

#password-reset-modal .btn-warning:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.4);
}

#password-reset-modal .btn-warning:disabled {
  background: #d1d5db;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ========================================
   CREDITS SECTION
   ======================================== */

.stat-card-highlight {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.stat-card-highlight .stat-label {
  color: rgba(255, 255, 255, 0.9);
}

.stat-card-highlight .stat-value {
  color: white;
}

.credit-summary-card {
  background: white;
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.credit-summary-content {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
}

.credit-icon {
  font-size: 48px;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
}

.credit-info {
  flex: 1;
}

.credit-label {
  font-size: 14px;
  color: #666;
  margin-bottom: 4px;
}

.credit-amount {
  font-size: 36px;
  font-weight: bold;
  color: #667eea;
}

.credit-description {
  color: #666;
  font-size: 14px;
  margin: 0;
}

.credits-history {
  background: white;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.credits-history h3 {
  margin-bottom: 20px;
  color: #333;
}

.credits-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.credit-item {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  border-left: 4px solid #667eea;
}

.credit-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.credit-type-badge {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-success {
  background: #d4edda;
  color: #155724;
}

.badge-warning {
  background: #fff3cd;
  color: #856404;
}

.badge-info {
  background: #d1ecf1;
  color: #0c5460;
}

.badge-danger {
  background: #f8d7da;
  color: #721c24;
}

.badge-secondary {
  background: #e2e3e5;
  color: #383d41;
}

.credit-date {
  font-size: 13px;
  color: #666;
}

.credit-item-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.credit-reason {
  color: #333;
  font-size: 14px;
}

.credit-amounts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.credit-amount-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.credit-amount-item .label {
  font-size: 12px;
  color: #666;
}

.credit-amount-item .value {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.credit-amount-item .value.highlight {
  color: #667eea;
  font-size: 18px;
}

.credit-expires {
  font-size: 12px;
  color: #666;
  font-style: italic;
}

.empty-state,
.loading-state,
.error-state {
  text-align: center;
  padding: 40px;
  color: #666;
}

/* Branch Credit Distribution Section */
.branch-credit-section {
  background: white;
  border-radius: 12px;
  padding: 30px;
  margin-top: 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.branch-credit-section h3 {
  font-size: 20px;
  color: #333;
  margin-bottom: 25px;
  font-weight: 600;
}

.branches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
}

.branch-credit-card {
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 24px;
  transition: all 0.3s ease;
}

.branch-credit-card:hover {
  border-color: #667eea;
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.15);
  transform: translateY(-3px);
}

.branch-credit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid #e0e0e0;
}

.branch-credit-header h4 {
  font-size: 18px;
  color: #333;
  margin: 0;
  font-weight: 600;
}

.branch-credit-balance {
  font-size: 24px;
  font-weight: 700;
  color: #667eea;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.branch-credit-form {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.credit-amount-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 15px;
  transition: all 0.3s ease;
  font-family: inherit;
}

.credit-amount-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.credit-amount-input::placeholder {
  color: #999;
}

.btn-distribute {
  padding: 12px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.btn-distribute:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.btn-distribute:active {
  transform: translateY(0);
}

.branch-credit-hint {
  font-size: 13px;
  color: #666;
  background: #f0f4ff;
  padding: 10px 14px;
  border-radius: 6px;
  border-left: 3px solid #667eea;
}

/* Responsive */
@media (max-width: 768px) {
  .credit-summary-content {
    flex-direction: column;
    text-align: center;
  }

  .credit-amount {
    font-size: 28px;
  }

  .credit-amounts {
    grid-template-columns: 1fr;
  }

  .branches-grid {
    grid-template-columns: 1fr;
  }

  .branch-credit-form {
    flex-direction: column;
  }

  .btn-distribute {
    width: 100%;
  }
}

/* Credit Distribution Confirmation Modal */
.confirm-credit-info {
  background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 100%);
  padding: 25px;
  border-radius: 12px;
  border-left: 4px solid #667eea;
}

.confirm-text {
  font-size: 16px;
  color: #333;
  margin-bottom: 12px;
  line-height: 1.6;
}

.confirm-text strong {
  color: #667eea;
  font-weight: 700;
  font-size: 18px;
}

.confirm-subtext {
  font-size: 14px;
  color: #666;
  margin: 0;
  line-height: 1.5;
}

#confirm-credit-modal .modal-content {
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Warranty Claims Section */
.warranty-claims-section {
  background: white;
  border-radius: 12px;
  padding: 30px;
  margin-top: 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.warranty-claims-section h3 {
  font-size: 20px;
  color: #333;
  margin-bottom: 25px;
  font-weight: 600;
}

.warranty-claims-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.warranty-claim-item {
  background: linear-gradient(135deg, #fff9f0 0%, #ffffff 100%);
  border: 2px solid #f39c12;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s ease;
}

.warranty-claim-item:hover {
  box-shadow: 0 6px 20px rgba(243, 156, 18, 0.15);
  transform: translateY(-2px);
}

.claim-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 2px solid #f5f5f5;
}

.claim-info strong {
  display: block;
  font-size: 16px;
  color: #333;
  margin-bottom: 5px;
}

.claim-date {
  display: block;
  font-size: 13px;
  color: #999;
}

.claim-amount {
  font-size: 22px;
  font-weight: 700;
  color: #f39c12;
}

.claim-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.claim-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.claim-detail-row .label {
  font-weight: 600;
  color: #666;
  min-width: 80px;
  font-size: 14px;
}

.claim-detail-row .value {
  color: #333;
  font-size: 14px;
  flex: 1;
}

.claim-detail-row .badge {
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

@media (max-width: 768px) {
  .warranty-claims-section {
    padding: 20px;
  }

  .claim-header {
    flex-direction: column;
    gap: 10px;
  }

  .claim-amount {
    font-size: 18px;
  }

  .claim-detail-row {
    flex-direction: column;
    gap: 5px;
  }

  .claim-detail-row .label {
    min-width: auto;
  }
}

/* ========================================
   VAT INVOICES SECTION
   ======================================== */

.vat-invoices-container {
  background: white;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.vat-invoices-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.vat-invoice-card {
  background: linear-gradient(135deg, #fff9f0 0%, #ffffff 100%);
  border: 2px solid #ff6b35;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s ease;
}

.vat-invoice-card:hover {
  box-shadow: 0 6px 20px rgba(255, 107, 53, 0.15);
  transform: translateY(-2px);
}

.vat-invoice-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 2px solid #f5f5f5;
}

.vat-invoice-info h4 {
  font-size: 18px;
  color: #333;
  margin: 0 0 5px 0;
  font-weight: 600;
}

.vat-invoice-date {
  display: block;
  font-size: 13px;
  color: #999;
}

.vat-invoice-amount {
  font-size: 24px;
  font-weight: 700;
  color: #ff6b35;
}

.vat-invoice-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 15px;
}

.vat-invoice-detail-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vat-invoice-detail-row .label {
  font-weight: 600;
  color: #666;
  min-width: 100px;
  font-size: 14px;
}

.vat-invoice-detail-row .value {
  color: #333;
  font-size: 14px;
  flex: 1;
}

.vat-invoice-detail-row .badge {
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.vat-invoice-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #f5f5f5;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 14px;
}

.info-text {
  font-size: 14px;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .vat-invoices-container {
    padding: 20px;
  }

  .vat-invoice-header {
    flex-direction: column;
    gap: 10px;
  }

  .vat-invoice-amount {
    font-size: 20px;
  }

  .vat-invoice-detail-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .vat-invoice-detail-row .label {
    min-width: auto;
  }
}
