@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@500;600;700&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@500;600&display=swap');

* { box-sizing: border-box; }
body { margin: 0; font-family: 'Inter', sans-serif; background: #EAE4D8; color: #241F1C; }
.hidden { display: none !important; }
.eyebrow { font-family: 'Oswald', sans-serif; text-transform: uppercase; letter-spacing: 0.04em; font-size: 12px; color: #A6763E; }

/* ---------- login ---------- */
.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { background: #F1ECE1; border: 2px solid #241F1C; border-radius: 8px; padding: 32px; width: 340px; }
.login-card h1 { font-family: 'Oswald', sans-serif; text-transform: uppercase; margin: 8px 0 20px; }
.login-card input { width: 100%; padding: 10px; margin-bottom: 12px; border: 2px solid #241F1C33; border-radius: 6px; font-size: 14px; }
.login-card button { width: 100%; padding: 12px; background: #241F1C; color: #EAE4D8; border: none; border-radius: 6px; font-family: 'Oswald', sans-serif; text-transform: uppercase; cursor: pointer; }
.error-text { color: #9C4A3B; font-size: 13px; margin-top: 8px; min-height: 18px; }

/* ---------- app shell: sidebar + main ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px; flex-shrink: 0; background: #241F1C; color: #EAE4D8;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar-brand { padding: 24px 20px 16px; border-bottom: 1px solid #EAE4D822; }
.sidebar-brand .eyebrow { color: #C9A876; }
.brand-title { font-family: 'Oswald', sans-serif; text-transform: uppercase; font-size: 20px; font-weight: 600; margin-top: 4px; }

.sidebar-nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.nav-btn {
  display: flex; align-items: center; gap: 10px; text-align: left;
  background: transparent; border: none; color: #EAE4D8CC; padding: 11px 14px;
  border-radius: 6px; font-family: 'Oswald', sans-serif; text-transform: uppercase;
  font-size: 13px; letter-spacing: 0.02em; cursor: pointer;
}
.nav-btn .nav-icon { font-size: 14px; width: 18px; text-align: center; }
.nav-btn:hover { background: #EAE4D815; color: #EAE4D8; }
.nav-btn.active { background: #A6763E; color: #241F1C; font-weight: 600; }

.sidebar-footer { padding: 16px; border-top: 1px solid #EAE4D822; }
.user-chip { margin-bottom: 12px; }
.user-chip-name { font-weight: 600; font-size: 14px; }
.user-chip-role { font-size: 11px; color: #EAE4D899; text-transform: uppercase; letter-spacing: 0.03em; margin-top: 2px; }
.full-width { width: 100%; }

.main-col { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  border-bottom: 2px solid #241F1C1a; padding: 16px 28px; display: flex;
  align-items: center; justify-content: space-between; gap: 16px; background: #EAE4D8;
  position: sticky; top: 0; z-index: 5;
}
.search-box { position: relative; flex: 1; max-width: 420px; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #241F1C66; font-size: 15px; }
.search-box input { width: 100%; padding: 10px 12px 10px 34px; border: 2px solid #241F1C22; border-radius: 6px; font-size: 14px; background: white; }

.primary-btn { background: #241F1C; color: #EAE4D8; border: none; padding: 10px 18px; border-radius: 6px; font-family: 'Oswald', sans-serif; text-transform: uppercase; font-size: 13px; cursor: pointer; }
.primary-btn:hover { background: #A6763E; }
.ghost-btn { background: transparent; border: 2px solid #241F1C33; padding: 9px 15px; border-radius: 6px; font-family: 'Oswald', sans-serif; text-transform: uppercase; font-size: 12px; cursor: pointer; color: #241F1C; }
.ghost-btn:hover { border-color: #A6763E; color: #A6763E; }

.content { padding: 24px 28px 60px; flex: 1; }
.tab-panel.hidden { display: none; }

/* ---------- stat strip ---------- */
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-box { background: #F1ECE1; border: 2px solid #241F1C14; border-radius: 8px; padding: 16px; text-align: center; }
.stat-num { font-family: 'IBM Plex Mono', monospace; font-size: 28px; font-weight: 600; }
.stat-label { font-family: 'Oswald', sans-serif; text-transform: uppercase; font-size: 11px; color: #241F1C99; margin-top: 4px; letter-spacing: 0.03em; }

/* ---------- dashboard cards ---------- */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.depot-card { background: #F1ECE1; border: 2px solid #241F1C1a; border-radius: 8px; padding: 16px; }
.depot-card.completed { border-color: #5B7461; }
.depot-card h3 { font-family: 'Oswald', sans-serif; text-transform: uppercase; margin: 0 0 8px; font-size: 16px; }
.depot-card .total { font-family: 'IBM Plex Mono', monospace; font-size: 26px; font-weight: 600; }
.depot-card .status { font-size: 12px; margin-top: 6px; }
.depot-card .status.done { color: #5B7461; }
.depot-card .status.pending { color: #9C4A3B; }
.depot-card .items { margin-top: 10px; font-size: 12px; color: #241F1C99; max-height: 120px; overflow-y: auto; }
.depot-card .items div { display: flex; justify-content: space-between; padding: 2px 0; align-items: center; }
.depot-card-clickable { cursor: pointer; transition: transform 0.12s, box-shadow 0.12s; }
.depot-card-clickable:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(36,31,28,0.12); }
.card-hint { margin-top: 10px; font-size: 12px; color: #241F1C77; font-style: italic; }
.depot-card-title { text-decoration: underline; text-decoration-color: transparent; transition: text-decoration-color 0.15s; }
.depot-card-clickable:hover .depot-card-title { text-decoration-color: #A6763E; }
.more-note { font-style: italic; padding-top: 4px; opacity: 0.7; }
.empty-note { color: #241F1C66; font-style: italic; font-size: 14px; padding: 20px 0; }

/* ---------- modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(36,31,28,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 20px;
}
.modal-box {
  background: #EAE4D8; border: 2px solid #241F1C; border-radius: 10px;
  padding: 28px; width: 100%; max-width: 640px; max-height: 85vh; overflow-y: auto;
  position: relative;
}
.modal-close-btn {
  position: absolute; top: 16px; right: 16px; background: none; border: none;
  font-size: 18px; cursor: pointer; color: #241F1C99;
}
.modal-header { display: flex; justify-content: space-between; align-items: flex-start; padding-right: 30px; }
.modal-header h2 { font-family: 'Oswald', sans-serif; text-transform: uppercase; margin: 4px 0 0; font-size: 24px; }
.modal-total { text-align: right; }
.modal-total .total { font-family: 'IBM Plex Mono', monospace; font-size: 26px; font-weight: 600; }

.complete-toggle-btn {
  margin-top: 14px; width: 100%; padding: 10px; border-radius: 6px;
  border: 2px solid #241F1C33; background: transparent;
  font-family: 'Oswald', sans-serif; text-transform: uppercase; font-size: 12px; cursor: pointer;
}
.complete-toggle-btn.done { background: #5B7461; border-color: #5B7461; color: white; }

.finalize-btn {
  margin-top: 8px; width: 100%; padding: 10px; border-radius: 6px;
  border: 2px solid #9C4A3B; background: transparent; color: #9C4A3B;
  font-family: 'Oswald', sans-serif; text-transform: uppercase; font-size: 12px; cursor: pointer;
}
.finalize-btn:hover:not(:disabled) { background: #9C4A3B; color: white; }
.finalize-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.modal-item-list { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }
.modal-item-row {
  background: #F1ECE1; border: 1px solid #241F1C1a; border-radius: 6px;
  padding: 10px 14px; display: flex; justify-content: space-between; align-items: center;
}
.modal-item-row .sub-text { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: #241F1C99; }
.qty-big { font-family: 'IBM Plex Mono', monospace; font-size: 20px; font-weight: 600; }
.modal-del-btn { background: none; border: none; color: #9C4A3B; cursor: pointer; font-size: 17px; }
.del-btn { background: none; border: none; color: #9C4A3B; cursor: pointer; font-size: 16px; }

/* ---------- analiz / grafik ---------- */
.chart-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.chart-card { background: #F1ECE1; border: 2px solid #241F1C14; border-radius: 8px; padding: 20px; position: relative; }
.chart-card h3 { font-family: 'Oswald', sans-serif; text-transform: uppercase; font-size: 14px; margin: 0 0 16px; color: #241F1C99; }
.chart-card canvas { max-height: 320px; }
.chart-card-wide { grid-column: 1 / -1; }
@media (max-width: 900px) { .chart-grid { grid-template-columns: 1fr; } }

/* ---------- import box ---------- */
.import-box {
  background: #F1ECE1; border: 2px dashed #A6763E66; border-radius: 8px;
  padding: 16px; margin-bottom: 16px; display: flex; justify-content: space-between;
  align-items: center; gap: 16px; flex-wrap: wrap;
}
.import-box-text { display: flex; flex-direction: column; gap: 2px; }
.import-box-text span { font-size: 12px; color: #241F1C99; }
.import-box-actions { display: flex; gap: 8px; flex-shrink: 0; }
.file-label { cursor: pointer; display: inline-flex; align-items: center; }
.import-result { margin-bottom: 16px; padding: 10px 14px; border-radius: 6px; font-size: 13px; }
.import-result.success { background: #5B746120; color: #5B7461; border: 1px solid #5B7461; }
.import-result.error { background: #9C4A3B20; color: #9C4A3B; border: 1px solid #9C4A3B; }

/* ---------- forms & lists ---------- */
.inline-form { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.inline-form input, .inline-form select { flex: 1; min-width: 160px; padding: 10px; border: 2px solid #241F1C33; border-radius: 6px; font-size: 14px; }
.inline-form button { background: #241F1C; color: #EAE4D8; border: none; padding: 0 20px; border-radius: 6px; font-family: 'Oswald', sans-serif; text-transform: uppercase; font-size: 13px; cursor: pointer; }

.data-list { display: flex; flex-direction: column; gap: 8px; }
.data-row { background: #F1ECE1; border: 1px solid #241F1C1a; border-radius: 6px; padding: 10px 14px; display: flex; justify-content: space-between; align-items: center; }
.data-row .main-text { font-weight: 500; }
.data-row .sub-text { font-size: 12px; color: #241F1C99; font-family: 'IBM Plex Mono', monospace; }

.row-actions { display: flex; gap: 10px; align-items: center; }
.edit-btn { background: none; border: none; color: #A6763E; cursor: pointer; font-size: 15px; }
.rename-input { width: 100%; padding: 6px 8px; border: 2px solid #A6763E; border-radius: 4px; font-size: 14px; }

.history-row .sub-text { font-family: 'Inter', sans-serif; }
.you-badge { background: #A6763E; color: white; font-size: 10px; padding: 2px 6px; border-radius: 4px; margin-left: 6px; text-transform: uppercase; }

/* ---------- responsive ---------- */
@media (max-width: 800px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: relative; flex-direction: row; align-items: center; flex-wrap: wrap; }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar-footer { border-top: none; display: flex; align-items: center; gap: 10px; padding: 10px 16px; }
  .user-chip { margin-bottom: 0; }
  .full-width { width: auto; }
  .topbar { flex-wrap: wrap; }
}
