/* Delivery City - Main Styles */

/* Base styles */
body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  background: #0f172a;
  color: #e2e8f0;
}

/* Header */
header {
  padding: 16px 20px;
  border-bottom: 1px solid #334155;
  background: #111827;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: nowrap;
  min-height: 56px;
}

#logo, .brand {
  color: #e2e8f0;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.125rem;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  line-height: 1.2 !important;
  padding: 8px 0;
  margin: 0 !important;
}

/* Admin Navigation */
.admin-nav {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-left: 20px;
  flex-wrap: nowrap;
}

.admin-nav .nav-link {
  display: inline-flex;
  align-items: center;
  line-height: 1.2;
  color: #94a3b8;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 6px;
  transition: all 0.2s;
  font-weight: 500;
}

.admin-nav .nav-link:hover {
  color: #e2e8f0;
  background: #1e293b;
  text-decoration: none;
}

.admin-nav .nav-link.active {
  color: #fbbf24;
  background: #1e293b;
}

/* Auth box */
#authbox {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  white-space: nowrap;
}

/* Main content */
main {
  padding: 20px;
}

/* Links */
a {
  color: #38bdf8;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Layout */
.grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Cards */
.card {
  background: #111827;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 16px;
}

.card-orange {
  background: #7c2d12;
  border-color: #f59e0b;
}

.card-green {
  background: #064e3b;
  border-color: #10b981;
}

.card-blue {
  background: #0e3a5b;
  border-color: #38bdf8;
}

/* Buttons */
.btn {
  display: inline-block;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 8px 12px;
  color: #e2e8f0;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
}

.btn:hover {
  background: #0ea5e9;
  border-color: #0284c7;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.danger {
  background: #7f1d1d;
  border-color: #b91c1c;
}

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

/* Text styles */
.muted {
  color: #94a3b8;
}

.error {
  color: #f87171;
}

.ok {
  color: #4ade80;
}

.hl {
  color: #fbbf24;
  font-weight: 700;
}

.hl-green {
  color: #10b981;
  font-weight: 700;
}

.zip {
  color: #fbbf24;
  font-weight: 700;
}

/* Layout helpers */
.row {
  margin: 8px 0;
}

.link {
  display: inline-block;
  margin: 6px 0;
}

.back {
  margin-top: 16px;
  display: inline-block;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 8px;
  margin: 12px 0 16px;
  flex-wrap: wrap;
}

.tab {
  padding: 8px 12px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #111827;
  color: #e2e8f0;
}

.tab.active {
  background: #0ea5e9;
  border-color: #0284c7;
}

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

/* Forms */
.form {
  background: #0b1220;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 16px;
  margin: 12px 0;
}

.form .row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 220px;
}

.form input,
.form select,
.form textarea {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #111827;
  color: #e2e8f0;
  font-family: inherit;
}

.form textarea {
  min-width: 460px;
  min-height: 80px;
}

.input {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #111827;
  color: #e2e8f0;
}

/* Actions */
.actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: nowrap;
}

/* Toolbar */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.toolbar .right {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

/* List rows */
.list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px;
  margin: 4px 0;
  border: 1px solid #334155;
  border-radius: 4px;
  cursor: pointer;
}

.list-row:hover {
  background: #1e293b;
}

/* Dropdowns */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #0b1220;
  border: 1px solid #334155;
  border-radius: 8px;
  z-index: 20;
  max-height: 220px;
  overflow: auto;
  display: none;
}

.dropdown-item {
  padding: 8px 10px;
  border-bottom: 1px solid #1f2937;
  cursor: pointer;
}

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

.dropdown-item:hover {
  background: #1e293b;
}

/* Animations */
@keyframes blink {
  0% { opacity: 1; }
  50% { opacity: 0.6; }
  100% { opacity: 1; }
}

.blink {
  animation: blink 1s linear infinite;
}

/* Catalog specific styles */
.catalog-row {
  display: grid;
  grid-template-columns: minmax(480px, 720px) 120px auto;
  gap: 20px;
  align-items: center;
}

.catalog-name {
  padding-right: 28px;
  overflow-wrap: anywhere;
}

.product-row {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) 120px 280px;
  gap: 16px;
  align-items: center;
}

.catalog-products {
  grid-template-columns: repeat(auto-fill, minmax(1024px, 1fr));
}

.left-pane {
  position: relative;
  z-index: 2;
}

.right-pane {
  position: relative;
  z-index: 1;
  overflow-x: auto;
  max-width: 1280px;
  margin: 0 auto;
}


/* ========================================
   Sidebar Navigation (Admin/Office only)
   ======================================== */

/* Hamburger button */
.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  color: #e2e8f0;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
  margin-right: 12px;
  border-radius: 6px;
  transition: background 0.2s;
}

.menu-toggle:hover {
  background: #1e293b;
}

/* Show menu toggle for admin/office */
body.has-sidebar .menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hide horizontal nav when sidebar is active */
body.has-sidebar .admin-nav {
  display: none !important;
}

/* Hide old brand link when sidebar is active */
body.has-sidebar #logo {
  display: none !important;
}

/* Sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: -280px;
  width: 280px;
  height: 100vh;
  background: #111827;
  border-right: 1px solid #334155;
  z-index: 999;
  transition: left 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar.open {
  left: 0;
}

/* Sidebar header */
.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #334155;
  background: #0f172a;
}

.sidebar-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #fbbf24;
}

.sidebar-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.sidebar-close:hover {
  color: #e2e8f0;
  background: #1e293b;
}

/* Sidebar navigation */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: #94a3b8;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
  color: #e2e8f0;
  background: #1e293b;
  text-decoration: none;
}

.sidebar-nav a.active {
  color: #fbbf24;
  background: #1e293b;
  border-left-color: #fbbf24;
}

.sidebar-nav .nav-icon {
  font-size: 1.25rem;
  width: 24px;
  text-align: center;
}

.sidebar-divider {
  height: 1px;
  background: #334155;
  margin: 12px 20px;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid #334155;
  background: #0f172a;
}

.sidebar-footer .btn-logout {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: #7f1d1d;
  border: 1px solid #b91c1c;
  border-radius: 8px;
  color: #e2e8f0;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.sidebar-footer .btn-logout:hover {
  background: #ef4444;
}

/* Brand text in header (right side) */
.brand-text {
  color: #fbbf24;
  font-weight: 600;
  font-size: 0.95rem;
  margin-right: 8px;
}

