/* POC Manager - Styles */

:root {
    --primary: #FFB400;
    --primary-dark: #E6A200;
    --primary-light: #FFF4D6;
    --success: #059669;
    --success-light: #d1fae5;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --info: #555555;
    --info-light: #eeeeee;
    --sidebar-bg: #1a1a1a;
    --sidebar-hover: #2a2a2a;
    --sidebar-active: #333333;
    --sidebar-text: #b0b0b0;
    --sidebar-text-active: #FFB400;
    --bg: #f5f5f5;
    --card-bg: #ffffff;
    --text: #222222;
    --text-secondary: #666666;
    --border: #e0e0e0;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-lg: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
    --radius: 8px;
    --sidebar-width: 240px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

/* ── Login ──────────────────────────────────────────────── */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a1a 0%, #000000 100%);
}

.login-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 48px 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    font-size: 1.75rem;
    color: var(--text);
    margin-bottom: 4px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.login-field {
    margin-bottom: 20px;
}

.login-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.login-field input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.login-field input:focus {
    outline: none;
    border-color: var(--primary);
}

.login-error {
    background: var(--danger-light);
    color: var(--danger);
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: #1a1a1a;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.login-btn:hover { background: var(--primary-dark); }
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── App Shell ─────────────────────────────────────────── */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 24px 20px 20px;
    border-bottom: 1px solid var(--sidebar-hover);
}

.sidebar-header h2 {
    color: var(--sidebar-text-active);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.sidebar-nav {
    list-style: none;
    padding: 12px 0;
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-active);
}

.nav-link.active {
    background: var(--sidebar-active);
    color: var(--sidebar-text-active);
    border-left-color: var(--primary);
}

.nav-icon {
    font-size: 0.85rem;
    width: 18px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--sidebar-hover);
}

.user-info {
    margin-bottom: 12px;
}

.user-name {
    display: block;
    color: var(--sidebar-text-active);
    font-weight: 600;
    font-size: 0.9rem;
}

.user-role {
    display: block;
    color: var(--sidebar-text);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-footer-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.sidebar-btn {
    flex: 1;
    padding: 8px 10px;
    background: var(--sidebar-hover);
    color: var(--sidebar-text);
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
}

.sidebar-btn:hover {
    background: #475569;
    color: var(--sidebar-text-active);
}

.sidebar-btn.full-width {
    flex: none;
    width: 100%;
}

/* ── Content Area ──────────────────────────────────────── */
.content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    overflow-x: hidden;
    max-width: calc(100vw - var(--sidebar-width));
}

.pane { display: none; }
.pane.active { display: block; }

.pane-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 24px 32px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.pane-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    min-width: 0;
}

.pane-header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pane-body {
    padding: 24px 32px;
    overflow-y: auto;
    max-height: calc(100vh - 85px);
}

/* ── Buttons ───────────────────────────────────────────── */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary { background: var(--primary); color: #1a1a1a; font-weight: 600; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.full-width { width: 100%; }

/* ── Form Sections ─────────────────────────────────────── */
.form-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.form-section h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--bg);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width { grid-column: 1 / -1; }

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-row.three-col { grid-template-columns: 1fr 1fr 1fr; }

.form-error {
    background: var(--danger-light);
    color: var(--danger);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.section-hint {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 12px;
}

/* ── List Items (objectives, scope, assumptions) ───────── */
.list-items {
    margin-bottom: 10px;
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg);
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.list-item button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0 4px;
    line-height: 1;
}

.list-item button:hover { color: var(--danger); }

.add-item-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.add-item-row select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    background: #fff;
    min-width: 200px;
    max-width: 100%;
}

.add-item-row select:focus { outline: none; border-color: var(--primary); }

.add-item-row input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
}

.add-item-row input:focus { outline: none; border-color: var(--primary); }

.add-item-row button {
    padding: 8px 16px;
    background: var(--primary);
    color: #1a1a1a;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

.add-item-row button:hover { background: var(--primary-dark); }

/* ── Inline Edit Icons & Forms ─────────────────────────── */
.inline-edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 2px 6px;
    margin-left: 8px;
    border-radius: 4px;
    vertical-align: middle;
    transition: color 0.15s, background 0.15s;
}
.inline-edit-btn:hover {
    color: var(--primary);
    background: rgba(255, 180, 0, 0.1);
}

.inline-edit-form {
    padding: 8px 0;
}
.inline-edit-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
}
.inline-edit-form label input,
.inline-edit-form label select,
.inline-edit-form label textarea {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    box-sizing: border-box;
}
.inline-edit-form label input:focus,
.inline-edit-form label textarea:focus,
.inline-edit-form label select:focus {
    outline: none;
    border-color: var(--primary);
}

.inline-edit-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

/* Inline list editing */
.ie-list-items {
    margin-bottom: 8px;
}
.ie-list-item {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 4px;
}
.ie-list-item input[type="text"] {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.85rem;
}
.ie-list-item input:focus { outline: none; border-color: var(--primary); }
.ie-remove-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
}
.ie-remove-btn:hover { color: var(--danger); background: rgba(220,53,69,0.08); }

/* Inline deliverable rows */
.ie-del-row select { width: 100px; padding: 6px; border: 1px solid var(--border); border-radius: 4px; font-size: 0.85rem; }
.ie-del-row input[type="date"] { width: 130px; padding: 6px; border: 1px solid var(--border); border-radius: 4px; font-size: 0.85rem; }

.empty-hint {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-style: italic;
    padding: 8px 0;
}

/* ── Contacts ──────────────────────────────────────────── */
.contacts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.contact-card {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 16px;
}

.contact-card h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 10px;
}

.contact-card input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.contact-card input:focus { outline: none; border-color: var(--primary); }

/* ── Responsibility Matrix ─────────────────────────────── */
.responsibility-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.responsibility-column {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 16px;
    max-height: 400px;
    overflow-y: auto;
}

.responsibility-column h3 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.two-column-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.column-section h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 10px;
}

/* ── Map ───────────────────────────────────────────────── */
.map-search-container {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.map-search-container input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
}

.map-search-container input:focus { outline: none; border-color: var(--primary); }

.map-search-container button {
    padding: 10px 20px;
    background: var(--primary);
    color: #1a1a1a;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

/* ── Map + Camera List Side-by-Side ────────────────────── */
.map-and-list {
    display: flex;
    gap: 0;
    height: calc(100vh - 200px);
    min-height: 500px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
}

.map-and-list .camera-list-container {
    width: 33.333%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border-right: 1px solid var(--border);
    overflow: hidden;
    min-height: 0;
}

.map-and-list .camera-list-toolbar {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.map-and-list .bulk-action-bar {
    flex-shrink: 0;
}

.map-and-list .camera-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    min-height: 0;
}

.map-container {
    position: relative;
    flex: 1;
    overflow: hidden;
}

#map, #detailMap { height: 100%; width: 100%; }

.add-camera-fab {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: #1a1a1a;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-camera-fab:hover { background: var(--primary-dark); }

.map-controls {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 1000;
}

.map-controls button {
    padding: 8px 14px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.map-controls button:hover { background: var(--bg); }

/* ── Camera List ───────────────────────────────────────── */
.camera-list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.camera-list-toolbar h3 {
    font-size: 1rem;
    margin: 0;
}

.camera-progress {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-left: 8px;
}

.camera-toolbar-actions {
    display: flex;
    gap: 6px;
}

.bulk-action-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 10px;
}

.selected-count {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.bulk-actions {
    margin-left: auto;
    display: flex;
    gap: 6px;
}

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

.camera-select {
    margin-right: 10px;
    display: flex;
    align-items: center;
}

.camera-select input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.camera-list-container h3 {
    font-size: 1rem;
    margin: 0;
}

.camera-list { display: flex; flex-direction: column; gap: 8px; }

.camera-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg);
    border-radius: var(--radius);
    border-left: 4px solid var(--border);
}

.camera-card.configured { border-left-color: var(--success); }
.camera-card.pending { border-left-color: var(--warning); }

.camera-header { display: flex; align-items: center; gap: 12px; }

.camera-id {
    font-weight: 700;
    font-size: 0.9rem;
}

.camera-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
}

.camera-status.configured { background: var(--success-light); color: var(--success); }
.camera-status.pending { background: var(--warning-light); color: var(--warning); }

.camera-details {
    flex: 1;
    margin: 0 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.camera-details p { margin: 0; }

.camera-actions {
    display: flex;
    gap: 6px;
}

.camera-actions button {
    padding: 6px 10px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
}

.camera-actions button:hover { background: var(--bg); }
.camera-actions .delete-btn:hover { background: var(--danger-light); color: var(--danger); }

.empty-state {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* ── Import Section ────────────────────────────────────── */
.import-section {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}

.import-section h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.import-tabs {
    display: flex;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border);
    width: fit-content;
    margin-bottom: 12px;
}

.import-tab {
    padding: 8px 20px;
    border: none;
    background: var(--card-bg);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.15s;
}

.import-tab.active { background: var(--primary); color: #1a1a1a; font-weight: 700; }
.import-tab:hover:not(.active) { background: var(--border); }

.import-tab-content { display: none; }
.import-tab-content.active { display: block; }

.import-file-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-hint {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ── Modal ─────────────────────────────────────────────── */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 28px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-content.modal-wide { max-width: 700px; }
.modal-content.modal-narrow { max-width: 400px; }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.close-btn:hover { color: var(--text); }

.modal-subheading {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin: 16px 0 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.count-label {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
}

/* ── Mapping Modal ─────────────────────────────────────── */
.mapping-fields { margin-bottom: 16px; }

.mapping-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.mapping-row label {
    width: 120px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: right;
    flex-shrink: 0;
}

.mapping-row label.required { color: var(--primary); }

.mapping-row select {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
}

.auto-badge {
    font-size: 0.7rem;
    background: var(--success-light);
    color: var(--success);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.mapping-preview-table {
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.mapping-preview-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.mapping-preview-table th {
    background: var(--primary);
    color: #1a1a1a;
    padding: 6px 10px;
    text-align: left;
    font-weight: 600;
}

.mapping-preview-table td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--border);
}

/* ── ASDPX Import ──────────────────────────────────────── */
.asdpx-project-info { margin-bottom: 16px; }

.asdpx-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 24px;
    padding: 12px 14px;
    background: var(--primary-light);
    border-radius: var(--radius);
    margin-bottom: 10px;
}

.asdpx-info-item { display: flex; flex-direction: column; }

.asdpx-info-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}

.asdpx-info-value {
    font-size: 0.9rem;
    font-weight: 600;
}

.asdpx-stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.asdpx-stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 600;
}

.asdpx-stat.camera { background: var(--primary-light); color: var(--primary-dark); }
.asdpx-stat.radar { background: var(--info-light); color: var(--info); }
.asdpx-stat.warning { background: var(--warning-light); color: var(--warning); }

.asdpx-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.asdpx-device-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
}

.asdpx-select-all {
    position: sticky;
    top: 0;
    background: var(--bg);
    padding: 8px 14px;
    border-bottom: 2px solid var(--border);
    z-index: 1;
}

.asdpx-device-row {
    padding: 8px 14px;
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
}

.asdpx-device-row:last-child { border-bottom: none; }
.asdpx-device-row:hover { background: var(--primary-light); }
.asdpx-device-row.no-coords-row { background: var(--warning-light); }

.asdpx-device-row .checkbox-label { align-items: flex-start; }

.asdpx-device-icon {
    flex-shrink: 0;
    margin-top: 1px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.asdpx-device-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.asdpx-device-name {
    font-weight: 600;
    font-size: 0.85rem;
}

.asdpx-device-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.no-coords { color: var(--warning); font-weight: 600; }

.asdpx-summary-bar {
    padding: 10px 14px;
    background: var(--warning-light);
    border: 1px solid #fcd34d;
    border-radius: var(--radius);
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: #92400e;
}

/* ── Dashboard ─────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
}

.stat-card.success { border-left-color: var(--success); }
.stat-card.warning { border-left-color: var(--warning); }
.stat-card.info { border-left-color: var(--info); }

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.dashboard-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.dashboard-section h2 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

/* ── Project Table ─────────────────────────────────────── */
.project-table {
    width: 100%;
    border-collapse: collapse;
}

.project-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
}

.project-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.project-table tr:hover td { background: var(--bg); }

.project-table .project-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.project-table .project-link:hover { text-decoration: underline; }

/* ── Status Badges ─────────────────────────────────────── */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.status-badge.draft { background: var(--border); color: var(--text-secondary); }
.status-badge.planning { background: var(--primary-light); color: var(--primary-dark); }
.status-badge.active { background: var(--success-light); color: var(--success); }
.status-badge.review { background: var(--warning-light); color: var(--warning); }
.status-badge.completed { background: #e0e7ff; color: #3730a3; }

/* ── Project Detail ────────────────────────────────────── */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.detail-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.detail-section.full-width { grid-column: 1 / -1; }

.detail-section h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.detail-field {
    margin-bottom: 10px;
}

.detail-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
}

.detail-value {
    font-size: 0.9rem;
}

.detail-list {
    list-style: none;
}

.detail-list li {
    padding: 6px 0;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--bg);
}

.detail-list li:last-child { border-bottom: none; }

/* ── Gantt Chart ───────────────────────────────────────── */
.gantt-container {
    overflow-x: auto;
    margin-top: 12px;
}

.gantt-chart {
    min-width: 600px;
}

.gantt-row {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
    min-height: 36px;
}

.gantt-label {
    width: 180px;
    flex-shrink: 0;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gantt-bar-area {
    flex: 1;
    position: relative;
    height: 28px;
}

.gantt-bar {
    position: absolute;
    height: 20px;
    top: 4px;
    border-radius: 4px;
    font-size: 0.7rem;
    line-height: 20px;
    padding: 0 6px;
    color: white;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 4px;
}

.gantt-bar.draft { background: #94a3b8; }
.gantt-bar.planning { background: var(--primary); }
.gantt-bar.active { background: var(--success); }
.gantt-bar.review { background: var(--warning); }
.gantt-bar.completed { background: #6366f1; }

.gantt-header {
    display: flex;
    border-bottom: 2px solid var(--border);
}

.gantt-header .gantt-label {
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
}

.gantt-header .gantt-bar-area {
    display: flex;
    height: auto;
}

.gantt-month {
    flex: 1;
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 600;
    padding: 6px 0;
    border-left: 1px solid var(--border);
}

.gantt-today-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--danger);
    z-index: 2;
}

/* Gantt party headers */
.gantt-party-header {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 6px 12px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

/* Gantt party bar colors */
.gantt-bar.bar-axis { background: var(--primary); color: #1a1a1a; }
.gantt-bar.bar-city { background: #1a1a1a; color: #fff; }
.gantt-bar.bar-integrator { background: #666; color: #fff; }

/* Draggable Gantt bars */
.gantt-bar-draggable { cursor: grab; position: relative; }
.gantt-bar-draggable:active, .gantt-bar-grabbing { cursor: grabbing; }
.gantt-bar-draggable:hover { filter: brightness(1.1); box-shadow: 0 2px 6px rgba(0,0,0,0.2); }

.gantt-bar-text {
    position: relative;
    z-index: 1;
    pointer-events: none;
}

/* Resize handles on Gantt bars */
.gantt-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 7px;
    cursor: ew-resize;
    z-index: 2;
    border-radius: 2px;
    transition: background 0.15s;
}

.gantt-handle-left {
    left: 0;
    border-right: 2px solid rgba(0,0,0,0.15);
}

.gantt-handle-right {
    right: 0;
    border-left: 2px solid rgba(0,0,0,0.15);
}

.gantt-handle:hover {
    background: rgba(0,0,0,0.15);
}

/* Floating date label shown during Gantt drag */
.gantt-drag-date-label {
    display: none;
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a1a;
    color: #FFB400;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 10;
    pointer-events: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* ── Deliverables Editor ───────────────────────────────── */
.deliverables-editor {
    margin-bottom: 12px;
}

.deliverable-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 6px;
    background: #fff;
}

.deliverable-party-tag {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 3px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}

.deliverable-title {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 500;
}

.deliverable-dates {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.deliverable-item button {
    background: none;
    border: none;
    color: var(--danger);
    font-size: 1.1rem;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0 4px;
}

.add-deliverable-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.add-deliverable-row select,
.add-deliverable-row input[type="text"] {
    flex: 1;
    min-width: 120px;
}

.add-deliverable-row input[type="date"] {
    width: 140px;
}

.add-deliverable-row button {
    flex-shrink: 0;
}

/* ── Detail Map Edit Controls ──────────────────────────── */
.detail-map-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.detail-map-controls label {
    font-weight: 500;
}

.detail-map-controls input {
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 1px 4px;
    font-size: 12px;
}

.detail-map-controls .btn-sm {
    background: var(--primary);
    color: #1a1a1a;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 600;
}

/* ── User Management ───────────────────────────────────── */
.users-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

.users-table th {
    text-align: left;
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
}

.users-table td {
    padding: 8px 12px;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
}

.role-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.role-badge.editor { background: var(--success-light); color: var(--success); }
.role-badge.viewer { background: var(--primary-light); color: var(--primary-dark); }

/* ── Detail Map ────────────────────────────────────────── */
.detail-map-panel {
    height: calc(100vh - 280px);
    min-height: 400px;
}

.detail-map-panel .camera-card.compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.15s;
}

.detail-map-panel .camera-card.compact:hover {
    background: var(--bg);
}

.detail-map-panel .camera-card.compact .camera-id {
    font-size: 0.8rem;
    font-weight: 600;
}

.detail-map-panel .camera-card.compact .camera-status {
    font-size: 0.7rem;
}

.detail-map-panel .camera-card.compact .camera-model {
    font-size: 0.72rem;
    color: var(--text-muted);
    flex: 1;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-map-panel .camera-card.compact.active {
    background: var(--primary-light);
    border-left-color: var(--primary);
}

/* ── Camera Edit Modal ─────────────────────────────────── */
.cam-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.cam-modal-overlay.open { opacity: 1; }

.cam-modal {
    background: var(--card-bg, #fff);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 520px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.2s ease;
}
.cam-modal-overlay.open .cam-modal {
    transform: translateY(0) scale(1);
}

.cam-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.cam-modal-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}
.cam-modal-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0 4px;
    line-height: 1;
    transition: color 0.15s;
}
.cam-modal-close:hover { color: var(--danger); }

.cam-modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
}

.cam-modal-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 12px 20px;
    border-top: 1px solid var(--border);
}

.cam-modal-coords {
    display: flex;
    gap: 16px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-light, #f0f0f0);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.cam-field-group {
    margin-bottom: 8px;
}
.cam-field-group label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.cam-field-group input,
.cam-field-group select {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.82rem;
    background: var(--card-bg);
}
.cam-field-group input:focus,
.cam-field-group select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 180, 0, 0.15);
}

.cam-field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 0.82rem;
    border-bottom: 1px solid var(--border-light, #f0f0f0);
}
.cam-field-row label {
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.cam-field-row span {
    font-size: 0.82rem;
}

.cam-field-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.cam-field-row-3col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

/* Numbered map markers */
.numbered-marker {
    background: none;
    border: none;
}
.numbered-marker .marker-number {
    width: 28px;
    height: 28px;
    background: #1a1a1a;
    color: #FFB400;
    border: 2px solid #FFB400;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

/* Blue dot camera markers */
.blue-dot-marker {
    background: none;
    border: none;
}
.blue-dot-marker .dot-inner {
    width: 22px;
    height: 22px;
    background: #2196F3;
    border: 2px solid #fff;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

/* ── Wizard ─────────────────────────────────────────────── */
.wizard-indicator {
    padding: 16px 32px 0;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
}

.wizard-steps {
    display: flex;
    align-items: center;
    gap: 0;
    overflow-x: auto;
}

.wizard-step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    transition: all 0.15s;
}

.wizard-step:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -1px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 6px solid var(--border);
}

.wizard-step-number {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--bg);
    color: var(--text-secondary);
    border: 2px solid var(--border);
    flex-shrink: 0;
    transition: all 0.15s;
}

.wizard-step-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: color 0.15s;
}

.wizard-step.active .wizard-step-number {
    background: var(--primary);
    color: #1a1a1a;
    border-color: var(--primary);
}

.wizard-step.active .wizard-step-title {
    color: var(--text);
}

.wizard-step.completed .wizard-step-number {
    background: var(--success-light);
    color: var(--success);
    border-color: var(--success);
}

.wizard-step.completed .wizard-step-title {
    color: var(--success);
}

.wizard-step.skipped .wizard-step-number {
    background: var(--warning-light);
    color: var(--warning);
    border-color: var(--warning);
}

.wizard-step.skipped .wizard-step-title {
    color: var(--warning);
}

.wizard-step:hover .wizard-step-title {
    color: var(--text);
}

.wizard-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    margin-top: 12px;
    border-top: 2px solid var(--border);
}

.wizard-nav-center {
    flex: 1;
    text-align: center;
}

.wizard-step-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.wizard-nav-right {
    display: flex;
    gap: 8px;
}

/* When in wizard mode, hide form sections that aren't active */
.project-form-body.wizard-mode [data-wizard-step] {
    display: none;
}

.project-form-body.wizard-mode [data-wizard-step].wizard-active {
    display: block;
}

.wizard-import-summary {
    margin-top: 16px;
    padding: 12px 16px;
    background: var(--success-light);
    border: 1px solid var(--success);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--success);
}

/* ── ASDPX Model Mapping ──────────────────────────────── */
.asdpx-model-mapping {
    margin-top: 16px;
    border-top: 1px solid var(--border);
    padding-top: 12px;
}
.asdpx-model-mapping h4 {
    margin: 0 0 4px;
    font-size: 15px;
    color: var(--text);
}
.asdpx-model-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    max-height: 260px;
    overflow-y: auto;
}
.asdpx-model-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    background: var(--bg-light);
    border: 1px solid var(--border);
}
.asdpx-model-row.mapping-saved {
    border-left: 3px solid var(--success);
}
.asdpx-model-row.mapping-new {
    border-left: 3px solid var(--warning, #f59e0b);
}
.asdpx-model-pid {
    display: flex;
    flex-direction: column;
    min-width: 200px;
    gap: 4px;
}
.pid-header {
    display: flex;
    align-items: center;
    gap: 8px;
}
.pid-count {
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
}
.pid-specs {
    font-size: 11px;
    color: var(--text-muted);
}
.pid-names {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.pid-name-tag {
    display: inline-block;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 3px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    border: 1px solid rgba(59, 130, 246, 0.2);
}
.pid-name-more {
    font-size: 11px;
    color: var(--text-muted);
    padding: 1px 4px;
}
.pid-status {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.mapping-saved .pid-status { color: var(--success); }
.mapping-new .pid-status { color: var(--warning, #f59e0b); }
.asdpx-model-select {
    flex: 1;
    min-width: 200px;
}
.asdpx-model-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 13px;
    background: var(--bg);
    color: var(--text);
}
.asdpx-model-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .contacts-grid { grid-template-columns: 1fr; }
    .responsibility-grid { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar { display: none; }
    .content { margin-left: 0; }
    .form-grid { grid-template-columns: 1fr; }
    .two-column-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .form-row.three-col { grid-template-columns: 1fr; }
    .pane-header { flex-direction: column; gap: 12px; text-align: center; }
    .stats-grid { grid-template-columns: 1fr; }
    .map-and-list { flex-direction: column; height: auto; }
    .map-and-list .camera-list-container { width: 100%; max-height: 250px; border-right: none; border-bottom: 1px solid var(--border); }
    .map-and-list .map-container { height: 400px; }
}
