/* Signart Precut MGR — Dark engineering theme matching SA Specification */
:root {
  --bg: #0b0f19;
  --bg-card: #141b2d;
  --bg-card-alt: #1a2238;
  --panel: #111827;
  --panel-border: #1f293d;
  --line: rgba(148, 163, 184, 0.14);
  --line-strong: rgba(148, 163, 184, 0.28);
  
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --primary: #f59e0b;       /* Signart Gold / Timber Amber */
  --primary-hover: #fbbf24;
  --accent-cyan: #06b6d4;
  --accent-orange: #f97316;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-yellow: #f59e0b;
  --accent-purple: #a855f7;

  --r: 8px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-size: 13.5px; line-height: 1.5; }

a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #262e40; border-radius: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }

/* Typography */
h1, h2, h3, h4 { margin: 0; font-weight: 700; color: #fff; }
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.small { font-size: 11.5px; }
.mono { font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* Flex & Grid Utilities */
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 8px; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }

/* Top Navigation Bar - Matching Signart Header */
.app { display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 24px;
  background: #0f1422;
  border-bottom: 1px solid var(--panel-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 12px;
  cursor: pointer;
}
.brand-logo {
  font-weight: 900;
  font-size: 21px;
  letter-spacing: -0.5px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 2px;
}
.brand-logo .sa-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0b0f19;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 900;
  margin-right: 6px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}
.brand-logo .sa-brand {
  color: #ffffff;
}
.brand-logo .sa-sub {
  font-size: 9px;
  font-weight: 800;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 6px;
  letter-spacing: 0.8px;
}

/* Nav Menu Items */
.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.main-nav a {
  padding: 7px 14px;
  border-radius: 6px;
  color: #94a3b8;
  font-weight: 600;
  font-size: 13.5px;
  transition: all 0.16s ease;
  white-space: nowrap;
}
.main-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}
.main-nav a.active {
  color: #fff;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.nav-badge-pill {
  background: var(--accent-orange);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 6px;
}

/* Topbar Right Tools */
.top-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}
.notif-bell {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-border);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: 0.15s;
}
.notif-bell:hover { background: rgba(255, 255, 255, 0.08); }
.notif-bell .badge-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--accent-red);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 5px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
}
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #3b82f6;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  display: grid;
  place-items: center;
}
.user-pill select {
  background: transparent;
  border: 0;
  color: #fff;
  font-weight: 600;
  font-size: 12.5px;
  outline: none;
  cursor: pointer;
}
.user-pill select option {
  background: #181d2a;
  color: #f1f5f9;
}
.user-pill select optgroup {
  background: #0f131c;
  color: #00c2ff;
  font-weight: 800;
  font-size: 11px;
  font-style: normal;
}
.role-chip {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 3px 9px;
  border: 1px solid;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  white-space: nowrap;
}

/* Content Container */
.content {
  flex: 1;
  padding: 18px 24px 40px;
  max-width: 1680px;
  margin: 0 auto;
  width: 100%;
}

/* Screen Title Header — Clean Production Style */
.screen-title-banner {
  margin-bottom: 16px;
}
.screen-title-banner .view-title {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  color: #f8fafc;
  letter-spacing: 0.3px;
}
.screen-tag {
  font-size: 18px;
  font-weight: 800;
  color: #f1f5f9;
  letter-spacing: 0.3px;
}

/* 6-Column Compact Project Grid */
.grid-6col {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}
.project-card-compact {
  background: #131826;
  border: 1px solid #1f293d;
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 12px;
  transition: all 0.15s ease;
}
.project-card-compact:hover {
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
}

/* Right Alert Panel */
.projects-alert-panel {
  background: #111622;
  border: 1px solid #1f293d;
  border-radius: 8px;
  padding: 14px;
}
.alert-card-item {
  background: #161c2b;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.alert-card-item:hover {
  border-color: rgba(245,158,11,0.4);
  background: #192133;
}

/* QC Area Box (Khoanh Vùng Lỗi) */
.qc-area-box {
  position: absolute;
  border: 2px dashed #ef4444;
  background: rgba(239, 68, 68, 0.18);
  border-radius: 4px;
  pointer-events: auto;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
  cursor: pointer;
}
.qc-area-box.fixed {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.18);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}
.qc-area-box .qc-box-tag {
  position: absolute;
  top: -20px;
  left: 0;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 3px;
  white-space: nowrap;
}
.qc-area-box.fixed .qc-box-tag {
  background: #10b981;
}

/* Red Pulse for Deadline */
@keyframes redPulse {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 8px #ef4444; }
  100% { transform: scale(0.9); opacity: 0.7; }
}
.blink-dot {
  animation: redPulse 1.4s infinite ease-in-out;
}


/* macOS Window Frame (Page 2 & Others) */
.mac-window {
  background: #161a25;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  margin-bottom: 16px;
}
.mac-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #121620;
  border-bottom: 1px solid var(--panel-border);
}
.mac-dots {
  display: flex;
  gap: 6px;
}
.mac-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}
.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.mac-window-body {
  padding: 16px;
}

/* Panels */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--panel-border);
  border-radius: var(--r);
  overflow: hidden;
}
.panel-h {
  padding: 12px 16px;
  border-bottom: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.015);
}
.panel-b { padding: 14px 16px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 12.5px;
  cursor: pointer;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.05);
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary, .btn.primary {
  background: #0077ff;
  border-color: #0077ff;
  color: #fff;
}
.btn-primary:hover, .btn.primary:hover { background: #0066dd; }

.btn-success, .btn.success {
  background: #10b981;
  border-color: #10b981;
  color: #fff;
}
.btn-success:hover, .btn.success:hover { background: #059669; }

.btn-danger, .btn.danger {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
}

.btn-orange, .btn.warn {
  background: #f97316;
  border-color: #f97316;
  color: #fff;
}

.btn-gray {
  background: #334155;
  border-color: #475569;
  color: #e2e8f0;
}

.btn.sm { padding: 4px 10px; font-size: 11.5px; }

/* Inputs & Form Controls */
.inp, select.inp, textarea.inp {
  background: #11151f;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  outline: none;
  width: 100%;
}
.inp:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 194, 255, 0.2);
}
textarea.inp { resize: vertical; min-height: 80px; }

.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-size: 11.5px; color: var(--text-muted); font-weight: 600; }
