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

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  padding-bottom: 100px;
  display: flex;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: var(--tracking-normal);
}

/* ===== HEADER ===== */
.app-header {
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 10px 16px;
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 0.5px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transform: translateZ(0);
  will-change: transform;
}

@media (max-width: 767px) {
  .icon-sidebar { display: none !important; }
  .app-header {
    left: 0;
    justify-content: center;
  }
  .app-header img {
    margin: 0 auto;
  }
}

.page {
  padding-top: calc(56px + env(safe-area-inset-top, 0px));
}

#page-ai {
  padding-top: 0 !important;
  height: calc(100vh - 56px - env(safe-area-inset-top, 0px));
  overflow: hidden;
  margin-top: calc(56px + env(safe-area-inset-top, 0px));
}

.app-header img {
  height: 34px;
}

.app-header .date {
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== PAGE ===== */
.page { display: none; }
.page.active { display: block; }

/* ===== PERIOD SELECTOR ===== */
.period-selector {
  display: none;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255,255,255,0.92);
  overflow-x: auto;
  white-space: nowrap;
  border-bottom: 0.5px solid var(--border);
  position: fixed;
  transform: translateZ(0);
  top: calc(56px + env(safe-area-inset-top, 0px));
  left: 72px;
  right: 0;
  z-index: 99;
}

@media (max-width: 767px) {
  .period-selector {
    left: 0;
    top: calc(56px + env(safe-area-inset-top, 0px));
  }
}

.page.has-period {
  padding-top: calc(104px + env(safe-area-inset-top, 0px));
}

.period-btn {
  padding: 6px 14px;
  border: 0.5px solid var(--border-md);
  border-radius: var(--radius-pill);
  background: var(--bg-card-solid);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background var(--duration-fast) var(--ease-default), color var(--duration-fast) var(--ease-default), border-color var(--duration-fast) var(--ease-default);
  white-space: nowrap;
}

.period-btn:hover {
  background: var(--bg-hover);
}

.period-btn.active {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border-color: var(--btn-primary-bg);
}

/* ===== LOADING / ERROR ===== */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 14px;
}

.stale-banner {
  background: var(--warning-bg);
  border-left: 3px solid var(--warning);
  padding: 8px 15px;
  font-size: 12px;
  color: var(--warning-text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.error-msg {
  text-align: center;
  padding: 40px;
  color: var(--danger);
  font-size: 14px;
}

/* ===== METRICS GRID ===== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 12px 15px;
}

.metric-card {
  background: var(--bg-card);
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 0.5px solid var(--border);
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--duration-fast) var(--ease-default);
}

.metric-card:hover {
  box-shadow: var(--shadow-sm);
}

.metric-card .label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.metric-card .value {
  font-size: 28px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: var(--tracking-tight);
}

.metric-card .subtext {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}

.metric-card .subtext-amount {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
  font-weight: 500;
}

/* ===== SECTION ===== */
.section {
  padding: 12px 15px;
}

.section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: var(--tracking-normal);
}

/* ===== SIGNAL CARDS ===== */
.signal-card {
  background: var(--bg-card);
  padding: 12px 15px;
  border-radius: var(--radius-lg);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 0.5px solid var(--border);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: box-shadow var(--duration-fast) var(--ease-default);
}

.signal-card:hover { box-shadow: var(--shadow-md); }
.signal-card.alert { background: var(--danger-bg); border-left: 3px solid var(--danger); }
.signal-card.warning { background: var(--warning-bg); border-left: 3px solid var(--warning); }

.signal-card .sig-title { font-size: 13px; color: var(--text-primary); font-weight: 500; }
.signal-card .sig-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.signal-card .sig-count { font-size: 28px; font-weight: 600; color: var(--danger); letter-spacing: var(--tracking-tight); }
.signal-card.warning .sig-count { color: var(--warning); }

/* ===== PRODUCTION GRID ===== */
.production-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.production-card {
  background: var(--bg-card);
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 0.5px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.production-card.clickable { cursor: pointer; transition: box-shadow var(--duration-fast) var(--ease-default); }
.production-card.clickable:hover { box-shadow: var(--shadow-md); }

.production-card .label { font-size: 11px; color: var(--text-muted); margin-bottom: 6px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.02em; }
.production-card .value { font-size: 30px; font-weight: 600; color: var(--text-primary); letter-spacing: var(--tracking-tight); }

/* ===== CHART SECTION ===== */
.chart-section {
  background: var(--bg-card);
  margin: 0 15px 15px;
  border-radius: var(--radius-lg);
  padding: 16px;
  border: 0.5px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.chart-selector {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  overflow-x: auto;
}

.chart-btn {
  padding: 6px 14px;
  border: 0.5px solid var(--border-md);
  border-radius: var(--radius-pill);
  background: var(--bg-card-solid);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: background var(--duration-fast) var(--ease-default), color var(--duration-fast) var(--ease-default), border-color var(--duration-fast) var(--ease-default);
}

.chart-btn.active { background: var(--btn-primary-bg); color: var(--btn-primary-text); border-color: var(--btn-primary-bg); }

/* ===== ORDER LIST (modal) ===== */
.order-item {
  background: var(--bg-primary);
  padding: 12px;
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  border-left: 3px solid var(--danger);
}

.order-item.warning { border-left-color: var(--warning); }

.order-item .order-id { font-weight: 600; color: var(--text-primary); margin-bottom: 4px; font-size: 13px; }
.order-item .order-detail { font-size: 12px; color: var(--text-secondary); margin-bottom: 3px; }

.order-link {
  display: inline-block;
  margin-top: 8px;
  padding: 5px 12px;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
}

/* ===== MODAL ===== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1000;
  overflow-y: auto;
  padding: 40px 16px;
  box-sizing: border-box;
}

.modal.active { display: block; }

.modal-content {
  background: var(--bg-card-solid);
  margin: 0 auto;
  padding: 24px;
  border-radius: var(--radius-xl);
  max-width: 500px;
  width: 100%;
  box-sizing: border-box;
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
}

@media (max-width: 600px) {
  .modal-content {
    padding: 16px;
    border-radius: var(--radius-lg);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-header h3 { font-size: 17px; font-weight: 600; color: var(--text-primary); letter-spacing: var(--tracking-normal); }

.modal-close {
  background: var(--bg-active);
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-round);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--duration-fast) var(--ease-default);
}

.modal-close:hover { background: var(--border-strong); }

/* ===== TABLES ===== */
.orders-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 0.5px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.orders-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card-solid);
  font-size: 13px;
}

.orders-table thead tr {
  border-bottom: 0.5px solid var(--border-md);
}

.orders-table th {
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  background: var(--bg-primary);
}

.orders-table td {
  padding: 10px 12px;
  border-bottom: 0.5px solid var(--border);
  vertical-align: middle;
  color: var(--text-primary);
}

.orders-table tr:hover td {
  background: var(--bg-hover);
}

.orders-table tr:last-child td {
  border-bottom: none;
}

.orders-cards-mobile { display: none; }

@media (max-width: 767px) {
  .orders-table-wrap { display: none; }
  .orders-cards-mobile { display: block; }
}

/* ===== BADGES ===== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.badge-overdue { background: var(--badge-red-bg); color: var(--badge-red-text); }
.badge-today { background: var(--badge-gold-bg); color: var(--badge-gold-text); }
.badge-ok { background: var(--badge-green-bg); color: var(--badge-green-text); }
.badge-new { background: var(--badge-blue-bg); color: var(--badge-blue-text); }
.badge-production { background: var(--badge-gold-bg); color: var(--badge-gold-text); }
.badge-done { background: var(--badge-green-bg); color: var(--badge-green-text); }
.badge-shipped { background: var(--badge-gray-bg); color: var(--badge-gray-text); }

/* ===== PLACEHOLDER ===== */
.placeholder {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-placeholder);
}

.placeholder .icon { font-size: 60px; margin-bottom: 16px; }
.placeholder p { font-size: 14px; }

/* ===== MOBILE SIDEBAR (hamburger) ===== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 300;
}
.sidebar-overlay.open { display: block; }

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100%;
  background: var(--bg-card-solid);
  z-index: 301;
  transform: translateX(-100%);
  transition: transform 0.25s var(--ease-default);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  will-change: transform;
  padding-top: env(safe-area-inset-top, 0px);
}
.sidebar.open { transform: translateX(0); }

.sidebar-header {
  padding: 20px 20px 12px;
  border-bottom: 0.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.sidebar-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-round);
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
  font-weight: 600;
}

.sidebar-name { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.sidebar-role { font-size: 11px; color: var(--text-muted); }

.sidebar-close {
  width: 28px; height: 28px;
  border: none; background: var(--bg-active);
  border-radius: var(--radius-round); cursor: pointer;
  font-size: 14px; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
}

.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }

.sidebar-section {
  padding: 12px 16px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 0;
  transition: background var(--duration-fast) var(--ease-default), color var(--duration-fast) var(--ease-default);
}
.sidebar-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.sidebar-item.active { color: var(--accent); background: var(--accent-light); }
.sidebar-item .s-icon { font-size: 20px; width: 28px; text-align: center; }

.mob-icon {
  width: 32px;
  height: 32px;
  background: var(--accent-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 12px 20px;
  border-top: 0.5px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

/* ===== ICON SIDEBAR (desktop) ===== */
.icon-sidebar {
  width: 72px !important;
  min-width: 72px !important;
  height: 100vh;
  background: rgba(255,255,255,0.94);
  border-right: 0.5px solid var(--border);
  display: flex !important;
  flex-direction: column;
  align-items: center;
  padding: 0;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  flex-shrink: 0;
  overflow: visible;
  transform: translateZ(0);
}

.icon-sidebar-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 8px 0;
  overflow-y: auto;
  gap: 2px;
}

.isb-logo {
  padding: 12px 0 8px;
  display: flex;
  justify-content: center;
  width: 100%;
}

.isb-logo img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.isb-item {
  width: 100%;
  position: relative;
}

.isb-btn {
  width: calc(100% - 12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 4px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-lg);
  transition: background var(--duration-fast) var(--ease-default);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
  text-decoration: none;
  margin: 0 6px;
}

.isb-btn:hover {
  background: var(--bg-hover);
  color: var(--accent);
}

.isb-btn.active {
  background: var(--accent-light);
  color: var(--accent);
}

.isb-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: transparent;
  transition: background var(--duration-fast) var(--ease-default);
}

.isb-btn.active .isb-icon {
  background: var(--accent-light);
}

.isb-btn:hover .isb-icon {
  background: var(--bg-hover);
}

.isb-label {
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  display: block !important;
  color: inherit;
}

.isb-submenu { display: none !important; }
.isb-spacer { flex: 1; }

.isb-user-info {
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.isb-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-round);
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  border: 1.5px solid var(--border-md);
}

/* ===== DESKTOP LAYOUT ===== */
@media (min-width: 768px) {
  .sidebar-overlay { display: none !important; }
  .sidebar-toggle { display: none !important; }
  .sidebar-close { display: none !important; }
  .sidebar { display: none !important; }
  .icon-sidebar { display: flex !important; }
  .app-header { left: 72px !important; padding-left: 16px !important; }
  .page { margin-left: 72px !important; }
}

@media (max-width: 767px) {
  .icon-sidebar { display: none !important; }
  .app-header { left: 0 !important; }
  .main-content { margin-left: 0 !important; }
  .page { margin-left: 0 !important; }
  #page-ai { height: calc(100vh - 56px - env(safe-area-inset-top, 0px)) !important; margin-top: calc(56px + env(safe-area-inset-top, 0px)) !important; }

  .sidebar-header {
    padding: 16px 20px;
    justify-content: space-between;
  }
  .sidebar-user { gap: 10px; }
  .sidebar-name, .sidebar-role, .sidebar-section { opacity: 1 !important; white-space: normal; }
  .sidebar-item {
    padding: 11px 20px;
    justify-content: flex-start;
  }
  .sidebar-item span { opacity: 1 !important; width: auto !important; overflow: visible !important; }
  .sidebar-icon { font-size: 22px; flex-shrink: 0; }
  .app-header {
    padding-left: 16px !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(255,255,255,0.96);
  }
}

/* Sidebar toggle */
.sidebar-toggle {
  position: relative;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  color: var(--text-primary);
}
.sidebar-toggle.visible { display: flex; }

@media (max-width: 767px) {
  .sidebar-toggle { display: flex !important; }
}

/* ===== ISB FLOATING POPUP ===== */
.isb-dropdown {
  display: none;
  position: fixed;
  left: 72px;
  top: 0;
  z-index: 9999;
  background: var(--bg-card-solid);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  padding: 8px 0;
  flex-direction: column;
}
.isb-dropdown.open {
  display: flex;
}
.isb-dropdown-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 6px 16px 8px;
  border-bottom: 0.5px solid var(--border);
  margin-bottom: 4px;
}
.isb-drop-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: left;
  width: 100%;
  border-radius: 0;
  transition: background var(--duration-fast) var(--ease-default), color var(--duration-fast) var(--ease-default);
}
.isb-drop-item:hover {
  background: var(--bg-hover);
  color: var(--accent);
}
.isb-drop-item svg {
  flex-shrink: 0;
  opacity: 0.6;
}

/* ===== MOBILE BOTTOM NAV ===== */
.mobile-bottom-nav {
  display: none;
}
@media (max-width: 767px) {
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    left: 12px;
    right: 12px;
    background: rgba(255,255,255,0.96);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-pill);
    z-index: 300;
    box-shadow: var(--shadow-lg);
    padding: 4px 0;
    transform: translateZ(0);
  }
  .mbn-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 4px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 500;
    border-radius: var(--radius-xl);
    transition: color var(--duration-fast) var(--ease-default);
  }
  .mbn-item.active, .mbn-item:active {
    color: var(--accent);
  }
  .mbn-item svg { stroke: currentColor; }
  .mbn-popup {
    display: none;
    position: fixed;
    bottom: 80px;
    left: 12px;
    right: 12px;
    background: var(--bg-card-solid);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    z-index: 400;
    padding: 8px 0;
    flex-direction: column;
  }
  .mbn-popup.open { display: flex; }
  .mbn-popup-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 6px 16px 8px;
    border-bottom: 0.5px solid var(--border);
    margin-bottom: 4px;
  }
  .mbn-popup-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: left;
    width: 100%;
    transition: background var(--duration-fast) var(--ease-default);
  }
  .mbn-popup-item:hover { background: var(--bg-hover); color: var(--accent); }
  .mbn-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 350;
    background: rgba(0,0,0,0.15);
  }
  .mbn-overlay.open { display: block; }
  .main-content { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
}

.main-content {
  flex: 1;
  min-width: 0;
  overflow-x: hidden;
  padding-top: 0;
}

/* ===== TRAINING MOBILE ===== */
@media (max-width: 767px) {
  .training-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ===== AI streaming cursor ===== */
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }
.ai-cursor::after {
  content: '\25CB';
  display: inline-block;
  animation: blink 0.8s infinite;
  color: var(--accent);
  font-size: 12px;
  margin-left: 2px;
}

/* ===== Utility classes ===== */
.u-label { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; font-weight: 500 }
.u-label-sm { font-size: 10px; color: var(--text-muted) }
.u-label-dark { font-size: 11px; color: var(--text-secondary); margin-bottom: 4px }
.u-section-title { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.03em }
.u-section-title-sm { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px }
.u-empty { text-align: center; padding: 20px; color: var(--text-muted) }
.u-empty-sm { text-align: center; color: var(--text-muted); padding: 16px }
.u-card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 12px; border: 0.5px solid var(--border); box-shadow: var(--shadow-xs) }
.u-card-lg { background: var(--bg-card); border-radius: var(--radius-lg); padding: 12px; margin-bottom: 14px; border: 0.5px solid var(--border); box-shadow: var(--shadow-xs) }
.u-card-center { background: var(--bg-card); border-radius: var(--radius-lg); padding: 10px; text-align: center; border: 0.5px solid var(--border); box-shadow: var(--shadow-xs) }
.u-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px }
.u-row-between { display: flex; justify-content: space-between }
.u-input { width: 100%; padding: 10px 12px; border: 0.5px solid var(--border-input); border-radius: var(--radius-md); font-size: 14px; outline: none; background: var(--bg-input); color: var(--text-primary); transition: border-color var(--duration-fast) var(--ease-default) }
.u-input:focus { border-color: var(--accent) }
.u-input-sm { width: 100%; border: 0.5px solid var(--border-input); border-radius: var(--radius-md); padding: 8px 10px; font-size: 14px; font-weight: 500; box-sizing: border-box; background: var(--bg-input) }
.u-btn-primary { width: 100%; padding: 12px; background: var(--btn-primary-bg); color: var(--btn-primary-text); border: none; border-radius: var(--radius-md); font-size: 14px; font-weight: 600; cursor: pointer; transition: opacity var(--duration-fast) var(--ease-default) }
.u-btn-primary:hover { opacity: 0.85 }
.u-btn-close { border: none; background: none; color: var(--text-muted); cursor: pointer; font-size: 16px; padding: 0 }
.u-success { text-align: center; background: var(--success-bg); border-radius: var(--radius-md); padding: 10px }
.u-warning { text-align: center; background: var(--warning-bg); border-radius: var(--radius-md); padding: 10px }
.u-danger { text-align: center; background: var(--danger-bg); border-radius: var(--radius-md); padding: 10px }
.u-danger-row { background: var(--danger-bg); border-radius: var(--radius-md); padding: 10px; margin-bottom: 6px; border: 0.5px solid #fecaca }
.u-value-green { font-size: 22px; font-weight: 600; color: var(--success-text); letter-spacing: var(--tracking-tight) }
.u-page-wrap { padding: 16px; max-width: 900px; margin: 0 auto }
.u-p4 { padding: 4px }
.u-mb6 { margin-bottom: 6px }
.u-mb8 { margin-bottom: 8px }
.u-mb12 { margin-bottom: 12px }
.u-mb16 { margin-bottom: 16px }
.u-right { text-align: right }
.u-center { text-align: center }

/* Kanban board — desktop */
@media (min-width: 768px) {
  .kanban-board {
    overflow-x: auto !important;
    overflow-y: visible !important;
    scrollbar-width: none !important;
  }
  .kanban-board::-webkit-scrollbar {
    display: none !important;
  }
  .kanban-col {
    overflow-y: visible;
    overflow-x: hidden;
    height: auto;
  }
}

/* ===== Apple-style global overrides ===== */
input, select, textarea, button {
  font-family: var(--font-family);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.25);
}

/* Selection color */
::selection {
  background: var(--accent-light);
  color: var(--text-primary);
}
