/* =========================================================
   Paint Works PM — global styles (vanilla CSS, no @apply)
   ========================================================= */

:root {
  color-scheme: light;
  --brand: #2D5BFF;
  --brand-50: #eef2ff;
  --brand-100: #dbe3ff;
  --brand-700: #1f44d6;
  --ink-50: #f8fafc;
  --ink-100: #f1f5f9;
  --ink-200: #e2e8f0;
  --ink-300: #cbd5e1;
  --ink-500: #64748b;
  --ink-600: #475569;
  --ink-700: #334155;
  --ink-900: #0f172a;
  --ok: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --shadow-card: 0 1px 2px rgba(15,23,42,.04), 0 1px 3px rgba(15,23,42,.06);
}

html, body { height: 100%; }
body {
  font-feature-settings: "ss01","cv11";
  letter-spacing: -0.01em;
}

/* ---- Sidebar nav items ---- */
.nav-item {
  display: flex; align-items: center; gap: .55rem;
  padding: .55rem .75rem; border-radius: .5rem;
  color: var(--ink-700); cursor: pointer; user-select: none;
  margin-bottom: 2px;
  text-decoration: none;
}
.nav-item:hover { background: var(--ink-100); }
.nav-item.active {
  background: var(--brand-50);
  color: var(--brand-700);
  font-weight: 600;
}

/* ---- Card ---- */
.card {
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: .75rem;
  box-shadow: var(--shadow-card);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: .375rem;
  padding: .375rem .75rem; border-radius: .5rem;
  font-size: .875rem; font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color .12s, color .12s, border-color .12s, opacity .12s;
  white-space: nowrap;
}
.btn-primary   { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-700); }
.btn-secondary {
  background: #fff; color: var(--ink-700);
  border-color: var(--ink-200);
}
.btn-secondary:hover { background: var(--ink-50); }
.btn-ghost { color: var(--ink-700); background: transparent; }
.btn-ghost:hover { background: var(--ink-100); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: .92; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---- Forms ---- */
.input, .select, .textarea {
  width: 100%;
  padding: .5rem .75rem;
  border-radius: .5rem;
  border: 1px solid var(--ink-200);
  background: #fff;
  font-size: .875rem;
  font-family: inherit;
  color: var(--ink-900);
  transition: border-color .12s, box-shadow .12s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(45,91,255,.18);
}
.textarea { line-height: 1.5; resize: vertical; }

/* Explicit chevron for <select> so it's clearly a dropdown across browsers */
.select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 2rem;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
  background-repeat: no-repeat;
  background-position: right .65rem center;
  background-size: 14px 14px;
  cursor: pointer;
}
.select:disabled { cursor: not-allowed; opacity: .5; }
.label {
  display: block;
  font-size: .75rem;
  font-weight: 500;
  color: var(--ink-500);
  margin-bottom: .25rem;
}

/* ---- Pills ---- */
.pill {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: 1px .5rem;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.6;
}
.pill-blue   { background: var(--brand-50); color: var(--brand-700); }
.pill-green  { background: #ecfdf5; color: #047857; }
.pill-amber  { background: #fffbeb; color: #b45309; }
.pill-red    { background: #fef2f2; color: #b91c1c; }
.pill-gray   { background: var(--ink-100); color: var(--ink-700); }

/* ---- Table ---- */
.table { width: 100%; font-size: .875rem; border-collapse: separate; border-spacing: 0; }
.table thead th {
  text-align: left;
  font-size: .7rem;
  font-weight: 500;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .5rem .75rem;
  background: var(--ink-50);
  border-bottom: 1px solid var(--ink-200);
}
.table tbody td {
  padding: .5rem .75rem;
  border-bottom: 1px solid #f1f5f9;
  color: var(--ink-900);
  vertical-align: middle;
}
.table tbody tr { transition: background-color .08s; }
.table tbody tr:hover { background: var(--ink-50); }
.table tfoot td {
  padding: .5rem .75rem;
  background: var(--ink-50);
  border-top: 1px solid var(--ink-200);
  font-size: .8rem;
}

/* ---- Modal ---- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
  animation: fade-in .12s ease-out;
}
.modal {
  background: #fff;
  border-radius: 14px;
  width: min(92vw, 720px);
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,.25);
  animation: modal-in .15s ease-out;
}
@keyframes fade-in { from{opacity:0} to{opacity:1} }
@keyframes modal-in { from{transform:translateY(8px); opacity:0} to{transform:translateY(0); opacity:1} }

/* ---- Toast ---- */
.toast {
  pointer-events: auto;
  background: var(--ink-900); color: #fff;
  padding: .6rem .9rem;
  border-radius: .6rem;
  font-size: .85rem;
  animation: toast-in .15s ease-out;
  box-shadow: 0 10px 30px rgba(0,0,0,.2);
  max-width: 320px;
}
.toast.success { background: #065f46; }
.toast.error   { background: #991b1b; }
@keyframes toast-in {
  from { transform: translateY(8px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ---- Frappe Gantt overrides ---- */
.gantt-container .gantt .bar { fill: var(--brand); }
.gantt-container .gantt .bar-progress { fill: var(--brand-700); }
.gantt-container .gantt .grid-header { fill: #f8fafc; }
.gantt-container .gantt .lower-text,
.gantt-container .gantt .upper-text { fill: #475569; }

/* ---- Calendar ---- */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: var(--ink-200);
  border: 1px solid var(--ink-200);
  border-radius: 10px;
  overflow: hidden;
}
.cal-cell {
  background: #fff;
  min-height: 96px;
  padding: 6px 8px;
  font-size: 12px;
  cursor: pointer;
  transition: background-color .08s;
}
.cal-cell:hover { background: var(--ink-50); }
.cal-cell.dim { background: #fafbfc; color: #94a3b8; }
.cal-head {
  background: var(--ink-100);
  text-align: center;
  font-weight: 600;
  font-size: 11px;
  color: #475569;
  padding: 6px 0;
}

/* ---- Misc ---- */
.kbd {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--ink-200);
  background: var(--ink-50);
  font-size: 10px;
  color: var(--ink-700);
  font-family: ui-monospace, SFMono-Regular, monospace;
}
.divider { height: 1px; background: var(--ink-200); margin: .75rem 0; }
.text-danger { color: var(--danger); }
.text-warn   { color: var(--warn); }
.text-ok     { color: var(--ok); }
.text-brand  { color: var(--brand); }

/* simple amber palette used in calendar (Tailwind ships this but keeping it safe) */
.bg-amber-100 { background-color: #fef3c7; }
.text-amber-800 { color: #92400e; }
.bg-amber-500    { background-color: #f59e0b; }
.bg-emerald-500  { background-color: #10b981; }
.bg-rose-500     { background-color: #f43f5e; }
.bg-slate-300    { background-color: #cbd5e1; }
.bg-brand        { background-color: var(--brand); }
.bg-emerald-100  { background-color: #d1fae5; }
.text-emerald-800{ color: #065f46; }
.text-rose-500   { color: #f43f5e; }
.text-blue-600   { color: #2563eb; }
.text-amber-700  { color: #b45309; }

/* utility for hidden file input */
.hidden { display: none; }
