:root {
  --accent: #078c36;
  --primary: #111827;
  --primary-hover: #0b1220;
}
.badge-status { background: var(--accent); }
.table td, .table th { vertical-align: middle; }

html, body {
  height: 100%;
}

body {
  background: linear-gradient(180deg, #eef3f8 0%, #f8fafc 100%);
  color: #0f172a;
  margin: 0;
}

body.app-body {
  overflow: hidden;
}

.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.app-sidebar {
  width: 280px;
  flex: 0 0 280px;
  background: #111827;
  color: #e5e7eb;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #1f2937;
  height: 100%;
  overflow: hidden;
  min-height: 0;
  overflow-x: hidden;
}

.sidebar-header {
  padding: 14px 12px 6px;
  flex: 0 0 auto;
}

.sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 12px 10px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.sidebar-nav::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.brand {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.sidebar-group {
  margin-bottom: 10px;
}

.sidebar-group + .sidebar-group {
  margin-top: 16px;
}

.sidebar-group-muted {
  opacity: .72;
}

.sidebar-group-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #cbd5e1;
  opacity: .68;
  margin-top: 3px;
  margin-bottom: 2px;
  padding: 0 6px;
}

.sidebar-link,
.sidebar-sublink {
  display: block;
  text-decoration: none;
  color: #d1d5db;
  border-radius: 8px;
  padding: 5px 10px;
  margin-bottom: 2px;
  border-left: 2px solid transparent;
  font-size: 14px;
}

.sidebar-link:hover,
.sidebar-sublink:hover {
  color: #fff;
  background: rgba(255,255,255,.05);
}

.sidebar-link.active,
.sidebar-sublink.active {
  color: #fff;
  border-left-color: #22c55e;
  font-weight: 700;
}

.sidebar-link.active {
  background: transparent;
}

.sidebar-sublink.active {
  background: rgba(34,197,94,.10);
  border-left-color: #22c55e;
}

.sidebar-toggle {
  width: 100%;
  text-align: left;
  background: transparent;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 700;
}

.sidebar-toggle.active-parent {
  color: #e2e8f0;
  background: transparent;
  border-left-color: rgba(34,197,94,.35);
}

.sidebar-chevron {
  font-size: 13px;
  opacity: 1;
  color: #e2e8f0;
  transition: transform .18s ease;
}

.sidebar-toggle[aria-expanded="true"] .sidebar-chevron {
  transform: rotate(180deg);
}

.sidebar-submenu-panel {
  margin: 0 0 2px 0;
}

.sidebar-submenu-panel.is-hidden {
  display: none;
}

.sidebar-sublink {
  margin-left: 26px;
  font-size: 12px;
  color: #b8c2d1;
  opacity: .86;
  padding-top: 4px;
  padding-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
}

.sidebar-sublink.active .sidebar-count {
  background: rgba(34, 197, 94, 0.25);
  color: #dcfce7;
}

.sidebar-footer {
  flex: 0 0 auto;
  padding: 10px 12px 12px;
  border-top: 1px solid #1f2937;
  background: #111827;
}

.sidebar-footer .role {
  font-size: 12px;
  color: #93c5fd;
  margin-bottom: 8px;
}

.tenant-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  opacity: .7;
  margin-bottom: 4px;
}

.tenant-select {
  font-size: 12px;
  background: rgba(255,255,255,.96);
  border-color: #cbd5e1;
}

.tenant-btn {
  font-size: 12px;
  opacity: .9;
}

.app-main {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}

@media (max-width: 992px) {
  body.app-body {
    overflow: auto;
  }
  .app-shell {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }
  .app-sidebar {
    width: 100%;
    flex: 0 0 auto;
    border-right: 0;
    height: auto;
    overflow: visible;
  }
  .sidebar-nav {
    overflow: visible;
    min-height: auto;
    padding-bottom: 0;
  }
  .app-main {
    overflow: visible;
  }
}

/* Global primary action color */
.btn-primary,
.btn-success {
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-success:hover,
.btn-success:focus {
  background-color: var(--primary-hover) !important;
  border-color: var(--primary-hover) !important;
  color: #fff !important;
}

.btn-outline-primary:hover,
.btn-outline-success:hover {
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
}

/* Orders list */
.orders-page {
  background: #f5f7fb;
  border-radius: 14px;
  padding: 18px;
}
.orders-title {
  margin: 0 0 14px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: .01em;
}
.orders-filters {
  display: grid;
  grid-template-columns: 2fr 1fr auto;
  gap: 10px;
  margin-bottom: 14px;
}
.orders-input, .orders-select {
  width: 100%;
  border: 1px solid #d8dee8;
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 15px;
  background: #fff;
}
.orders-btn {
  border: 0;
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 600;
  background: var(--primary, #111827);
  color: #fff;
}
.orders-btn:hover { background: var(--primary-hover, #0b1220); }
.orders-bulk {
  display: flex;
  gap: 8px;
  align-items: center;
  background: #fff;
  border: 1px solid #e6ebf2;
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 12px;
}
.orders-bulk .bulk-check-all {
  margin-right: 4px;
}
.orders-bulk .bulk-select {
  max-width: 240px;
}
.orders-list {
  display: grid;
  gap: 14px;
}
.order-card {
  display: grid;
  grid-template-columns: 28px 180px 1.1fr 1.3fr .8fr 180px;
  gap: 14px;
  background: #fff;
  border: 1px solid #e6ebf2;
  border-radius: 12px;
  padding: 12px;
  align-items: center;
  transition: background .15s ease;
}
.order-card:hover {
  background: #fbfdff;
}
.order-card.problem {
  border-color: #f1d3d3;
  border-left: 4px solid #d92d20;
  background: #fff;
}
.meta-id {
  font-size: 17px;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.1;
}
.meta-date {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}
.badge-src {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 99px;
  background: #ebf0f7;
  color: #334155;
  text-transform: uppercase;
  font-weight: 700;
}
.contact-phone {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}
.contact-email {
  font-size: 13px;
  color: #475569;
  margin-top: 3px;
}
.contact-name {
  font-size: 13px;
  color: #64748b;
  margin-top: 2px;
}
.addr-main {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}
.addr-lines {
  margin-top: 4px;
  font-size: 13px;
  color: #475569;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.addr-line {
  margin-top: 4px;
  font-size: 13px;
  color: #475569;
  display: flex;
  gap: 3px;
  line-height: 1.35;
}
.addr-tag {
  display: inline-block;
  min-width: 16px;
  height: 16px;
  border-radius: 4px;
  text-align: center;
  font-size: 10px;
  font-weight: 800;
  line-height: 16px;
  background: #eef2f7;
  color: #334155;
  margin-top: 1px;
}
.addr-tag-l {
  background: #e6f0ff;
  color: #1e40af;
}
.addr-tag-f {
  background: #f1f5f9;
  color: #334155;
}
.addr-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
  margin: 0 6px 6px 0;
}
.badge-pay-cash { background: #f1f5f9; color: #475569; }
.badge-pay-card { background: #f1f5f9; color: #475569; }
.badge-status-green { background: #e7f7ee; color: #0f7a39; }
.badge-status-yellow { background: #fff8dc; color: #8a6a00; }
.badge-status-red { background: #fde8e8; color: #b42318; }
.actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.btn-action-primary, .btn-action-secondary {
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
}
.btn-action-primary {
  background: var(--primary, #111827);
  color: #fff;
}
.btn-action-primary:hover { background: var(--primary-hover, #0b1220); color: #fff; }
.btn-action-secondary {
  background: #fff;
  color: #334155;
  border: 1px solid #d7dee8;
}
.touch-badge {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 99px;
  background: #eef2ff;
  color: #3730a3;
  font-weight: 700;
}
.orders-empty {
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  padding: 20px;
  color: #64748b;
}
.orders-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  background: #fff;
  border: 1px solid #e6ebf2;
  border-radius: 10px;
  padding: 10px 12px;
}
.orders-pages {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.page-link {
  display: inline-block;
  min-width: 34px;
  text-align: center;
  text-decoration: none;
  padding: 6px 9px;
  border: 1px solid #d7dee8;
  border-radius: 8px;
  color: #334155;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
}
.page-link.active {
  background: var(--primary, #111827);
  border-color: var(--primary, #111827);
  color: #fff;
}
.page-link.disabled {
  pointer-events: none;
  opacity: .45;
}
@media (max-width: 1280px) {
  .order-card {
    grid-template-columns: 28px 160px 1fr 1fr .8fr 170px;
  }
}
@media (max-width: 980px) {
  .orders-filters {
    grid-template-columns: 1fr;
  }
  .order-card {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .actions {
    justify-content: flex-start;
  }
}
