:root {
  --bg: #0a0e17; --surface: #111827; --surface2: #1a2235;
  --border: #1e293b; --text: #e2e8f0; --text2: #94a3b8;
  --accent: #6366f1; --accent2: #818cf8; --green: #10b981;
  --amber: #f59e0b; --red: #ef4444; --cyan: #06b6d4;
  --pink: #ec4899; --radius: 12px;
}
* { margin:0; padding:0; box-sizing:border-box; }
body { font-family:'Inter',sans-serif; background:var(--bg); color:var(--text); min-height:100vh; }
.app { max-width:1440px; margin:0 auto; padding:0 24px; }

/* Header */
.top-bar { display:flex; justify-content:space-between; align-items:center; padding:20px 0; border-bottom:1px solid var(--border); }
.logo { display:flex; align-items:center; gap:10px; }
.logo-icon { font-size:24px; color:var(--accent); }
.logo-text { font-size:22px; font-weight:800; background:linear-gradient(135deg,var(--accent),var(--cyan)); -webkit-background-clip:text; -webkit-text-fill-color:transparent; }
.logo-sub { font-size:13px; color:var(--text2); font-weight:400; }
.header-meta { display:flex; align-items:center; gap:10px; font-size:13px; color:var(--text2); }
.pulse { width:8px; height:8px; background:var(--green); border-radius:50%; animation:pulse 2s infinite; }
@keyframes pulse { 0%,100%{ opacity:1; } 50%{ opacity:.4; } }

/* Tabs */
.tab-bar { display:flex; gap:4px; padding:16px 0; overflow-x:auto; border-bottom:1px solid var(--border); }
.tab { background:none; border:none; color:var(--text2); font:500 13px 'Inter',sans-serif; padding:8px 16px; border-radius:8px; cursor:pointer; white-space:nowrap; transition:.2s; }
.tab:hover { background:var(--surface); color:var(--text); }
.tab.active { background:var(--accent); color:#fff; }

/* Content */
.content { padding:24px 0 48px; }

/* Cards */
.grid { display:grid; gap:16px; }
.grid-4 { grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); }
.grid-3 { grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); }
.grid-2 { grid-template-columns:repeat(auto-fill,minmax(420px,1fr)); }
.card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:20px; transition:.2s; }
.card:hover { border-color:var(--accent); transform:translateY(-2px); }
.card h3 { font-size:13px; color:var(--text2); text-transform:uppercase; letter-spacing:1px; margin-bottom:12px; }
.card .value { font-size:32px; font-weight:800; }
.card .sub { font-size:12px; color:var(--text2); margin-top:4px; }

/* Section headers */
.section-title { font-size:18px; font-weight:700; margin:32px 0 16px; display:flex; align-items:center; gap:10px; }
.section-title .badge { font-size:12px; background:var(--accent); color:#fff; padding:2px 10px; border-radius:20px; font-weight:600; }

/* Tables */
.table-wrap { overflow:auto; max-height:calc(100vh - 220px); border-radius:var(--radius); border:1px solid var(--border); background:var(--surface); }
table { width:100%; border-collapse:collapse; font-size:13px; }
th { text-align:left; padding:12px 16px; background:var(--surface2); color:var(--text2); font-weight:600; text-transform:uppercase; letter-spacing:.5px; font-size:11px; position:sticky; top:0; z-index:10; }
td { padding:10px 16px; border-top:1px solid var(--border); }
tr:hover td { background:rgba(99,102,241,.05); }

/* Status badges */
.status { display:inline-block; padding:2px 10px; border-radius:20px; font-size:11px; font-weight:600; }
.status-green { background:rgba(16,185,129,.15); color:var(--green); }
.status-amber { background:rgba(245,158,11,.15); color:var(--amber); }
.status-red { background:rgba(239,68,68,.15); color:var(--red); }
.status-blue { background:rgba(99,102,241,.15); color:var(--accent2); }
.status-cyan { background:rgba(6,182,212,.15); color:var(--cyan); }

/* Calendar */
.cal-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:2px; }
.cal-header { padding:8px; text-align:center; font-size:11px; font-weight:700; color:var(--text2); text-transform:uppercase; }
.cal-day { background:var(--surface); border:1px solid var(--border); border-radius:6px; min-height:90px; padding:6px 8px; font-size:11px; cursor:pointer; transition:.2s; }
.cal-day:hover { border-color:var(--accent); }
.cal-day.today { border-color:var(--accent); background:rgba(99,102,241,.08); }
.cal-day.other-month { opacity:.3; }
.cal-day .day-num { font-weight:700; font-size:13px; margin-bottom:4px; }
.cal-event { padding:2px 4px; border-radius:3px; margin-bottom:2px; font-size:10px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; cursor:pointer; }
.cal-event.delivery { background:rgba(16,185,129,.2); color:var(--green); }
.cal-event.deadline { background:rgba(239,68,68,.2); color:var(--red); }
.cal-event.meeting { background:rgba(6,182,212,.2); color:var(--cyan); }
.cal-event.ship { background:rgba(245,158,11,.2); color:var(--amber); }
.cal-nav { display:flex; align-items:center; gap:16px; margin-bottom:16px; }
.cal-nav button { background:var(--surface); border:1px solid var(--border); color:var(--text); padding:6px 14px; border-radius:6px; cursor:pointer; font:500 13px 'Inter'; }
.cal-nav button:hover { border-color:var(--accent); }
.cal-nav .month-label { font-size:18px; font-weight:700; min-width:200px; text-align:center; }

/* Checklists */
.checklist { list-style:none; }
.checklist li { display:flex; align-items:flex-start; gap:10px; padding:10px 16px; border-bottom:1px solid var(--border); font-size:13px; transition:.15s; }
.checklist li:hover { background:rgba(99,102,241,.03); }
.checklist input[type=checkbox] { accent-color:var(--accent); margin-top:2px; width:16px; height:16px; cursor:pointer; }
.checklist .item-text { flex:1; }
.checklist .item-text.done { text-decoration:line-through; color:var(--text2); }
.checklist .item-meta { font-size:11px; color:var(--text2); }
.check-section { margin-bottom:24px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; }
.check-section-header { padding:14px 16px; background:var(--surface2); font-weight:700; font-size:14px; display:flex; justify-content:space-between; }
.check-progress { font-size:12px; color:var(--text2); }
.progress-bar { height:3px; background:var(--border); border-radius:2px; margin-top:6px; }
.progress-fill { height:100%; background:var(--green); border-radius:2px; transition:.3s; }

/* Filters */
.filter-bar { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:16px; }
.filter-btn { background:var(--surface); border:1px solid var(--border); color:var(--text2); font:500 12px 'Inter'; padding:6px 14px; border-radius:20px; cursor:pointer; transition:.2s; }
.filter-btn:hover,.filter-btn.active { background:var(--accent); color:#fff; border-color:var(--accent); }

/* Notes/Log */
.log-entry { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:16px; margin-bottom:12px; }
.log-entry .log-date { font-size:11px; color:var(--accent2); font-weight:600; }
.log-entry .log-body { margin-top:6px; font-size:13px; line-height:1.6; }
.note-input { width:100%; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:14px; color:var(--text); font:400 13px 'Inter'; resize:vertical; min-height:80px; }
.note-input:focus { outline:none; border-color:var(--accent); }
.btn { background:var(--accent); color:#fff; border:none; padding:8px 20px; border-radius:8px; font:600 13px 'Inter'; cursor:pointer; transition:.2s; }
.btn:hover { background:var(--accent2); transform:translateY(-1px); }

/* Tooltip */
.tooltip { position:relative; }
.tooltip:hover::after { content:attr(data-tip); position:absolute; bottom:100%; left:50%; transform:translateX(-50%); background:#1e293b; color:#fff; padding:4px 10px; border-radius:6px; font-size:11px; white-space:nowrap; z-index:99; }

/* Floor Plan Viewer */
.floor-nav { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:20px; }
.floor-btn { background:var(--surface); border:1px solid var(--border); color:var(--text2); font:600 13px 'Inter'; padding:8px 14px; border-radius:8px; cursor:pointer; transition:.2s; min-width:44px; text-align:center; }
.floor-btn:hover { border-color:var(--accent); color:var(--text); }
.floor-btn.active { background:var(--accent); color:#fff; border-color:var(--accent); }
.floor-btn .floor-pct { display:block; font-size:10px; font-weight:400; margin-top:2px; }

.floorplan-container { position:relative; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; }
.floorplan-container img { width:100%; display:block; }
.floorplan-overlay { position:absolute; top:0; left:0; width:100%; height:100%; }
.room-hotspot { position:absolute; border:2px solid rgba(99,102,241,.6); border-radius:4px; cursor:pointer; transition:.15s; display:flex; align-items:center; justify-content:center; font-size:10px; font-weight:700; color:rgba(255,255,255,.9); text-shadow:0 1px 3px rgba(0,0,0,.8); }
.room-hotspot:hover { transform:scale(1.05); z-index:10; border-width:3px; }
.room-hotspot.st-not-started { background:rgba(30,41,59,.5); border-color:rgba(148,163,184,.5); }
.room-hotspot.st-in-progress { background:rgba(245,158,11,.25); border-color:var(--amber); }
.room-hotspot.st-punch { background:rgba(239,68,68,.25); border-color:var(--red); }
.room-hotspot.st-complete { background:rgba(16,185,129,.25); border-color:var(--green); }

.room-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(100px,1fr)); gap:8px; margin-top:16px; }
.room-card { background:var(--surface); border:1px solid var(--border); border-radius:8px; padding:10px; text-align:center; cursor:pointer; transition:.2s; }
.room-card:hover { border-color:var(--accent); transform:translateY(-2px); }
.room-card .room-num { font-size:16px; font-weight:800; }
.room-card .room-type { font-size:10px; color:var(--text2); margin-top:2px; }
.room-card .room-pct { font-size:11px; margin-top:4px; }

/* Room Detail Drawer */
.drawer-overlay { position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,.6); z-index:1000; display:flex; justify-content:flex-end; }
.drawer { width:560px; max-width:90vw; height:100vh; background:var(--bg); border-left:1px solid var(--border); overflow-y:auto; padding:24px; animation:slideIn .2s ease; }
@keyframes slideIn { from { transform:translateX(100%); } to { transform:translateX(0); } }
.drawer-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; }
.drawer-header h2 { font-size:20px; font-weight:800; }
.drawer-close { background:none; border:none; color:var(--text2); font-size:24px; cursor:pointer; padding:4px 10px; }
.drawer-close:hover { color:var(--text); }
.drawer-section { margin-bottom:20px; }
.drawer-section h3 { font-size:14px; font-weight:700; margin-bottom:10px; color:var(--text2); text-transform:uppercase; letter-spacing:.5px; }

.item-row { display:flex; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid var(--border); font-size:13px; }
.item-row .item-name { flex:1; }
.item-status-select { background:var(--surface); border:1px solid var(--border); color:var(--text); padding:4px 8px; border-radius:6px; font:12px 'Inter'; cursor:pointer; }
.item-status-select:focus { border-color:var(--accent); outline:none; }

/* Photo gallery */
.photo-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(120px,1fr)); gap:8px; }
.photo-thumb { border-radius:8px; overflow:hidden; aspect-ratio:1; cursor:pointer; border:2px solid var(--border); transition:.2s; }
.photo-thumb:hover { border-color:var(--accent); }
.photo-thumb img { width:100%; height:100%; object-fit:cover; }
.photo-upload { border:2px dashed var(--border); border-radius:8px; padding:20px; text-align:center; cursor:pointer; color:var(--text2); font-size:13px; transition:.2s; }
.photo-upload:hover { border-color:var(--accent); color:var(--text); }

/* Inventory bars */
.inv-bar { display:flex; height:20px; border-radius:4px; overflow:hidden; background:var(--border); }
.inv-bar .bar-seg { height:100%; transition:.3s; }
.bar-ordered { background:var(--amber); }
.bar-received { background:var(--cyan); }
.bar-installed { background:var(--green); }
.bar-damaged { background:var(--red); }

/* Punch items */
.punch-item { display:flex; gap:10px; padding:10px; background:var(--surface); border:1px solid var(--border); border-radius:8px; margin-bottom:8px; }
.punch-priority { width:4px; border-radius:2px; flex-shrink:0; }
.punch-priority.p-low { background:var(--text2); }
.punch-priority.p-normal { background:var(--amber); }
.punch-priority.p-high { background:var(--red); }
.punch-priority.p-critical { background:#dc2626; }

/* Item Detail Modal */
.item-modal-overlay { position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,.7); z-index:2000; display:flex; align-items:center; justify-content:center; backdrop-filter:blur(4px); }
.item-modal { width:720px; max-width:92vw; max-height:90vh; background:var(--bg); border:1px solid var(--border); border-radius:var(--radius); overflow-y:auto; animation:modalIn .2s ease; }
@keyframes modalIn { from { opacity:0; transform:scale(.95) translateY(20px); } to { opacity:1; transform:scale(1) translateY(0); } }
.item-modal-header { display:flex; justify-content:space-between; align-items:flex-start; padding:24px 24px 16px; border-bottom:1px solid var(--border); background:var(--surface); position:sticky; top:0; z-index:1; }
.item-modal-header h2 { font-size:18px; font-weight:800; }
.item-modal-header .item-cat { font-size:12px; color:var(--text2); margin-top:4px; }
.item-modal-body { padding:24px; }

.spec-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:20px; }
.spec-card { background:var(--surface); border:1px solid var(--border); border-radius:8px; padding:14px; }
.spec-card .spec-label { font-size:10px; text-transform:uppercase; letter-spacing:.5px; color:var(--text2); font-weight:600; margin-bottom:6px; }
.spec-card .spec-value { font-size:14px; font-weight:600; word-break:break-word; }
.spec-card .spec-value.editable { cursor:pointer; border-bottom:1px dashed var(--border); padding-bottom:2px; }
.spec-card .spec-value.editable:hover { border-color:var(--accent); color:var(--accent2); }

.qty-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-bottom:20px; }
.qty-box { background:var(--surface); border:1px solid var(--border); border-radius:8px; padding:14px; text-align:center; }
.qty-box .qty-num { font-size:28px; font-weight:800; }
.qty-box .qty-label { font-size:10px; text-transform:uppercase; letter-spacing:.5px; color:var(--text2); margin-top:4px; }
.qty-box.q-ordered .qty-num { color:var(--amber); }
.qty-box.q-received .qty-num { color:var(--cyan); }
.qty-box.q-installed .qty-num { color:var(--green); }
.qty-box.q-damaged .qty-num { color:var(--red); }

.item-section { margin-bottom:20px; }
.item-section h4 { font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.5px; color:var(--text2); margin-bottom:10px; padding-bottom:6px; border-bottom:1px solid var(--border); }

.floor-breakdown { width:100%; border-collapse:collapse; font-size:12px; }
.floor-breakdown th { text-align:left; padding:6px 10px; background:var(--surface2); color:var(--text2); font-size:10px; text-transform:uppercase; }
.floor-breakdown td { padding:5px 10px; border-top:1px solid var(--border); }
.floor-breakdown tr:hover td { background:rgba(99,102,241,.04); }

.edit-input { background:var(--surface); border:1px solid var(--border); color:var(--text); padding:6px 10px; border-radius:6px; font:13px 'Inter'; width:100%; }
.edit-input:focus { border-color:var(--accent); outline:none; }

.item-row.clickable { cursor:pointer; transition:.15s; }
.item-row.clickable:hover { background:rgba(99,102,241,.06); border-radius:4px; }
.item-row .item-detail-hint { font-size:10px; color:var(--text2); margin-top:2px; }
.item-row .item-supplier { font-size:10px; color:var(--accent2); }

tr.clickable-row { cursor:pointer; transition:.15s; }
tr.clickable-row:hover td { background:rgba(99,102,241,.08) !important; }

.item-image-placeholder { width:100%; height:160px; background:var(--surface); border:2px dashed var(--border); border-radius:8px; display:flex; align-items:center; justify-content:center; color:var(--text2); font-size:13px; cursor:pointer; transition:.2s; }
.item-image-placeholder:hover { border-color:var(--accent); color:var(--accent2); }
.item-image-preview { width:100%; max-height:240px; object-fit:contain; border-radius:8px; border:1px solid var(--border); }

.btn-secondary { background:var(--surface); color:var(--text); border:1px solid var(--border); padding:6px 14px; border-radius:6px; font:500 12px 'Inter'; cursor:pointer; transition:.2s; }
.btn-secondary:hover { border-color:var(--accent); color:var(--accent2); }

@media(max-width:768px) {
  .grid-4,.grid-3,.grid-2 { grid-template-columns:1fr; }
  .cal-grid { grid-template-columns:repeat(7,1fr); }
  .cal-day { min-height:50px; padding:4px; }
  .cal-event { display:none; }
  .drawer { width:100vw; }
  .room-grid { grid-template-columns:repeat(auto-fill,minmax(80px,1fr)); }
  .item-modal { max-width:98vw; }
  .spec-grid { grid-template-columns:1fr; }
  .qty-grid { grid-template-columns:repeat(2,1fr); }
}
