/* ============================================================
   SHOE STORE MANAGEMENT SYSTEM — STYLES
   ============================================================ */
:root {
  --primary: #6366f1;
  --primary-d: #4f46e5;
  --primary-l: #e0e7ff;
  --success: #10b981;
  --success-l: #d1fae5;
  --warning: #f59e0b;
  --warning-l: #fef3c7;
  --danger: #ef4444;
  --danger-l: #fee2e2;
  --pink: #ec4899;
  --pink-l: #fce7f3;
  --dark: #1e1e2e;
  --dark2: #2a2a3e;
  --gray: #6b7280;
  --gray-l: #9ca3af;
  --border: #e5e7eb;
  --bg: #f4f5f8;
  --white: #ffffff;
  --sidebar-w: 210px;
  --radius: 10px;
  --shadow: 0 1px 4px rgba(0,0,0,0.08);
  --shadow-m: 0 4px 20px rgba(0,0,0,0.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body { font-family: -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg); color: #111827; line-height: 1.5; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input, select, textarea { font: inherit; }
table { border-collapse: collapse; width: 100%; }

/* ---- LOGIN ---- */
#login-screen {
  position: fixed; inset: 0; z-index: 1000;
  background: linear-gradient(135deg, #1e1e2e 0%, #2d1b69 50%, #1e1e2e 100%);
  display: flex; align-items: center; justify-content: center;
}
.login-box {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px; padding: 48px 40px; text-align: center;
  backdrop-filter: blur(20px); width: 360px; max-width: 90vw;
}
.login-logo { font-size: 36px; margin-bottom: 8px; }
.login-title { font-size: 22px; font-weight: 600; color: #fff; margin-bottom: 4px; }
.login-sub { font-size: 12px; color: rgba(255,255,255,0.5); margin-bottom: 36px; letter-spacing: 0.1em; }
.login-label { font-size: 12px; color: rgba(255,255,255,0.6); margin-bottom: 16px; }
.login-users { display: flex; gap: 16px; justify-content: center; }
.login-user-btn {
  flex: 1; padding: 18px 12px; border-radius: 14px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
  color: #fff; font-size: 16px; font-weight: 600; transition: all 0.2s;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.login-user-btn:hover { background: var(--primary); border-color: var(--primary);
  transform: translateY(-2px); box-shadow: 0 8px 24px rgba(99,102,241,0.4); }
.login-user-btn .avatar { width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #ec4899);
  display: flex; align-items: center; justify-content: center; font-size: 22px; }
.login-user-btn.chao .avatar { background: linear-gradient(135deg, #10b981, #3b82f6); }

/* ---- LAYOUT ---- */
#app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); background: var(--dark);
  display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0;
  z-index: 100; transition: transform 0.3s ease;
}
.sidebar-logo {
  padding: 24px 20px 16px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo .brand { font-size: 15px; font-weight: 700; color: #fff; }
.sidebar-logo .brand span { color: var(--primary); }
.sidebar-logo .store-tags { display: flex; gap: 6px; margin-top: 6px; }
.sidebar-logo .store-tag {
  font-size: 10px; padding: 2px 8px; border-radius: 100px;
  background: rgba(99,102,241,0.2); color: var(--primary-l); letter-spacing: 0.05em;
}

.sidebar-user {
  padding: 14px 20px; border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-user .user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #ec4899);
  display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0;
}
.sidebar-user.chao .user-avatar { background: linear-gradient(135deg, #10b981, #3b82f6); }
.sidebar-user .user-info .name { font-size: 13px; font-weight: 600; color: #fff; }
.sidebar-user .user-info .role { font-size: 11px; color: rgba(255,255,255,0.4); }
.sidebar-user .logout-btn {
  margin-left: auto; font-size: 18px; color: rgba(255,255,255,0.3);
  transition: color 0.2s; line-height: 1;
}
.sidebar-user .logout-btn:hover { color: var(--danger); }

.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.nav-section { padding: 8px 20px 4px; font-size: 10px; color: rgba(255,255,255,0.3);
  letter-spacing: 0.1em; text-transform: uppercase; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; color: rgba(255,255,255,0.6);
  font-size: 13px; font-weight: 500; transition: all 0.15s; cursor: pointer;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active { background: rgba(99,102,241,0.2); color: var(--primary-l);
  border-right: 3px solid var(--primary); }
.nav-item .icon { font-size: 16px; width: 20px; text-align: center; }

/* ---- MAIN CONTENT ---- */
.main {
  margin-left: var(--sidebar-w); flex: 1;
  display: flex; flex-direction: column; min-height: 100vh;
}
.topbar {
  background: var(--white); border-bottom: 1px solid var(--border);
  padding: 0 24px; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 16px; font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-date { font-size: 12px; color: var(--gray); }
.hamburger { display: none; font-size: 22px; cursor: pointer; }

.page { display: none; padding: 24px; }
.page.active { display: block; }

/* ---- CARDS ---- */
.card { background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--border); }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 14px; font-weight: 700; }
.card-body { padding: 20px; }

/* ---- STAT CARDS ---- */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card {
  background: var(--white); border-radius: var(--radius); padding: 20px;
  border: 1px solid var(--border); box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat-card::after {
  content: ''; position: absolute; right: -20px; top: -20px;
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--accent, var(--primary-l)); opacity: 0.4;
}
.stat-card .label { font-size: 12px; color: var(--gray); margin-bottom: 8px; }
.stat-card .value { font-size: 28px; font-weight: 700; margin-bottom: 4px; }
.stat-card .sub { font-size: 11px; color: var(--gray); }
.stat-card.oneoff { --accent: #e0e7ff; }
.stat-card.moone { --accent: #fce7f3; }
.stat-card.total { --accent: #d1fae5; }
.stat-card.pending { --accent: #fef3c7; }

/* ---- CHARTS ROW ---- */
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.chart-wrap { background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow); padding: 20px; }
.chart-wrap h3 { font-size: 13px; font-weight: 700; margin-bottom: 16px; }
.chart-wrap canvas { max-height: 200px; }

/* ---- DASHBOARD LISTS ---- */
.dash-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dash-list { background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; }
.dash-list .list-header { padding: 14px 18px; border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 700; }
.dash-list .list-item {
  padding: 12px 18px; border-bottom: 1px solid #f3f4f6;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 12px;
}
.dash-list .list-item:last-child { border-bottom: none; }
.dash-list .list-item .main-info { font-weight: 600; }
.dash-list .list-item .sub-info { color: var(--gray); margin-top: 1px; }

/* ---- TOOLBAR ---- */
.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.search-box {
  display: flex; align-items: center; gap: 8px; background: var(--white);
  border: 1px solid var(--border); border-radius: 8px; padding: 0 12px;
  flex: 1; min-width: 200px; max-width: 340px;
}
.search-box input {
  border: none; outline: none; padding: 9px 0; font-size: 13px;
  flex: 1; background: transparent;
}
.search-box .search-icon { color: var(--gray); }

.filter-select {
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px;
  background: var(--white); font-size: 13px; outline: none; color: #374151; cursor: pointer;
}

/* ---- BUTTONS ---- */
.btn {
  padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600;
  transition: all 0.15s; display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); box-shadow: 0 4px 12px rgba(99,102,241,0.4); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { opacity: 0.9; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.9; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: #374151; }
.btn-outline:hover { background: var(--bg); border-color: #9ca3af; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-ghost { background: transparent; color: var(--gray); padding: 5px 8px; border-radius: 6px; }
.btn-ghost:hover { background: var(--bg); color: #374151; }
.btn-icon { width: 30px; height: 30px; padding: 0; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center; font-size: 15px; }

/* ---- TABLE ---- */
.table-wrap {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--border); overflow: hidden; box-shadow: var(--shadow);
}
.table-inner { overflow-x: auto; }
.data-table th, .data-table td {
  padding: 11px 14px; text-align: left; font-size: 12.5px;
  white-space: nowrap;
}
.data-table th {
  background: #f9fafb; font-weight: 700; color: #374151; font-size: 11.5px;
  border-bottom: 1px solid var(--border); text-transform: uppercase; letter-spacing: 0.04em;
}
.data-table tr { border-bottom: 1px solid #f3f4f6; }
.data-table tr:last-child { border-bottom: none; }
.data-table tr:hover { background: #fafafa; }
.data-table .actions { display: flex; gap: 4px; align-items: center; }

/* ---- BADGES ---- */
.badge {
  display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 100px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge-success { background: var(--success-l); color: #065f46; }
.badge-danger { background: var(--danger-l); color: #991b1b; }
.badge-warning { background: var(--warning-l); color: #92400e; }
.badge-purple { background: var(--primary-l); color: #3730a3; }
.badge-pink { background: var(--pink-l); color: #9d174d; }
.badge-gray { background: #f3f4f6; color: #374151; }
.badge-teal { background: #d1fae5; color: #065f46; }

/* ---- PAGINATION ---- */
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 6px;
  padding: 14px 16px; border-top: 1px solid var(--border); }
.pagination .pg-btn {
  width: 30px; height: 30px; border-radius: 6px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); font-size: 12px; font-weight: 600; color: #374151;
  background: var(--white); transition: all 0.15s; cursor: pointer;
}
.pagination .pg-btn:hover { background: var(--primary-l); border-color: var(--primary); color: var(--primary); }
.pagination .pg-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination .pg-info { font-size: 12px; color: var(--gray); margin: 0 6px; }

/* ---- MODALS ---- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px); z-index: 500;
  display: none; align-items: center; justify-content: center; padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--white); border-radius: 16px; width: 100%; max-width: 680px;
  max-height: 90vh; display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25); animation: modalIn 0.2s ease;
}
.modal.modal-sm { max-width: 420px; }
.modal.modal-lg { max-width: 860px; }
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(-8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  padding: 20px 24px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.modal-header h2 { font-size: 16px; font-weight: 700; }
.modal-close { font-size: 22px; color: var(--gray); transition: color 0.15s; line-height: 1; }
.modal-close:hover { color: var(--danger); }
.modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px; flex-shrink: 0; }

/* ---- FORMS ---- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid.col3 { grid-template-columns: 1fr 1fr 1fr; }
.form-full { grid-column: 1 / -1; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: 12px; font-weight: 600; color: #374151; }
.form-group input, .form-group select, .form-group textarea {
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; outline: none; transition: border-color 0.15s; background: var(--white);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.form-group textarea { resize: vertical; min-height: 70px; }
.form-group.required label::after { content: ' *'; color: var(--danger); }
.input-group { display: flex; }
.input-group input { flex: 1; border-radius: 8px 0 0 8px; }
.input-group .input-addon {
  padding: 9px 12px; background: #f9fafb; border: 1px solid var(--border);
  border-left: none; border-radius: 0 8px 8px 0; font-size: 13px; color: var(--gray);
}

/* ---- PROFIT highlight ---- */
.profit-pos { color: var(--success); font-weight: 700; }
.profit-neg { color: var(--danger); font-weight: 700; }

/* ---- INVENTORY LOCATION BADGES ---- */
.loc-1 { background: #f3f4f6; color: #374151; }
.loc-2 { background: #dbeafe; color: #1e40af; }
.loc-3 { background: #fef3c7; color: #92400e; }
.loc-4 { background: #d1fae5; color: #065f46; }
.loc-5 { background: #e0e7ff; color: #3730a3; }
.loc-6 { background: #fce7f3; color: #9d174d; }
.loc-7 { background: #f5f3ff; color: #6d28d9; }

/* ---- CANCEL STATUS CHOICE ---- */
.choice-btn {
  flex: 1; padding: 20px 16px; border-radius: 12px;
  border: 2px solid var(--border); text-align: center; font-size: 14px;
  font-weight: 600; transition: all 0.2s; cursor: pointer; background: var(--white);
}
.choice-btn:hover { border-color: var(--primary); background: var(--primary-l); color: var(--primary-d); }
.choice-btn.selected { border-color: var(--primary); background: var(--primary); color: #fff; }
.choice-btn .icon { font-size: 28px; display: block; margin-bottom: 8px; }

/* ---- TABS ---- */
.tabs { display: flex; gap: 4px; background: #f3f4f6; border-radius: 10px;
  padding: 4px; margin-bottom: 16px; }
.tab-btn { flex: 1; padding: 7px 14px; border-radius: 7px; font-size: 13px; font-weight: 600;
  color: var(--gray); transition: all 0.15s; text-align: center; cursor: pointer; }
.tab-btn.active { background: var(--white); color: var(--primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.1); }

/* ---- EMPTY STATE ---- */
.empty-state { text-align: center; padding: 60px 20px; color: var(--gray); }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ---- TOAST ---- */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  background: var(--dark); color: #fff; padding: 12px 18px; border-radius: 10px;
  font-size: 13px; font-weight: 500; box-shadow: var(--shadow-m);
  display: flex; align-items: center; gap: 10px;
  animation: toastIn 0.3s ease; pointer-events: auto; min-width: 240px;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); color: #1f2937; }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
.toast-out { animation: toastOut 0.3s ease forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }

/* ---- INVENTORY OVERVIEW ---- */
.inv-overview { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.inv-stat { background: #f9fafb; border: 1px solid var(--border); border-radius: 8px; padding: 14px; }
.inv-stat .count { font-size: 24px; font-weight: 700; color: var(--primary); }
.inv-stat .name { font-size: 11px; color: var(--gray); margin-top: 4px; }

/* ---- MOBILE ---- */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-210px); }
  .sidebar.open { transform: translateX(0); width: 210px; }
  .sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 99;
    display: none; }
  .sidebar-overlay.open { display: block; }
  .main { margin-left: 0; }
  .hamburger { display: block; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .charts-grid { grid-template-columns: 1fr; }
  .dash-lists { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid.col3 { grid-template-columns: 1fr 1fr; }
  .inv-overview { grid-template-columns: 1fr 1fr; }
  .page { padding: 16px; }
  .topbar { padding: 0 16px; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .form-grid.col3 { grid-template-columns: 1fr; }
  .modal { border-radius: 12px 12px 0 0; max-height: 95vh; }
  .modal-overlay { align-items: flex-end; padding: 0; }
}

/* ============================================================
   v2 ADDITIONS
   ============================================================ */

/* Clickable badge */
.badge-clickable {
  cursor: pointer; border: none; font: inherit;
  padding: 3px 8px; border-radius: 100px;
  transition: filter 0.15s, transform 0.1s;
}
.badge-clickable:hover { filter: brightness(0.9); transform: scale(1.04); }

/* Status dropdown */
.status-dropdown {
  position: absolute; z-index: 2000;
  background: var(--white); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow-m);
  overflow: hidden; min-width: 130px;
}
.status-dd-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 10px 14px; text-align: left;
  font-size: 12px; border-bottom: 1px solid #f3f4f6;
  transition: background 0.1s; background: none; border-left: none; border-right: none; border-top: none; cursor: pointer;
}
.status-dd-item:last-child { border-bottom: none; }
.status-dd-item:hover { background: var(--bg); }
.outbound-dd .status-dd-item { font-size: 13px; padding: 11px 16px; }

/* Sort icons */
.sortable { cursor: pointer; user-select: none; }
.sortable:hover { background: #f0f0f7 !important; }
.sort-icon { font-size: 10px; margin-left: 3px; color: #c4c4c4; }
.sort-icon.active { color: var(--primary); }

/* Inventory section header */
.inv-section-header {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 18px; font-size: 13px; font-weight: 700;
  background: #f9fafb; border-bottom: 1px solid var(--border);
}
.inv-section-badge {
  background: var(--primary-l); color: var(--primary);
  padding: 2px 8px; border-radius: 100px; font-size: 11px; font-weight: 600;
}

/* Outbound button */
.btn-outbound {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff !important; border: none; font-weight: 700;
}
.btn-outbound:hover { opacity: 0.88; box-shadow: 0 4px 12px rgba(245,158,11,0.4); transform: translateY(-1px); }

/* Multi-step cancel / return modal */
.modal-hint { font-size: 12px; color: var(--gray); margin-bottom: 16px; }
.choice-grid-3 { display: grid; gap: 10px; }
.choice-btn-3 {
  padding: 14px 16px; border-radius: 12px;
  border: 2px solid var(--border); text-align: left;
  font-size: 13px; font-weight: 600; transition: all 0.2s;
  cursor: pointer; background: var(--white);
  display: flex; align-items: center; gap: 12px;
}
.choice-btn-3:hover { border-color: var(--primary); background: var(--primary-l); color: var(--primary-d); }
.choice-btn-3 .choice-icon { font-size: 24px; flex-shrink: 0; }
.choice-desc { font-size: 11px; color: var(--gray); font-weight: 400; margin-top: 3px; }

/* Inventory source buttons in order form */
.inv-src-btn {
  padding: 10px 12px; border-radius: 10px;
  border: 2px solid var(--border); text-align: center;
  font-size: 12px; font-weight: 600; transition: all 0.2s;
  cursor: pointer; background: var(--white); color: #374151;
}
.inv-src-btn:hover { border-color: var(--primary); background: var(--primary-l); color: var(--primary-d); }
.inv-source-chip {
  padding: 8px 12px; border-radius: 8px;
  background: #f0fdf4; border: 1px solid #86efac;
  font-size: 12px; color: #166534; font-weight: 500;
}

/* Inventory selector in procurement */
.inv-selector-list { max-height: 340px; overflow-y: auto; }
.inv-selector-item {
  padding: 13px 18px; border-bottom: 1px solid #f3f4f6;
  cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; transition: background 0.1s;
}
.inv-selector-item:hover { background: var(--bg); }
.inv-selector-item:last-child { border-bottom: none; }
.inv-selector-item.selected { background: var(--primary-l); }

/* Misc helpers */
.cell-ellipsis { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-gray { color: var(--gray); }
.text-xs { font-size: 11px; }
.form-full { grid-column: 1 / -1; }

/* Inventory tabs with count badges inside */
.tabs .badge { pointer-events: none; }

/* ============================================================
   v3 ADDITIONS
   ============================================================ */

/* Clickable order rows */
.order-row { cursor: pointer; }
.order-row:hover { background: #f0f0fb !important; }

/* Date filter button group */
.date-filter-group {
  display: flex; gap: 2px; background: #f3f4f6; border-radius: 8px; padding: 3px;
}
.date-filter-btn {
  padding: 5px 12px; border-radius: 6px; font-size: 12px; font-weight: 600;
  color: var(--gray); background: none; border: none; cursor: pointer; transition: all 0.15s;
  white-space: nowrap;
}
.date-filter-btn.active { background: var(--white); color: var(--primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.1); }
.date-filter-btn:hover:not(.active) { color: #374151; }

/* Column filter panel */
.col-filter-panel {
  position: absolute; z-index: 2000;
  background: var(--white); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow-m);
  min-width: 150px; padding: 6px 0;
}
.col-filter-title {
  padding: 8px 14px 6px; font-size: 11px; font-weight: 700;
  color: var(--gray); text-transform: uppercase; letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border); margin-bottom: 4px;
}
.col-filter-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 14px; font-size: 12px; cursor: pointer; width: 100%;
  transition: background 0.1s;
}
.col-filter-item:hover { background: var(--bg); }
.col-filter-item input[type=checkbox] { accent-color: var(--primary); }

/* Order detail modal */
.detail-header-bar {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}
.detail-order-number {
  font-size: 13px; color: var(--gray); margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.detail-section { margin-bottom: 16px; }
.detail-section-title {
  font-size: 12px; font-weight: 700; color: var(--gray); text-transform: uppercase;
  letter-spacing: 0.06em; margin-bottom: 10px;
}
.detail-grid-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.detail-item { display: flex; flex-direction: column; gap: 3px; }
.detail-label { font-size: 11px; color: var(--gray-l); }
.detail-val { font-size: 13px; font-weight: 500; }

/* Cost breakdown */
.cost-breakdown {
  background: #f9fafb; border-radius: 10px; padding: 14px 16px;
}
.cost-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 5px 0; font-size: 13px;
}
.cost-row.cost-minus { color: var(--gray); }
.cost-row.cost-total { font-weight: 700; font-size: 14px; padding-top: 10px; }
.cost-val { font-weight: 600; }
.cost-divider { border-top: 1px solid var(--border); margin: 6px 0; }
.detail-notes {
  background: var(--warning-l); border-radius: 8px; padding: 10px 14px;
  font-size: 13px; color: #92400e;
}

/* Profit page layout */
.profit-stats-grid { grid-template-columns: repeat(3, 1fr) !important; }
.profit-layout { display: flex; gap: 16px; align-items: flex-start; }
.profit-ranking-panel { width: 260px; flex-shrink: 0; }
.cost-col { color: var(--gray); }
@media (max-width: 900px) {
  .profit-layout { flex-direction: column; }
  .profit-ranking-panel { width: 100% !important; }
}

/* Tracking number button */
.tracking-btn {
  background: var(--primary-l); color: var(--primary-d); border: none;
  border-radius: 6px; padding: 3px 8px; font-size: 11px; font-weight: 600;
  cursor: pointer; transition: all 0.15s; white-space: nowrap; font: inherit;
}
.tracking-btn:hover {
  background: var(--primary); color: #fff;
  box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}
