/* ===== INKPACKOS DESIGN SYSTEM ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --ink-black: #0a0a0a;
    --ink-dark: #1a1a2e;
    --ink-blue: #16213e;
    --ink-accent: #e94560;
    --ink-accent-hover: #d63850;
    --ink-steel: #c4c4c4;
    --ink-light: #f0f0f0;
    --ink-white: #fafafa;
    --ink-surface: #111118;
    --ink-surface-2: #1a1a24;
    --ink-border: rgba(255,255,255,0.06);
    --ink-border-hover: rgba(255,255,255,0.12);
    --ink-text-muted: rgba(255,255,255,0.45);
    --sidebar-width: 220px;
    --status-operational: #10b981;
    --status-maintenance: #f59e0b;
    --status-offline: #ef4444;
    --status-decommissioned: #6b7280;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--ink-black);
    color: var(--ink-white);
    display: flex;
    min-height: 100vh;
}

h1, h2, h3, h4 { font-family: 'Space Grotesk', sans-serif; }

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--ink-surface);
    border-right: 1px solid var(--ink-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 50;
}

.sidebar-logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 18px; font-weight: 700;
    color: var(--ink-white);
    text-decoration: none;
    padding: 24px 20px;
    border-bottom: 1px solid var(--ink-border);
}
.sidebar-logo span { color: var(--ink-accent); }

.sidebar-nav {
    padding: 12px 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    color: var(--ink-text-muted);
    text-decoration: none;
    font-size: 14px; font-weight: 500;
    border-radius: 8px;
    transition: all 0.15s ease;
}
.nav-item:hover {
    background: rgba(255,255,255,0.04);
    color: var(--ink-white);
}
.nav-item.active {
    background: rgba(233,69,96,0.1);
    color: var(--ink-accent);
}
.nav-item svg { flex-shrink: 0; }

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--ink-border);
}
.sidebar-version {
    font-size: 11px;
    color: var(--ink-text-muted);
    letter-spacing: 0.5px;
}

/* ===== MAIN ===== */
.main {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 32px;
    max-width: 1200px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}
.page-header h1 {
    font-size: 28px; font-weight: 700;
}
.page-subtitle {
    color: var(--ink-text-muted);
    font-size: 14px;
    margin-top: 4px;
}
.header-actions {
    display: flex; gap: 8px;
}

.back-link {
    display: inline-block;
    color: var(--ink-accent);
    text-decoration: none;
    font-size: 13px;
    margin-bottom: 8px;
    transition: opacity 0.15s;
}
.back-link:hover { opacity: 0.8; }

/* ===== BUTTONS ===== */
.btn-primary {
    padding: 10px 20px;
    background: var(--ink-accent);
    color: white; font-weight: 600; font-size: 13px;
    border: none; border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'DM Sans', sans-serif;
    white-space: nowrap;
}
.btn-primary:hover { background: var(--ink-accent-hover); transform: translateY(-1px); }

.btn-secondary {
    padding: 10px 20px;
    background: transparent;
    color: var(--ink-white); font-weight: 500; font-size: 13px;
    border: 1px solid var(--ink-border-hover); border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'DM Sans', sans-serif;
    white-space: nowrap;
}
.btn-secondary:hover { border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.04); }

.btn-danger {
    padding: 10px 20px;
    background: transparent;
    color: #ef4444; font-weight: 500; font-size: 13px;
    border: 1px solid rgba(239,68,68,0.3); border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'DM Sans', sans-serif;
}
.btn-danger:hover { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.5); }

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

/* ===== STATS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--ink-surface);
    border: 1px solid var(--ink-border);
    border-radius: 10px;
    padding: 20px;
    transition: all 0.2s ease;
}
.stat-card:hover { border-color: var(--ink-border-hover); }
.stat-card.accent { border-color: rgba(233,69,96,0.2); }
.stat-label {
    font-size: 12px;
    color: var(--ink-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.stat-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 32px;
    font-weight: 700;
}

/* ===== STATUS BAR ===== */
.status-bar-container {
    margin-bottom: 24px;
}
.status-bar {
    display: flex;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    background: var(--ink-surface);
    margin-bottom: 8px;
}
.status-segment {
    height: 100%;
    transition: width 0.5s ease;
}
.status-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.status-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--ink-text-muted);
}
.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
}

/* ===== FILTERS ===== */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--ink-surface);
    border: 1px solid var(--ink-border);
    border-radius: 8px;
    padding: 0 12px;
    flex: 1;
    min-width: 200px;
    transition: border-color 0.2s;
}
.search-box:focus-within { border-color: var(--ink-accent); }
.search-box svg { color: var(--ink-text-muted); flex-shrink: 0; }
.search-box input {
    background: none; border: none; outline: none;
    color: var(--ink-white);
    font-size: 14px;
    padding: 10px 0;
    width: 100%;
    font-family: 'DM Sans', sans-serif;
}
.search-box input::placeholder { color: var(--ink-text-muted); }

.filter-select {
    background: var(--ink-surface);
    border: 1px solid var(--ink-border);
    border-radius: 8px;
    color: var(--ink-white);
    padding: 10px 12px;
    font-size: 13px;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    min-width: 140px;
    -webkit-appearance: none;
    transition: border-color 0.2s;
}
.filter-select:focus { border-color: var(--ink-accent); outline: none; }
.filter-select option { background: var(--ink-surface); color: var(--ink-white); }

/* ===== TABLE ===== */
.table-container {
    background: var(--ink-surface);
    border: 1px solid var(--ink-border);
    border-radius: 10px;
    overflow: hidden;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 600;
    color: var(--ink-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--ink-border);
    background: rgba(255,255,255,0.01);
}
.data-table td {
    padding: 14px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--ink-border);
    vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,0.02); }

.equip-name {
    font-weight: 600;
    color: var(--ink-white);
}
.equip-brand {
    font-size: 12px;
    color: var(--ink-text-muted);
}
.equip-link {
    color: var(--ink-white);
    text-decoration: none;
    transition: color 0.15s;
}
.equip-link:hover { color: var(--ink-accent); }

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.2px;
}
.status-badge::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
}
.status-badge.operational {
    background: rgba(16,185,129,0.1);
    color: #10b981;
}
.status-badge.operational::before { background: #10b981; }
.status-badge.maintenance {
    background: rgba(245,158,11,0.1);
    color: #f59e0b;
}
.status-badge.maintenance::before { background: #f59e0b; }
.status-badge.offline {
    background: rgba(239,68,68,0.1);
    color: #ef4444;
}
.status-badge.offline::before { background: #ef4444; }
.status-badge.decommissioned {
    background: rgba(107,114,128,0.1);
    color: #6b7280;
}
.status-badge.decommissioned::before { background: #6b7280; }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--ink-text-muted);
    font-size: 14px;
}

.row-actions {
    display: flex;
    gap: 4px;
}
.row-action {
    padding: 4px 8px;
    background: none; border: none;
    color: var(--ink-text-muted);
    cursor: pointer;
    border-radius: 4px;
    font-size: 13px;
    transition: all 0.15s;
}
.row-action:hover { color: var(--ink-white); background: rgba(255,255,255,0.06); }
.row-action.danger:hover { color: #ef4444; background: rgba(239,68,68,0.1); }

/* ===== DETAIL VIEW ===== */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 32px;
}
.detail-card {
    background: var(--ink-surface);
    border: 1px solid var(--ink-border);
    border-radius: 10px;
    padding: 24px;
}
.detail-card h3 {
    font-size: 14px;
    color: var(--ink-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}
.detail-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.detail-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--ink-border);
}
.detail-field:last-child { border-bottom: none; padding-bottom: 0; }
.detail-label {
    font-size: 13px;
    color: var(--ink-text-muted);
}
.detail-value {
    font-size: 14px;
    font-weight: 500;
    text-align: right;
}

/* ===== TIMELINE ===== */
.timeline-section {
    background: var(--ink-surface);
    border: 1px solid var(--ink-border);
    border-radius: 10px;
    padding: 24px;
}
.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.timeline-header h3 {
    font-size: 16px;
    font-weight: 600;
}
.timeline {
    position: relative;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0; bottom: 0;
    width: 2px;
    background: var(--ink-border);
}
.timeline-item {
    position: relative;
    padding-left: 44px;
    padding-bottom: 28px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
    position: absolute;
    left: 8px; top: 2px;
    width: 16px; height: 16px;
    border-radius: 50%;
    border: 3px solid var(--ink-accent);
    background: var(--ink-black);
    z-index: 1;
}
.timeline-dot.completed { border-color: var(--status-operational); }
.timeline-dot.in_progress { border-color: var(--status-maintenance); }
.timeline-dot.scheduled { border-color: var(--ink-steel); }
.timeline-date {
    font-size: 12px;
    color: var(--ink-text-muted);
    margin-bottom: 4px;
}
.timeline-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}
.timeline-desc {
    font-size: 13px;
    color: var(--ink-steel);
    line-height: 1.5;
}
.timeline-meta {
    display: flex;
    gap: 16px;
    margin-top: 6px;
    font-size: 12px;
    color: var(--ink-text-muted);
}
.timeline-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ===== CUSTOMER GRID ===== */
.customer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}
.customer-card {
    background: var(--ink-surface);
    border: 1px solid var(--ink-border);
    border-radius: 10px;
    padding: 24px;
    transition: all 0.2s ease;
    cursor: default;
}
.customer-card:hover {
    border-color: var(--ink-border-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.customer-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}
.customer-name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 16px;
    font-weight: 600;
}
.customer-equip-count {
    font-size: 12px;
    color: var(--ink-accent);
    background: rgba(233,69,96,0.1);
    padding: 2px 8px;
    border-radius: 100px;
    white-space: nowrap;
}
.customer-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}
.customer-detail {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--ink-steel);
}
.customer-detail svg { flex-shrink: 0; color: var(--ink-text-muted); }
.customer-actions {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--ink-border);
}

/* ===== MODALS ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--ink-surface-2);
    border: 1px solid var(--ink-border-hover);
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--ink-border);
}
.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}
.modal-close {
    background: none; border: none;
    color: var(--ink-text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.15s;
}
.modal-close:hover { color: var(--ink-white); background: rgba(255,255,255,0.06); }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 24px;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-group.full-width { grid-column: 1 / -1; }
.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-steel);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.form-group input,
.form-group select,
.form-group textarea {
    background: var(--ink-surface);
    border: 1px solid var(--ink-border);
    border-radius: 6px;
    color: var(--ink-white);
    padding: 10px 12px;
    font-size: 14px;
    font-family: 'DM Sans', sans-serif;
    transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--ink-accent);
    outline: none;
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--ink-text-muted); }
.form-group textarea { resize: vertical; }
.form-group select option { background: var(--ink-surface); }

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid var(--ink-border);
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 24px; right: 24px;
    padding: 12px 20px;
    background: var(--ink-surface-2);
    border: 1px solid var(--ink-border-hover);
    border-radius: 8px;
    font-size: 14px;
    color: var(--ink-white);
    z-index: 300;
    animation: slideUp 0.3s ease;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}
.toast.success { border-left: 3px solid var(--status-operational); }
.toast.error { border-left: 3px solid #ef4444; }

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main { margin-left: 0; padding: 20px; }
    .detail-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .filter-bar { flex-direction: column; }
    .filter-select { min-width: auto; width: 100%; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
