/* ============================================
   MANTIS RFID - Warehouse Dashboard Styles
   ============================================ */

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

:root {
    --bg-dark: #0a0a0f;
    --bg-card: #12131a;
    --bg-elevated: #1a1b24;
    --bg-hover: #22232e;
    --border: #2a2b36;
    --border-light: #3a3b46;
    --text-primary: #ffffff;
    --text-secondary: #8b8d98;
    --text-muted: #5c5e6a;
    --accent-green: #22c55e;
    --accent-green-dim: #166534;
    --accent-blue: #3b82f6;
    --accent-blue-dim: #1d4ed8;
    --accent-orange: #f97316;
    --accent-orange-dim: #c2410c;
    --accent-red: #ef4444;
    --accent-red-dim: #b91c1c;
    --accent-purple: #a855f7;
    --accent-cyan: #06b6d4;
    --accent-yellow: #eab308;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

/* Global Navigation Bar */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border);
    padding: 0 40px;
}
.top-nav .nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}
.top-nav .nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
}
.top-nav .nav-brand-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--bg-dark);
}
.top-nav .nav-brand-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
}
.top-nav .nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}
.top-nav .nav-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.top-nav .nav-link:hover {
    color: var(--text-primary);
    background: var(--border);
}
.top-nav .nav-link.active {
    color: #f97316;
    background: rgba(249, 115, 22, 0.1);
}
.top-nav .nav-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 8px;
}
.top-nav .nav-section-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-right: 4px;
}
.top-nav .nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
}
@media (max-width: 1024px) {
    .top-nav .nav-links {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: var(--bg-dark);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 16px;
        gap: 4px;
    }
    .top-nav .nav-links.open { display: flex; }
    .top-nav .nav-link { width: 100%; padding: 12px 16px; }
    .top-nav .nav-divider { width: 100%; height: 1px; margin: 8px 0; }
    .top-nav .nav-section-label { width: 100%; padding: 8px 16px 4px; }
    .top-nav .nav-toggle { display: block; }
    .top-nav { padding: 0 20px; }
}

/* Dashboard Layout */
.dashboard {
    height: calc(100vh - 56px);
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: var(--bg-card);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

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

.logo-icon {
    width: 44px;
    height: 44px;
    background: var(--accent-orange);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 22px;
    color: var(--bg-dark);
}

.logo-text {
    font-weight: 700;
    font-size: 20px;
}

.logo-text span {
    color: var(--accent-orange);
}

.header-info {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

.header-divider {
    color: var(--border);
}

.header-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 26px;
    color: var(--text-primary);
    font-weight: 600;
}

/* Main Layout */
.main-layout {
    flex: 1;
    display: grid;
    grid-template-columns: 260px 1fr 340px;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
}

.nav-item {
    padding: 14px 16px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 15px;
    font-weight: 500;
}

.nav-item:hover {
    background: var(--bg-hover);
}

.nav-item.active {
    background: var(--accent-green);
    color: var(--bg-dark);
}

.nav-item.active .nav-badge {
    background: var(--bg-dark);
    color: var(--accent-green);
}

.nav-icon {
    font-size: 20px;
    width: 28px;
    text-align: center;
}

.nav-label {
    flex: 1;
}

.nav-badge {
    background: var(--accent-red);
    color: white;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
}

.nav-badge.blue { background: var(--accent-blue); }
.nav-badge.orange { background: var(--accent-orange); }
.nav-badge.green { background: var(--accent-green); color: var(--bg-dark); }

/* Content Area */
.content {
    padding: 24px;
    overflow-y: auto;
    background: var(--bg-dark);
}

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

.page-title {
    font-size: 24px;
    font-weight: 700;
}

.search-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 320px;
}

.search-box input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    width: 100%;
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    cursor: pointer;
    transition: all 0.2s;
}

.stat-card:hover {
    border-color: var(--accent-green);
    transform: translateY(-2px);
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
}

.stat-value.green { color: var(--accent-green); }
.stat-value.blue { color: var(--accent-blue); }
.stat-value.orange { color: var(--accent-orange); }
.stat-value.red { color: var(--accent-red); }
.stat-value.purple { color: var(--accent-purple); }
.stat-value.cyan { color: var(--accent-cyan); }

.stat-change {
    font-size: 12px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-change.up { color: var(--accent-green); }
.stat-change.down { color: var(--accent-red); }
.stat-change.neutral { color: var(--text-muted); }

/* Project Cards Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    cursor: pointer;
    transition: all 0.2s;
}

.project-card:hover {
    border-color: var(--accent-green);
    transform: translateY(-2px);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}

.project-name {
    font-weight: 600;
    font-size: 16px;
}

.project-location {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

.status-badge {
    font-size: 10px;
    padding: 5px 12px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.active {
    background: var(--accent-green-dim);
    color: var(--accent-green);
}

.status-badge.pending {
    background: var(--accent-orange-dim);
    color: var(--accent-orange);
}

.progress-section {
    margin-bottom: 14px;
}

.progress-bar {
    height: 10px;
    background: var(--bg-elevated);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-green), var(--accent-cyan));
    border-radius: 5px;
    transition: width 0.5s ease;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}

.project-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.metric {
    text-align: center;
    padding: 10px;
    background: var(--bg-elevated);
    border-radius: 8px;
}

.metric-value {
    font-weight: 700;
    font-size: 18px;
    font-family: 'JetBrains Mono', monospace;
}

.metric-label {
    color: var(--text-muted);
    font-size: 11px;
    margin-top: 2px;
}

/* Activity Panel */
.activity-panel {
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 16px;
}

.activity-header {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.live-indicator {
    font-size: 12px;
    color: var(--accent-green);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.activity-list {
    flex: 1;
    overflow-y: auto;
}

.activity-item {
    padding: 14px;
    border-radius: 10px;
    background: var(--bg-elevated);
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.activity-item:hover {
    background: var(--bg-hover);
}

.activity-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.activity-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.activity-text strong {
    color: var(--text-primary);
}

.activity-tag {
    display: inline-block;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 6px;
    margin-top: 8px;
    text-transform: uppercase;
    font-weight: 600;
}

.activity-tag.scan { background: var(--accent-blue); }
.activity-tag.complete { background: var(--accent-green); color: var(--bg-dark); }
.activity-tag.alert { background: var(--accent-red); }
.activity-tag.ship { background: var(--accent-purple); }

.quick-actions {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Buttons */
.btn-primary {
    padding: 14px 24px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    background: var(--accent-green);
    color: var(--bg-dark);
    transition: all 0.2s;
}

.btn-primary:hover {
    background: #16a34a;
    transform: translateY(-1px);
}

.btn-secondary {
    padding: 14px 24px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    background: var(--bg-elevated);
    color: var(--text-primary);
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
}

.btn-small {
    padding: 8px 16px;
    font-size: 12px;
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: 14px;
    overflow: hidden;
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: var(--bg-elevated);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.data-table tr {
    cursor: pointer;
    transition: background 0.2s;
}

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

.data-table td {
    font-size: 14px;
}

.table-id {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: var(--accent-cyan);
}

.stage-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.stage-badge.fab { background: var(--accent-purple); }
.stage-badge.shipped { background: var(--accent-blue); }
.stage-badge.onsite { background: var(--accent-cyan); color: var(--bg-dark); }
.stage-badge.installing { background: var(--accent-orange); color: var(--bg-dark); }
.stage-badge.complete { background: var(--accent-green); color: var(--bg-dark); }
.stage-badge.punch { background: var(--accent-red); }

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 10px 20px;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-tab:hover {
    border-color: var(--accent-green);
    color: var(--text-primary);
}

.filter-tab.active {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: var(--bg-dark);
}

.filter-tab .count {
    margin-left: 6px;
    opacity: 0.7;
}

/* Cards List */
.cards-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.list-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.list-card:hover {
    border-color: var(--accent-green);
    transform: translateX(4px);
}

.list-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.list-card-icon.blue { background: rgba(59, 130, 246, 0.2); }
.list-card-icon.green { background: rgba(34, 197, 94, 0.2); }
.list-card-icon.orange { background: rgba(249, 115, 22, 0.2); }
.list-card-icon.purple { background: rgba(168, 85, 247, 0.2); }
.list-card-icon.red { background: rgba(239, 68, 68, 0.2); }

.list-card-content {
    flex: 1;
}

.list-card-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
}

.list-card-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

.list-card-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 20px;
    font-weight: 700;
}

/* Grid Cards */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
}

.info-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.info-card-title {
    font-weight: 600;
    font-size: 16px;
}

/* Crew Card */
.crew-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    cursor: pointer;
    transition: all 0.2s;
}

.crew-card:hover {
    border-color: var(--accent-blue);
}

.crew-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.crew-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}

.crew-name {
    font-weight: 600;
    font-size: 15px;
}

.crew-role {
    font-size: 12px;
    color: var(--text-muted);
}

.crew-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.crew-stat {
    background: var(--bg-elevated);
    padding: 10px;
    border-radius: 8px;
    text-align: center;
}

.crew-stat-value {
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.crew-stat-label {
    font-size: 10px;
    color: var(--text-muted);
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
}

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

.modal-body {
    padding: 24px;
}

/* Scan Modal */
.scan-modal {
    text-align: center;
}

.scan-area {
    padding: 40px 20px;
}

.scan-animation {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
}

.scan-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid var(--accent-green);
    border-radius: 50%;
    animation: scanRing 2s infinite;
}

.scan-ring:nth-child(1) { width: 60px; height: 60px; animation-delay: 0s; }
.scan-ring:nth-child(2) { width: 90px; height: 90px; animation-delay: 0.5s; }
.scan-ring:nth-child(3) { width: 120px; height: 120px; animation-delay: 1s; }

@keyframes scanRing {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(0.8); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.2); }
}

.scan-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 36px;
}

.scan-text {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.scan-hint {
    font-size: 14px;
    color: var(--text-muted);
}

.scan-result {
    padding: 24px;
    background: var(--bg-elevated);
    border-radius: 12px;
    margin: 20px;
}

.result-success {
    color: var(--accent-green);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
}

.result-id {
    font-family: 'JetBrains Mono', monospace;
    font-size: 28px;
    font-weight: 700;
    color: var(--accent-cyan);
    margin-bottom: 20px;
}

.result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Settings */
.settings-section {
    margin-bottom: 32px;
}

.settings-section h3 {
    font-size: 14px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 10px;
}

.setting-label {
    font-weight: 500;
}

.setting-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Toggle Switch */
.toggle {
    width: 52px;
    height: 28px;
    background: var(--bg-elevated);
    border-radius: 14px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
}

.toggle.active {
    background: var(--accent-green);
}

.toggle::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform 0.3s;
}

.toggle.active::after {
    transform: translateX(24px);
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
}

/* Priority Badge */
.priority {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.priority.high { background: rgba(239, 68, 68, 0.2); color: var(--accent-red); }
.priority.medium { background: rgba(249, 115, 22, 0.2); color: var(--accent-orange); }
.priority.low { background: rgba(34, 197, 94, 0.2); color: var(--accent-green); }

/* Timeline */
.timeline {
    position: relative;
    padding-left: 24px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-green);
    border: 2px solid var(--bg-dark);
}

.timeline-item.pending::before {
    background: var(--text-muted);
}

.timeline-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.timeline-content {
    font-size: 14px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state-text {
    font-size: 16px;
}
