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

:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --bg-sidebar: #1a2332;
  --bg-sidebar-hover: #26354a;
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --text-dark: #0f172a;
  --text-light: #64748b;
  --text-white: #ffffff;
  --border-color: #e2e8f0;
  --success: #10b981;
  --error: #ef4444;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --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);
  --transition-speed: 0.3s;
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-body);
  color: var(--text-dark);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  color: var(--text-white);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-speed) ease;
  z-index: 100;
}

.sidebar-brand {
  padding: 24px;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-white);
  text-decoration: none;
}

.sidebar-brand i {
  color: #38bdf8;
}

.sidebar-menu {
  list-style: none;
  padding: 20px 0;
  flex-grow: 1;
  overflow-y: auto;
}

.sidebar-menu-item {
  padding: 2px 16px;
  margin-bottom: 4px;
}

.sidebar-menu-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: #94a3b8;
  text-decoration: none;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.sidebar-menu-link:hover, .sidebar-menu-item.active .sidebar-menu-link {
  color: var(--text-white);
  background-color: var(--primary-color);
}

.sidebar-menu-item.active .sidebar-menu-link {
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.4);
}

.sidebar-menu-link i {
  font-size: 1.1rem;
}

/* Main Content Area */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0; /* Webkit overflow fix */
}

/* Top Navbar */
.navbar {
  height: 70px;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.hamburger-btn {
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--text-dark);
  cursor: pointer;
  display: none;
  padding: 5px;
  border-radius: 4px;
}

.hamburger-btn:hover {
  background-color: var(--bg-body);
}

.navbar-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-dark);
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

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

.user-avatar {
  width: 36px;
  height: 36px;
  background-color: #dbeafe;
  color: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.user-name {
  font-weight: 500;
  color: var(--text-dark);
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: transparent;
  color: var(--error);
  border: 1px solid var(--error);
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.logout-btn:hover {
  background-color: var(--error);
  color: var(--text-white);
}

/* Page Container */
.page-container {
  padding: 24px;
  flex-grow: 1;
  overflow-y: auto;
}

.page-section {
  display: none;
}

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

/* Section Header */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 15px;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dark);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  font-size: 0.9rem;
}

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

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

.btn-secondary {
  background-color: #e2e8f0;
  color: #475569;
}

.btn-secondary:hover {
  background-color: #cbd5e1;
}

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

.btn-danger:hover {
  background-color: #dc2626;
}

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

.btn-success:hover {
  background-color: #059669;
}

/* Filter Controls */
.filter-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  align-items: flex-end;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-weight: 500;
  color: var(--text-light);
  font-size: 0.85rem;
}

.form-control {
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.form-control:focus {
  border-color: var(--primary-color);
}

/* Tables */
.table-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

.table th {
  background-color: #f1f5f9;
  color: #1e293b;
  font-weight: 600;
  padding: 14px 20px;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

.table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
  color: #334155;
  white-space: nowrap;
}

.table tbody tr:nth-child(even) {
  background-color: #f8fafc;
}

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

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

.action-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  font-size: 1rem;
  transition: background-color 0.2s;
}

.action-btn-edit {
  color: var(--primary-color);
}

.action-btn-edit:hover {
  background-color: #dbeafe;
}

.action-btn-delete {
  color: var(--error);
}

.action-btn-delete:hover {
  background-color: #fee2e2;
}

/* Dashboard Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.stat-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-title {
  color: var(--text-light);
  font-weight: 500;
  font-size: 0.9rem;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-dark);
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-icon-users {
  background-color: #e0f2fe;
  color: #0284c7;
}

.stat-icon-kirim {
  background-color: #dcfce7;
  color: #15803d;
}

.stat-icon-tulov {
  background-color: #fef3c7;
  color: #d97706;
}

/* Split Tables Layout */
.split-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 1200px) {
  .split-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.split-col-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.split-col-title i {
  color: var(--primary-color);
}

.table-total-row {
  font-weight: 700;
  background-color: #eff6ff !important;
  color: var(--primary-color);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-overlay.show {
  display: flex;
  opacity: 1;
}

.modal-card {
  background-color: var(--bg-card);
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: translateY(-20px);
  transition: transform 0.25s ease;
}

.modal-overlay.show .modal-card {
  transform: translateY(0);
}

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

.modal-title {
  font-size: 1.2rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-light);
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

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

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background-color: #f8fafc;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Toast System */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 350px;
  width: 100%;
}

.toast {
  padding: 16px 20px;
  border-radius: 10px;
  color: var(--text-white);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s forwards, fadeOut 0.5s 2.7s forwards;
  position: relative;
}

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

.toast-error {
  background-color: var(--error);
}

.toast-icon {
  font-size: 1.2rem;
}

/* Animations */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* Login Page Custom styles */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #eef2f6;
  padding: 20px;
}

.login-card {
  background-color: var(--bg-card);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
}

.login-header {
  background-color: var(--bg-sidebar);
  color: var(--text-white);
  padding: 30px;
  text-align: center;
}

.login-header i {
  font-size: 3rem;
  color: #38bdf8;
  margin-bottom: 15px;
}

.login-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
}

.login-header p {
  color: #94a3b8;
  font-size: 0.9rem;
  margin-top: 5px;
}

.login-body {
  padding: 30px;
}

/* Responsive details */
@media (max-width: 1024px) {
  .hamburger-btn {
    display: block;
  }

  .sidebar {
    position: absolute;
    left: -260px;
    height: 100%;
  }

  .sidebar.show {
    left: 0;
  }

  .sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.4);
    z-index: 99;
    display: none;
  }

  .sidebar-backdrop.show {
    display: block;
  }
}

/* Loading Spinner */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state {
  padding: 40px;
  text-align: center;
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.empty-state i {
  font-size: 3rem;
  color: #cbd5e1;
}

/* Dashboard and Sales Layout Styles */

.stat-icon-sotuv {
  background-color: #dcfce7;
  color: #10b981;
}

.stat-icon-ombor {
  background-color: #e0f2fe;
  color: #3b82f6;
}

.stat-icon-qarz {
  background-color: #fee2e2;
  color: #ef4444;
}

.stat-icon-kam {
  background-color: #fef3c7;
  color: #f59e0b;
}

.dashboard-charts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

@media (min-width: 1024px) {
  .dashboard-charts-grid {
    grid-template-columns: 3fr 2fr;
  }
}

.chart-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.chart-header {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-header i {
  color: var(--primary-color);
}

.chart-container {
  position: relative;
  height: 260px;
  width: 100%;
}

.dashboard-tables-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 1024px) {
  .dashboard-tables-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.critical-badge {
  padding: 4px 8px;
  background-color: #fee2e2;
  color: #ef4444;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.8rem;
}

.table-total-row-sales {
  font-weight: 700;
  background-color: #ecfdf5 !important;
  color: #10b981;
}

.search-container {
  position: relative;
  max-width: 300px;
  width: 100%;
}

.search-input-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
}

.btn-success-green {
  background-color: #10b981;
  color: var(--text-white);
}

.btn-success-green:hover {
  background-color: #059669;
}

/* App Footer styles */
.app-footer {
  margin-top: 45px;
  padding-top: 25px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  color: var(--text-light);
  font-size: 0.9rem;
}

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

.footer-dev-logo {
  width: 42px;
  height: 42px;
  background: #ffffff;
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.footer-dev-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.footer-dev-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.footer-dev-name {
  font-weight: 600;
  color: var(--text-dark);
}

.footer-dev-desc {
  font-size: 0.8rem;
  color: var(--text-light);
}

.footer-contacts {
  display: flex;
  gap: 12px;
}

.footer-contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: #334155;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.88rem;
}

.footer-contact-btn i {
  font-size: 1.05rem;
}

.footer-contact-btn-phone:hover {
  background-color: #eff6ff;
  border-color: #3b82f6;
  color: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.1);
}

.footer-contact-btn-tg:hover {
  background-color: #f0f9ff;
  border-color: #38bdf8;
  color: #0284c7;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(56, 189, 248, 0.1);
}

@media (max-width: 600px) {
  .app-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  
  .footer-contacts {
    width: 100%;
    flex-direction: column;
  }
  
  .footer-contact-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Table responsive smooth scroll on iOS */
.table-responsive {
  -webkit-overflow-scrolling: touch;
}

/* Mobile Responsive Improvements */
@media (max-width: 992px) {
  .split-grid {
    grid-template-columns: 1fr !important;
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .navbar {
    height: 60px;
    padding: 0 16px;
  }
  
  .navbar-title {
    font-size: 1.05rem;
  }
  
  .user-name {
    display: none;
  }
  
  .logout-btn span {
    display: none;
  }
  
  .logout-btn {
    padding: 8px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .logout-btn i {
    margin: 0;
  }
  
  .page-container {
    padding: 16px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

@media (max-width: 576px) {
  .page-container {
    padding: 12px;
  }
  
  .section-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .section-header > div {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }
  
  .section-header .btn {
    width: 100%;
  }
  
  .filter-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }
  
  .filter-grid > div > .btn {
    width: 100%;
  }
  
  .modal-card {
    max-width: 100%;
    border-radius: 12px;
  }
  
  .modal-body {
    padding: 16px;
  }
  
  .modal-header, .modal-footer {
    padding: 12px 16px;
  }
}

@media (max-width: 480px) {
  .login-footer-support {
    flex-direction: column !important;
    gap: 8px !important;
    text-align: center;
  }
  .login-footer-support span:nth-child(3) {
    display: none; /* Hide vertical separator bar */
  }
}


