/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f5f5;
  color: #333;
  display: flex;
  min-height: 100vh;
}

a { color: #4a90d9; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Sidebar ===== */
#sidebar {
  width: 240px;
  min-width: 240px;
  background: #1a1a2e;
  color: #ccc;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.brand-name {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
}

.brand-tagline {
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 4px;
}

.nav-links {
  list-style: none;
  padding: 12px 0;
  flex: 1;
}

.nav-links li a {
  display: block;
  padding: 11px 24px;
  color: #aab;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
  border-left: 3px solid transparent;
}

.nav-links li a:hover {
  background: rgba(255,255,255,0.05);
  color: #fff;
  text-decoration: none;
}

.nav-links li a.active {
  background: rgba(74,144,217,0.15);
  color: #4a90d9;
  border-left-color: #4a90d9;
}

/* ===== Main Wrapper ===== */
#main-wrapper {
  margin-left: 240px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#top-bar {
  background: #fff;
  padding: 18px 32px;
  border-bottom: 1px solid #e0e0e0;
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #555;
}
#user-info .user-role { font-size: 11px; }
#user-info .btn { font-size: 12px; padding: 4px 10px; }

#top-bar h1 {
  font-size: 20px;
  font-weight: 600;
  color: #222;
}

#content {
  padding: 28px 32px;
  flex: 1;
  overflow-x: auto;
}

/* ===== Cards ===== */
.metric-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.metric-card {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.metric-card .metric-label {
  font-size: 13px;
  color: #777;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-card .metric-value {
  font-size: 28px;
  font-weight: 700;
  color: #222;
}

.metric-card.alert .metric-value {
  color: #dc3545;
}

/* ===== Section Card ===== */
.section-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  margin-bottom: 24px;
  overflow: hidden;
}

.section-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-card-body {
  padding: 0;
}

.section-card-body.padded {
  padding: 20px;
}

/* ===== Tables ===== */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table th {
  background: #fafafa;
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  color: #555;
  border-bottom: 2px solid #eee;
  white-space: nowrap;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}

table tbody tr:hover {
  background: #f8f9ff;
}

table tbody tr.clickable {
  cursor: pointer;
}

table tbody tr.low-stock {
  background: #fff3cd;
}

table tbody tr.low-stock:hover {
  background: #ffe9a0;
}

table tbody tr.out-of-stock {
  background: #f8d7da;
}

table tbody tr.out-of-stock:hover {
  background: #f1b0b7;
}

table tbody tr.low-margin {
  background: #f8d7da;
}

table tbody tr.low-margin:hover {
  background: #f1b0b7;
}

td.price-lower {
  background: #d4edda;
  color: #155724;
  font-weight: 600;
}

td.price-higher {
  background: #f8d7da;
  color: #721c24;
  font-weight: 600;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  gap: 6px;
  white-space: nowrap;
}

.btn:hover { opacity: 0.88; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: #4a90d9; color: #fff; }
.btn-secondary { background: #e9ecef; color: #555; }
.btn-success { background: #198754; color: #fff; }
.btn-danger { background: #dc3545; color: #fff; }
.btn-warning { background: #fd7e14; color: #fff; }
.btn-info { background: #0dcaf0; color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; }

.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ===== Badges ===== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #fff;
}

/* ===== Forms ===== */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 5px;
}

.form-control {
  width: 100%;
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  background: #fff;
  color: #333;
  transition: border-color 0.15s;
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: #4a90d9;
  box-shadow: 0 0 0 3px rgba(74,144,217,0.15);
}

select.form-control {
  appearance: auto;
}

textarea.form-control {
  resize: vertical;
  min-height: 60px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.form-row .form-group {
  margin-bottom: 0;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.form-check label {
  font-size: 14px;
  color: #555;
  margin: 0;
}

/* ===== Toolbar / Filters ===== */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.toolbar .form-control {
  width: auto;
  min-width: 180px;
}

.toolbar .spacer {
  flex: 1;
}

/* ===== Inline Add Form ===== */
.inline-form {
  padding: 16px 20px;
  background: #fafafa;
  border-top: 1px solid #eee;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.inline-form .form-group {
  margin-bottom: 0;
  flex: 1;
  min-width: 140px;
}

.inline-form .form-group label {
  margin-bottom: 4px;
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  background: #fff;
  border-radius: 8px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 40px rgba(0,0,0,0.25);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid #eee;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #888;
  line-height: 1;
  padding: 0 4px;
}

.modal-close:hover { color: #333; }

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ===== Toast ===== */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: 6px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  animation: toastIn 0.3s ease;
  min-width: 250px;
  max-width: 420px;
}

.toast.toast-success { background: #198754; }
.toast.toast-error { background: #dc3545; }
.toast.toast-info { background: #0d6efd; }

.toast.toast-out {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(40px); }
}

/* ===== Detail Header ===== */
.detail-header {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px 24px;
  margin-bottom: 4px;
}

.detail-field {
  padding: 8px 0;
}

.detail-field .detail-label {
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}

.detail-field .detail-value {
  font-size: 15px;
  font-weight: 500;
  color: #222;
}

/* ===== Status Workflow ===== */
.workflow-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0;
}

/* ===== Loading ===== */
.loading {
  text-align: center;
  padding: 60px 20px;
  color: #888;
  font-size: 15px;
}

.loading::before {
  content: '';
  display: block;
  width: 32px;
  height: 32px;
  border: 3px solid #e0e0e0;
  border-top-color: #4a90d9;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: #999;
}

.empty-state p {
  font-size: 15px;
}

/* ===== Misc ===== */
.text-muted { color: #888; }
.text-sm { font-size: 12px; }
.text-danger { color: #dc3545; }
.text-success { color: #198754; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.quantity-positive { color: #198754; font-weight: 600; }
.quantity-negative { color: #dc3545; font-weight: 600; }

/* ===== Nav Sections ===== */
.nav-section {
  padding: 12px 24px 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #556;
  list-style: none;
}

/* ===== Priority Badges ===== */
.priority-urgent { background: #dc3545; }
.priority-high { background: #fd7e14; }
.priority-normal { background: #4a90d9; }
.priority-low { background: #6c757d; }

/* ===== Star Rating ===== */
.stars { color: #ffc107; font-size: 16px; letter-spacing: 1px; }
.stars .empty { color: #d0d0d0; }

/* ===== Bar Charts ===== */
.bar-chart { display: flex; flex-direction: column; gap: 4px; }
.bar-row { display: flex; align-items: center; gap: 8px; height: 22px; }
.bar-label { width: 70px; font-size: 11px; text-align: right; color: #666; flex-shrink: 0; }
.bar-track { flex: 1; height: 16px; background: #f0f0f0; border-radius: 3px; position: relative; }
.bar-fill { height: 100%; border-radius: 2px; min-width: 1px; transition: width 0.3s; }
.bar-fill.inbound { background: #198754; }
.bar-fill.outbound { background: #4a90d9; }
.bar-legend { display: flex; gap: 16px; margin-top: 8px; font-size: 12px; color: #666; }
.bar-legend-item { display: flex; align-items: center; gap: 4px; }
.bar-legend-swatch { width: 12px; height: 12px; border-radius: 2px; }

/* ===== Stock Health Indicator ===== */
.stock-health { display: flex; height: 8px; border-radius: 4px; overflow: hidden; margin-top: 8px; }
.stock-health .ok { background: #198754; }
.stock-health .low { background: #ffc107; }
.stock-health .over { background: #dc3545; }

/* ===== Sub-tabs ===== */
.sub-tabs { display: flex; gap: 4px; margin-bottom: 20px; }
.sub-tab { padding: 8px 16px; font-size: 13px; font-weight: 500; border: 1px solid #d0d0d0; border-radius: 6px; background: #fff; cursor: pointer; color: #555; transition: all 0.15s; }
.sub-tab:hover { background: #f0f0f0; }
.sub-tab.active { background: #4a90d9; color: #fff; border-color: #4a90d9; }

/* ===== Score Badge ===== */
.score-badge { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; font-size: 14px; font-weight: 700; color: #fff; }
.score-badge.buy { background: #198754; }
.score-badge.negotiate { background: #fd7e14; }
.score-badge.pass { background: #dc3545; }

/* ===== Two Column Layout ===== */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

/* ===== Dashboard Volume Chart ===== */
.volume-chart { display: flex; flex-direction: column; gap: 6px; }
.volume-row { display: flex; align-items: center; gap: 10px; }
.volume-date { width: 80px; font-size: 11px; color: #666; text-align: right; flex-shrink: 0; }
.volume-bars { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.volume-bar {
  height: 18px; border-radius: 3px; font-size: 10px; color: #fff;
  display: flex; align-items: center; padding: 0 6px; min-width: 20px;
  transition: width 0.3s;
}
.volume-bar.inbound { background: #198754; }
.volume-bar.outbound { background: #4a90d9; }
.volume-legend { display: flex; gap: 16px; margin-bottom: 12px; font-size: 12px; color: #666; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }

/* ===== Dashboard Status Rows ===== */
.status-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #f5f5f5; }
.status-row:last-child { border-bottom: none; }
.status-count { font-size: 18px; font-weight: 700; color: #333; }

/* ===== Two Column Grid ===== */
.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

/* ===== Warehouse Cards ===== */
.warehouse-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; padding: 16px; }
.warehouse-card { background: #f9f9fb; border-radius: 8px; padding: 16px; border: 1px solid #e8e8ee; }
.warehouse-card-name { font-size: 14px; font-weight: 600; color: #222; margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.warehouse-card-stats { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: #555; margin-bottom: 4px; }
.warehouse-card-stats span { white-space: nowrap; }

/* ===== Health Bar ===== */
.health-bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; margin-top: 8px; background: #f0f0f0; }
.health-segment { height: 100%; transition: width 0.3s; }
.health-segment.healthy { background: #198754; }
.health-segment.low, .health-segment.low-stock { background: #ffc107; }
.health-segment.overstock { background: #0dcaf0; }
.health-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 6px; font-size: 11px; color: #888; }
.health-legend span { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.legend-sm { display: inline-block; width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }

/* ===== Tab Panels ===== */
.tab-panel.active { display: block; }

/* ===== Upload Zone ===== */
.upload-zone {
  border: 2px dashed #d0d0d0;
  border-radius: 8px;
  padding: 48px 20px;
  text-align: center;
  background: #fafafa;
  transition: all 0.2s;
  margin-bottom: 24px;
  cursor: pointer;
}
.upload-zone.drag-over {
  border-color: #4a90d9;
  background: rgba(74,144,217,0.05);
}
.upload-zone .upload-icon { font-size: 48px; margin-bottom: 12px; }

/* ===== Chat Panel ===== */
.chat-toggle-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 900;
  background: #4a90d9;
  color: #fff;
  border: none;
  border-radius: 28px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  transition: transform 0.15s, box-shadow 0.15s;
}
.chat-toggle-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 24px rgba(0,0,0,0.25);
}
.chat-panel {
  position: fixed;
  bottom: 80px;
  right: 24px;
  width: 400px;
  height: 520px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.2);
  z-index: 950;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-panel.hidden { display: none; }
.chat-header {
  padding: 14px 18px;
  background: #1a1a2e;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.chat-close {
  background: none; border: none; color: #aaa;
  font-size: 20px; cursor: pointer; line-height: 1;
}
.chat-close:hover { color: #fff; }
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.chat-msg.user {
  background: #4a90d9;
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.chat-msg.assistant {
  background: #f0f0f0;
  color: #333;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.chat-msg.typing { opacity: 0.6; font-style: italic; }
.chat-input-area {
  padding: 12px;
  border-top: 1px solid #eee;
  display: flex;
  gap: 8px;
}
.chat-input-area .form-control { flex: 1; font-size: 13px; }
.chat-action-card {
  margin-top: 8px;
  padding: 6px 10px;
  background: #e8f4fd;
  border-radius: 6px;
  font-size: 11px;
}
.chat-action-tool { font-weight: 600; color: #4a90d9; }
.chat-action-summary { color: #555; margin-left: 6px; }

/* ===== Urgency ===== */
.urgency-order-now { color: #dc3545; font-weight: 700; }
.urgency-order-soon { color: #fd7e14; font-weight: 600; }
.urgency-healthy { color: #198754; }

/* ===== Clickable Cards ===== */
.metric-card[style*="cursor:pointer"]:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transform: translateY(-1px);
  transition: all 0.15s;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .grid-2col { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  #sidebar {
    width: 200px;
    min-width: 200px;
  }
  #main-wrapper {
    margin-left: 200px;
  }
  #content {
    padding: 16px;
  }
  .metric-cards {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  .chat-panel {
    width: calc(100vw - 48px);
    right: 12px;
    bottom: 70px;
  }
  .warehouse-cards {
    grid-template-columns: 1fr;
  }
}

/* ===== Page Description Banners ===== */
.page-desc {
  background: #e8f0fe;
  border-left: 4px solid #4a90d9;
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: 4px;
  font-size: 0.9rem;
  color: #333;
  line-height: 1.5;
}
.page-desc strong { color: #1a1a2e; }

/* Chart containers */
.chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.chart-card { background: #fff; border-radius: 8px; padding: 1rem; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.chart-card h3 { font-size: 0.95rem; color: #555; margin-bottom: 0.75rem; }
.chart-card canvas { max-height: 300px; }
.chart-full { grid-column: span 2; }
@media (max-width: 900px) { .chart-row { grid-template-columns: 1fr; } .chart-full { grid-column: span 1; } }

/* KPI cards with change indicators */
.kpi-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.kpi-card { background: #fff; border-radius: 8px; padding: 1.25rem; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.kpi-label { font-size: 0.8rem; color: #888; text-transform: uppercase; letter-spacing: 0.5px; }
.kpi-value { font-size: 1.8rem; font-weight: 700; color: #1a1a2e; margin: 0.25rem 0; }
.kpi-change { font-size: 0.85rem; font-weight: 600; }
.kpi-change.up { color: #198754; }
.kpi-change.down { color: #dc3545; }
.kpi-change .arrow { font-size: 0.7rem; }

/* Activity feed */
.activity-feed { max-height: 400px; overflow-y: auto; }
.activity-item { padding: 0.5rem 0; border-bottom: 1px solid #f0f0f0; display: flex; gap: 0.75rem; align-items: flex-start; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; background: #4a90d9; margin-top: 6px; flex-shrink: 0; }
.activity-text { font-size: 0.85rem; color: #555; }
.activity-time { font-size: 0.75rem; color: #aaa; }

/* Period toggle */
.period-toggle { display: flex; gap: 0; margin-bottom: 1rem; }
.period-btn { padding: 6px 16px; border: 1px solid #ddd; background: #f5f5f5; cursor: pointer; font-size: 0.85rem; }
.period-btn:first-child { border-radius: 4px 0 0 4px; }
.period-btn:last-child { border-radius: 0 4px 4px 0; }
.period-btn.active { background: #4a90d9; color: #fff; border-color: #4a90d9; }

/* Loading skeleton */
.skeleton { background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%); background-size: 200% 100%; animation: skeleton-pulse 1.5s infinite; border-radius: 4px; }
@keyframes skeleton-pulse { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-card { height: 100px; }
.skeleton-chart { height: 250px; }

/* Page transitions */
#content { transition: opacity 0.2s ease; }
#content.loading { opacity: 0.3; }
