@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --color-orange: #ff5c00;
  --color-orange-hover: #e04f00;
  --color-orange-glow: rgba(255, 92, 0, 0.15);

  --color-navy: #0e0f12;
  --color-navy-muted: #7c7e85;

  --bg-app-wrapper: radial-gradient(circle at 50% 50%, #e5e5e0 0%, #c8c7c0 100%);
  --bg-dashboard: #e2e1da;
  --bg-card-white: #ffffff;
  --bg-card-sand: #f5eedb;
  --bg-card-sand-dark: #eae5db;
  --bg-sidebar: #0e0f12;

  --font-title: 'Plus Jakarta Sans', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 12px 30px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

body {
  font-family: var(--font-body);
  font-size: 13px;
  background: var(--bg-dashboard);
  color: var(--color-navy);
  min-height: 100vh;
}

.app-frame {
  width: 100%;
  height: 100vh;
  background-color: var(--bg-dashboard);
}

.app-container {
  background-color: var(--bg-dashboard);
  display: flex;
  overflow: hidden;
  height: 100%;
}

.sidebar {
  width: 250px;
  background-color: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  padding: 32px 20px;
  justify-content: space-between;
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 8px;
}

.brand-logo {
  height: 24px;
  width: auto;
  object-fit: contain;
}

.brand-name {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 16px;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: #7c7e85;
  text-decoration: none;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 12px;
  cursor: pointer;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  stroke: #7c7e85;
  fill: none;
}

.nav-item:hover {
  color: #ffffff;
}

.nav-item:hover svg {
  stroke: #ffffff;
}

.nav-item.active {
  background-color: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  position: relative;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 12px;
  bottom: 12px;
  width: 4px;
  background-color: var(--color-orange);
  border-radius: 0 4px 4px 0;
}

.nav-item.active svg {
  stroke: var(--color-orange);
}

.sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.promo-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.02) 100%);
  border-radius: 20px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
  text-align: center;
}

.promo-card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 92, 0, 0.12) 0%, transparent 60%);
  pointer-events: none;
}

.promo-title {
  color: #ffffff;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.promo-desc {
  color: #7c7e85;
  font-size: 10px;
  margin-bottom: 16px;
}

.btn-promo {
  display: inline-block;
  background-color: #ffffff;
  color: #000000;
  padding: 8px 20px;
  border-radius: 20px;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-decoration: none;
}

.btn-promo:hover {
  background-color: var(--color-orange);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(255, 92, 0, 0.25);
}

.user-profile-section {
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 20px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background-color: var(--color-orange);
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  color: #ffffff;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 12px;
}

.user-role {
  color: #7c7e85;
  font-size: 10px;
  font-weight: 500;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.content-header {
  padding: 32px 40px 16px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-welcome {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.welcome-title {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 26px;
  letter-spacing: -0.5px;
}

.welcome-subtitle {
  color: var(--color-navy-muted);
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.btn-round {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--bg-card-white);
  border: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-round svg {
  width: 18px;
  height: 18px;
  stroke: var(--color-navy);
  fill: none;
}

.btn-round:hover {
  background-color: var(--bg-card-sand-dark);
}

.content-body {
  flex: 1;
  padding: 32px 40px 40px 40px;
  overflow-y: auto;
}

.filter-bar {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.search-input {
  padding: 12px 20px;
  border: 1.5px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  outline: none;
  width: 320px;
  font-size: 13px;
  background-color: var(--bg-card-white);
  font-family: var(--font-body);
}

.search-input:focus {
  border-color: var(--color-orange);
  box-shadow: 0 0 0 4px var(--color-orange-glow);
}

.table-container {
  background-color: var(--bg-card-white);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0, 0, 0, 0.02);
}

.ms-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  white-space: nowrap;
  text-align: left;
}

.ms-table th {
  background-color: #fafafa;
  padding: 16px 24px;
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  color: var(--color-navy-muted);
}

.ms-table td {
  padding: 16px 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
  font-size: 13px;
}

.ms-table tbody tr:last-child td {
  border-bottom: none;
}

.ms-table tbody tr {
  cursor: pointer;
}

.ms-table tbody tr:hover {
  background-color: #fafafa;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-title);
  letter-spacing: 0.3px;
}

.badge-gray {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--color-navy);
}

.badge-blue {
  background-color: rgba(37, 99, 235, 0.08);
  color: #2563eb;
}

.badge-orange {
  background-color: rgba(255, 92, 0, 0.08);
  color: var(--color-orange);
}

.badge-green {
  background-color: rgba(22, 163, 74, 0.08);
  color: #16a34a;
}


.btn-action {
  background-color: #000000;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-action:hover {
  background-color: var(--color-orange);
  box-shadow: 0 6px 16px rgba(255, 92, 0, 0.2);
}

.mobile-logo-bar {
  display: none;
}

@media (max-width: 1024px) {
  body {
    padding: 0;
    background: var(--bg-dashboard);
  }

  .app-frame {
    border-radius: 0;
    padding: 0;
    border: none;
    box-shadow: none;
  }

  .app-container {
    flex-direction: column;
    height: auto;
    border-radius: 0;
  }

  .sidebar {
    width: auto;
    height: auto;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(14, 15, 18, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 32px;
    padding: 8px 12px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
  }

  .sidebar-top {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: auto;
  }

  .brand-section {
    display: none;
  }

  .nav-group {
    flex-direction: row;
    gap: 6px;
    align-items: center;
    justify-content: center;
  }

  .nav-item {
    padding: 0;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 0;
  }

  .nav-item span {
    display: none;
  }

  .nav-item.active {
    background-color: rgba(255, 255, 255, 0.12);
    transform: scale(1.08);
  }

  .nav-item svg {
    width: 20px !important;
    height: 20px !important;
    stroke: rgba(255, 255, 255, 0.6) !important;
    margin: 0;
  }

  .nav-item.active svg {
    stroke: var(--color-orange) !important;
  }

  .nav-item.active::before {
    display: none;
  }

  .sidebar-bottom {
    display: none;
  }

  .main-content {
    height: auto;
    overflow: visible;
  }

  .mobile-top-bar {
    display: flex;
    padding: 20px 20px 0 20px;
    width: 100%;
  }

  .mobile-logo-badge {
    background-color: #ffffff;
    border-radius: 18px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1.5px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    width: 100%;
  }

  .mobile-logo-img {
    height: 28px;
    object-fit: contain;
  }

  .mobile-status-tag {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .status-dot-pulsing {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #16a34a;
    position: relative;
  }

  .status-dot-pulsing::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: #16a34a;
    animation: pulseGlow 1.8s infinite ease-in-out;
  }

  .status-text {
    font-family: var(--font-title);
    font-size: 8px;
    font-weight: 800;
    color: #16a34a;
    letter-spacing: 0.8px;
    text-transform: uppercase;
  }

  .content-header {
    padding: 12px 20px 12px 20px;
  }

  .content-header .header-actions {
    display: flex !important;
    width: 100%;
    margin-top: 16px;
    flex-direction: column;
  }
  
  .content-header .header-actions button {
    width: 100%;
  }

  .welcome-title {
    font-size: 20px;
  }

  .content-body {
    padding: 16px 20px 100px 20px;
    overflow: visible;
  }

}

/* Скрытие мобильных элементов на ПК */
.mobile-top-bar {
  display: none;
}

.mobile-logo-img {
  max-width: 120px;
  object-fit: contain;

}

/* --- MOBILE LAYOUT FIXES --- */
@media (max-width: 768px) {
  /* Common app container mobile */
  .app-container {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    padding-bottom: 70px; /* Space for bottom navbar */
  }

  /* Hide left sidebar on mobile */
  .sidebar {
    display: none;
  }

  /* Main content padding on mobile */
  .content-body, .content-header {
    padding: 20px;
  }
  
  .mobile-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background-color: var(--bg-dashboard);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  }
  
  .mobile-logo-badge {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  
  .mobile-status-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: var(--color-navy);
    padding: 4px 10px;
    border-radius: 20px;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.5px;
  }
  
  .status-dot-pulsing {
    width: 6px;
    height: 6px;
    background-color: #10b981;
    border-radius: 50%;
    animation: pulseGlow 2s infinite;
  }
  
  .content-header {
    padding-top: 32px;
  }

  /* Million Dollar Floating Bottom Navbar */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 450px;
    height: 64px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 32px;
    z-index: 1000;
    justify-content: space-between;
    align-items: center;
    padding: 0 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
  }

  .mobile-nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--color-navy-muted);
    text-decoration: none;
    font-size: 13px;
    font-family: var(--font-title);
    font-weight: 700;
    height: 48px;
    border-radius: 24px;
    padding: 0 12px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .mobile-nav-item span {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .mobile-nav-item svg {
    width: 22px;
    height: 22px;
    stroke: var(--color-navy-muted);
    fill: none;
    transition: all 0.3s ease;
  }

  .mobile-nav-item.active {
    background: var(--color-orange);
    color: white;
    padding: 0 20px;
    box-shadow: 0 8px 16px rgba(255, 102, 0, 0.2);
  }

  .mobile-nav-item.active span {
    display: block;
    opacity: 1;
  }

  .mobile-nav-item.active svg {
    stroke: white;
    transform: scale(1.1);
  }

  /* Filter bar inputs */
  .search-input {
    width: 100%;
  }

  /* Table container scroll */
  .table-container {
    overflow-x: auto;
  }
}

/* Hide mobile navbar on desktop */
@media (min-width: 769px) {
  .mobile-bottom-nav {
    display: none;
  }
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background-color: var(--bg-card-white);
  width: 100%;
  max-width: 500px;
  border-radius: 24px;
  padding: 32px;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform 0.3s ease;
  position: relative;
}

.modal-overlay.active .modal-box {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-title {
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 800;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--color-navy-muted);
}

.modal-close:hover {
  color: #000;
}

.form-group-modal {
  margin-bottom: 16px;
}

.form-group-modal label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 14px;
}

.form-group-modal input {
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  font-family: var(--font-body);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 32px;
}

/* --- COMPONENTS MOVED FROM ADMIN.CSS --- */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(14, 15, 18, 0.3);
  backdrop-filter: blur(8px);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
}

.drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.side-drawer {
  position: fixed;
  top: 24px;
  right: 24px;
  bottom: 24px;
  width: 480px;
  background-color: #ffffff;
  box-shadow: var(--shadow-lg);
  border-radius: 24px;
  z-index: 100;
  transform: translateX(120%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.side-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #fafafa;
}

.drawer-title {
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 800;
  color: var(--color-navy);
}

.drawer-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  cursor: pointer;
  font-size: 18px;
  color: var(--color-navy-muted);
}

.drawer-close:hover {
  background-color: #f1f5f9;
  color: var(--color-navy);
}

.drawer-body {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.info-label {
  font-family: var(--font-title);
  font-size: 10px;
  color: var(--color-navy-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.info-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-navy);
}

.order-items-builder {
  border: 1.5px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  margin-bottom: 24px;
  overflow: hidden;
  background-color: var(--bg-card-white);
}

.builder-header {
  background-color: #fafafa;
  padding: 12px 16px;
  font-family: var(--font-title);
  font-weight: 700;
  border-bottom: 1.5px solid rgba(0, 0, 0, 0.06);
}

.builder-row {
  display: grid;
  grid-template-columns: 4fr 1.5fr 1.5fr auto;
  gap: 12px;
  padding: 16px;
  align-items: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.builder-row:last-child {
  border-bottom: none;
}

.btn-icon-delete {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: none;
  border: 1.5px solid rgba(0, 0, 0, 0.06);
  color: #ef4444;
  cursor: pointer;
  font-weight: bold;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-delete:hover {
  background-color: #fef2f2;
  border-color: #fca5a5;
}

.builder-add-row {
  padding: 12px 16px;
  background-color: #fafafa;
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.link-add-item {
  color: var(--color-orange);
  text-decoration: none;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
}

.link-add-item:hover {
  color: var(--color-orange-hover);
}

@media (max-width: 1024px) {
  .side-drawer {
    width: 100%;
    right: 0;
    bottom: 0;
    top: auto;
    height: 75vh;
    border-radius: 24px 24px 0 0;
    transform: translateY(120%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .side-drawer.open {
    transform: translateY(0);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .info-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .builder-row {
    grid-template-columns: 1fr;
    gap: 10px;
    position: relative;
    padding-bottom: 40px;
  }

  .btn-icon-delete {
    position: absolute;
    bottom: 12px;
    right: 12px;
  }
}


/* --- BEAUTIFUL FORM STYLES --- */
.form-input, .form-select {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  font-family: var(--font-body);
  font-size: 14px;
  background-color: #f8fafc;
  transition: all 0.2s ease;
  color: var(--color-navy);
  box-sizing: border-box;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--color-orange);
  background-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(255, 92, 0, 0.1);
}

.form-input::placeholder {
  color: #a1a1aa;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%231e293b%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat, repeat;
  background-position: right .7em top 50%, 0 0;
  background-size: .65em auto, 100%;
}
