/* PMT design system — mirrors CarAmzAdsPlatform's frontend/static/style.css
   (Poppins, #17281e sidebar, #649638 accent, #f1f1f1 workspace, white cards,
   #e0e0e0 borders, 8px radius). Light tokens on :root, dark via body.dark —
   same toggle class + localStorage key pattern as the main app. */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;700&display=swap');

:root {
  --bg: #f1f1f1;
  --surface: #fff;
  --surface-2: #f5f5f5;
  --border: #e0e0e0;
  --border-soft: #e8e8ef;
  --text: #17281e;
  --muted: #666;
  --faint: #888;
  --sidebar: #17281e;
  --sidebar-hover: #243b2a;
  --sidebar-text: #e8e8e8;
  --sidebar-section: #8aaa8a;
  --accent: #649638;
  --accent-hover: #557f2f;
  --accent-soft: #eef6e6;
  --accent-text: #3d5c22;
  --danger: #c0392b;
  --radius: 8px;
  --ctl-h: 34px;
}
body.dark {
  --bg: #121212;
  --surface: #1e1e1e;
  --surface-2: #2a2a2a;
  --border: #333;
  --border-soft: #2a2a2a;
  --text: #e4e4e4;
  --muted: #aaa;
  --faint: #999;
  --sidebar: #0f1a13;
  --sidebar-hover: #1e3324;
  --accent: #8bba4e;
  --accent-hover: #9cc861;
  --accent-soft: #1e3a1e;
  --accent-text: #b5d68a;
  --danger: #f87171;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body { font-family: 'Poppins', 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
a { color: var(--accent); }

/* Layout — same .layout/.sidebar/.content contract as the main app */
.layout { display: flex; height: 100%; overflow: hidden; }
.sidebar { width: 200px; background: var(--sidebar); padding: 24px 0 0; flex-shrink: 0; display: flex; flex-direction: column; gap: 4px; height: 100%; }
.sidebar-title { color: #fff; font-weight: 700; font-size: 15px; padding: 0 20px 18px; border-bottom: 1px solid var(--sidebar-hover); margin-bottom: 8px; }
.sidebar-title small { display: block; font-weight: 400; font-size: 11px; color: var(--sidebar-section); margin-top: 2px; }
.sidebar-nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.nav-section { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--sidebar-section); padding: 14px 20px 4px; }
.nav-link { display: block; padding: 10px 20px; color: var(--sidebar-text); text-decoration: none; border-left: 3px solid transparent; transition: all .15s; }
.nav-link:hover { color: #fff; background: var(--sidebar-hover); }
.nav-link.active { color: #fff; border-left-color: #649638; background: var(--sidebar-hover); }
.sidebar-bottom { border-top: 1px solid var(--sidebar-hover); padding: 10px 0 14px; }
.sidebar-user { color: var(--sidebar-section); font-size: 12px; padding: 4px 20px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-bottom-item { display: block; width: 100%; text-align: left; background: none; border: none; font: inherit; color: var(--sidebar-text); padding: 7px 20px; font-size: 13px; cursor: pointer; text-decoration: none; }
.nav-bottom-item:hover { background: var(--sidebar-hover); color: #fff; }

.content { flex: 1; padding: 32px 40px; min-width: 0; overflow-y: auto; height: 100%; }
.content-narrow { max-width: 1100px; }
h1 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
h2 { font-size: 16px; font-weight: 700; margin-bottom: 10px; }
.subtitle { color: var(--muted); margin-bottom: 24px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .subtitle { margin-bottom: 0; }
.crumb { font-size: 12px; color: var(--muted); margin-bottom: 6px; display: inline-block; text-decoration: none; }
.crumb:hover { color: var(--accent); }

/* Surfaces */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); font-size: 12px; }

/* Controls */
.btn { display: inline-flex; align-items: center; gap: 6px; height: var(--ctl-h); padding: 0 14px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
body.dark .btn-primary { color: #0f1a13; }
.btn-danger { color: var(--danger); border-color: transparent; background: none; }
.btn:disabled { opacity: .5; cursor: default; }
input[type=text], input[type=search], input[type=date], textarea, select {
  height: var(--ctl-h); padding: 0 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px;
}
textarea { height: auto; min-height: 64px; padding: 8px 10px; resize: vertical; width: 100%; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.form-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.form-stack { display: flex; flex-direction: column; gap: 8px; }

/* Chips / badges — status + priority use these, never ad-hoc colors */
.chip { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.chip-green, .chip-done   { background: #dff0cc; color: #3d5c22; }
.chip-amber, .chip-in_progress, .chip-high { background: #fef3c7; color: #b45309; }
.chip-grey, .chip-todo, .chip-normal, .chip-low { background: #f1f1f1; color: #555; }
.chip-red    { background: #fde2e2; color: #a12a2a; }
.chip-cc     { background: var(--accent-soft); color: var(--accent-text); font-weight: 500; margin: 1px 2px 1px 0; }
body.dark .chip-green, body.dark .chip-done { background: #1e3a1e; color: #8bba4e; }
body.dark .chip-amber, body.dark .chip-in_progress, body.dark .chip-high { background: #2a2a1a; color: #e0b84a; }
body.dark .chip-grey, body.dark .chip-todo, body.dark .chip-normal, body.dark .chip-low { background: #2a2a2a; color: #bbb; }
body.dark .chip-red { background: #3a1e1e; color: #f87171; }

/* Lightweight Asana-style list/table */
.list-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.list-table th { text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface); }
.list-table td { padding: 10px 14px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.list-table tr:last-child td { border-bottom: none; }
.list-table tbody tr:hover td { background: var(--surface-2); }
.list-table tr.row-removed td { opacity: .55; }
.list-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.row-link { color: var(--text); font-weight: 600; text-decoration: none; }
.row-link:hover { color: var(--accent); }

/* Cards (projects) */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; text-decoration: none; color: inherit; transition: box-shadow .15s, border-color .15s; }
.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); border-color: var(--accent); }
.card-title { font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.card-desc { color: var(--muted); font-size: 13px; line-height: 1.5; }

/* Banners — same names as main app's .banner-error/.banner-info */
.banner-error, .banner-info { border-radius: 6px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px; }
.banner-error { background: #fdecea; color: #a12a2a; border: 1px solid #f5c2bd; }
.banner-info  { background: #eaf2fd; color: #1f4e8c; border: 1px solid #c4d8f5; }
body.dark .banner-error { background: #3a1e1e; color: #f8a5a5; border-color: #5a2a2a; }
body.dark .banner-info  { background: #1a2638; color: #9cc2f5; border-color: #2a3c58; }

.empty { padding: 28px; text-align: center; color: var(--muted); }

@media (max-width: 760px) {
  .sidebar { width: 0; padding: 0; overflow: hidden; }
  .content { padding: 20px 16px; }
}
