/* ==================== RESET & BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Hide number input spinners (up/down arrows) */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield; /* Firefox */
    appearance: textfield;
}

:root {
    --color-nav: #1a1a2e;
    --color-nav-hover: #16213e;
    --color-text: #1f2937;
    --color-text-light: #6b7280;
    --color-text-muted: #9ca3af;
    --color-bg: #f3f4f6;
    --color-bg-alt: #f9fafb;
    --color-white: #ffffff;
    --color-border: #e5e7eb;
    --color-border-light: #f3f4f6;
    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-primary-light: #eff6ff;
    --color-success: #059669;
    --color-success-light: #ecfdf5;
    --color-warning: #d97706;
    --color-warning-light: #fffbeb;
    --color-error: #dc2626;
    --color-error-light: #fef2f2;
    --color-info: #2563eb;
    --color-info-light: #eff6ff;
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
    --transition: 150ms ease;
}

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

body {
    min-height: 100vh;
}

/* ==================== LAYOUT ==================== */
.container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: var(--color-nav);
    color: var(--color-white);
    padding: 1.25rem 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 0 1.25rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-header h1 {
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 0.25rem;
}

.user-name {
    font-size: 0.75rem;
    opacity: 0.6;
    margin-bottom: 0.75rem;
}

.client-switcher {
    margin-top: 0.5rem;
}

.client-switcher label {
    display: block;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.5;
    margin-bottom: 0.25rem;
}

.client-switcher select {
    width: 100%;
    padding: 0.375rem 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
    color: white;
    font-size: 0.8125rem;
}

.client-switcher select option {
    background: var(--color-nav);
    color: white;
}

.content {
    flex: 1;
    margin-left: 240px;
    padding: 1.5rem 2rem;
    min-width: 0;
}

.content-full {
    flex: 1;
    padding: 1.5rem 2rem;
}

/* ==================== NAVIGATION ==================== */
.nav-links {
    list-style: none;
    padding: 0.75rem 0;
}

.nav-links li {
    margin: 0;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.8125rem;
    transition: all var(--transition);
    border-left: 3px solid transparent;
}

.nav-links a:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.05);
    text-decoration: none;
}

.nav-links a.active {
    color: var(--color-white);
    background: rgba(255, 255, 255, 0.08);
    border-left-color: var(--color-primary);
    font-weight: 500;
}

.admin-nav {
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 0.5rem;
}

.admin-nav h3 {
    padding: 0.5rem 1.25rem 0.25rem;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.4;
    font-weight: 500;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: auto;
}

.sidebar-footer .btn-secondary {
    display: block;
    text-align: center;
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all var(--transition);
}

.sidebar-footer .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    color: white;
    text-decoration: none;
}

.logout-btn {
    display: block;
    text-align: center;
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    background: rgba(239, 68, 68, 0.15);
    color: rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all var(--transition);
}

.logout-btn:hover {
    background: var(--color-error);
    color: white;
    text-decoration: none;
}

/* ==================== BADGES ==================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.badge-warning, .badge-needs-cost {
    background: var(--color-warning-light);
    color: var(--color-warning);
}

.badge-insert, .badge-active, .badge-success {
    background: var(--color-success-light);
    color: var(--color-success);
}

.badge-update, .badge-info {
    background: var(--color-info-light);
    color: var(--color-info);
}

.badge-delete, .badge-error, .badge-inactive {
    background: var(--color-error-light);
    color: var(--color-error);
}

.badge-platform {
    background: var(--color-bg);
    color: var(--color-text);
    text-transform: capitalize;
}

.badge-count {
    background: var(--color-warning);
    color: white;
    padding: 0.125rem 0.375rem;
    border-radius: 8px;
    font-size: 0.625rem;
    margin-left: 0.375rem;
    min-width: 1.125rem;
    text-align: center;
}

/* ==================== ALERTS & MESSAGES ==================== */
.alert {
    padding: 0.625rem 1rem;
    margin-bottom: 1rem;
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-success {
    background: var(--color-success-light);
    color: var(--color-success);
    border: 1px solid #d1fae5;
}

.alert-error {
    background: var(--color-error-light);
    color: var(--color-error);
    border: 1px solid #fecaca;
}

.alert-warning {
    background: var(--color-warning-light);
    color: var(--color-warning);
    border: 1px solid #fde68a;
}

.alert-info {
    background: var(--color-info-light);
    color: var(--color-info);
    border: 1px solid #bfdbfe;
}

/* ==================== PAGE LAYOUT ==================== */
.page {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border-light);
}

.page-header h1 {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: -0.01em;
}

.page-header .subtitle {
    color: var(--color-text-light);
    font-size: 0.8125rem;
    margin-top: 0.125rem;
}

.page-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.5rem 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border-light);
}

.section-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
}

/* ==================== DASHBOARD ==================== */
.dashboard h1 {
    font-size: 1.375rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: box-shadow var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 0.75rem 1rem 0;
}

.card-header h3 {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.card-body {
    padding: 0.5rem 1rem 1rem;
}

.metric {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.2;
}

.metric-value.highlight {
    color: var(--color-warning);
}

.metric-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.recent-activity {
    margin-top: 1.5rem;
}

.recent-activity h2 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

/* ==================== TABLES ==================== */
.table-container {
    overflow-x: auto;
    margin: 0.5rem 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-white);
    font-size: 0.8125rem;
}

.table thead {
    background: var(--color-bg-alt);
}

.table th {
    padding: 0.625rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--color-text-light);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}

.table td {
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid var(--color-border-light);
    vertical-align: middle;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover {
    background: var(--color-bg-alt);
}

.table code {
    background: var(--color-bg);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    font-family: "SF Mono", "Monaco", "Menlo", "Consolas", monospace;
    font-size: 0.75rem;
    color: var(--color-text);
}

.table .text-right {
    text-align: right;
}

.table .text-center {
    text-align: center;
}

.table .text-muted {
    color: var(--color-text-muted);
}

.table .row-actions {
    white-space: nowrap;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* ==================== INLINE EDITING ==================== */
.inline-edit-group {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.inline-edit-display {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.inline-edit-form {
    display: none;
    align-items: center;
    gap: 0.375rem;
}

.inline-edit-form.active {
    display: flex;
}

.inline-edit-display.hidden {
    display: none;
}

.inline-edit-form input[type="number"],
.inline-edit-form input[type="date"],
.inline-edit-form input[type="text"] {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    width: auto;
    min-width: 80px;
    background: var(--color-primary-light);
}

.inline-edit-form input[type="number"] {
    width: 90px;
}

.inline-edit-form input[type="date"] {
    width: 140px;
}

.inline-edit-form input[type="text"].inline-reason {
    width: 140px;
}

.inline-edit-form select {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    background: var(--color-primary-light);
}

/* ==================== FORMS ==================== */
.form-container {
    max-width: 560px;
    margin: 0 auto;
}

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

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
    font-size: 0.8125rem;
    color: var(--color-text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--color-text);
    transition: border-color var(--transition), box-shadow var(--transition);
    background: var(--color-white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--color-text-muted);
    font-size: 0.75rem;
}

.form-section {
    padding: 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    background: var(--color-bg-alt);
}

.form-section legend {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--color-text);
    padding: 0 0.375rem;
}

.readonly-field {
    padding: 0.5rem 0.75rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: 0.875rem;
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.component-row {
    display: grid;
    grid-template-columns: 1fr 100px auto;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-border-light);
    align-items: end;
}

.component-row .form-group {
    margin-bottom: 0;
}

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.4375rem 0.875rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
    white-space: nowrap;
    line-height: 1.4;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: var(--color-primary);
    color: var(--color-white);
}

.btn-primary:hover {
    background: var(--color-primary-hover);
}

.btn-secondary {
    background: var(--color-bg);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

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

.btn-success {
    background: var(--color-success);
    color: var(--color-white);
}

.btn-success:hover {
    background: #047857;
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.btn-xs {
    padding: 0.125rem 0.375rem;
    font-size: 0.6875rem;
}

.btn-danger {
    background: var(--color-error-light);
    color: var(--color-error);
    border: 1px solid #fecaca;
}

.btn-danger:hover {
    background: var(--color-error);
    color: white;
    border-color: var(--color-error);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-light);
    padding: 0.25rem 0.375rem;
}

.btn-ghost:hover {
    background: var(--color-bg);
    color: var(--color-text);
}

.btn-icon {
    padding: 0.25rem;
    line-height: 1;
    font-size: 0.875rem;
}

.btn-block {
    width: 100%;
}

.btn-link {
    display: inline;
    padding: 0;
    background: none;
    color: var(--color-primary);
    cursor: pointer;
    border: none;
    font-weight: 500;
    font-size: 0.8125rem;
    text-decoration: none;
}

.btn-link:hover {
    color: var(--color-primary-hover);
    text-decoration: underline;
}

.btn-link.text-danger {
    color: var(--color-error);
}

.btn-link.text-danger:hover {
    color: #b91c1c;
}

/* ==================== LOGIN PAGE ==================== */
.login-body {
    background: linear-gradient(135deg, var(--color-nav) 0%, #2d3748 100%);
    min-height: 100vh;
}

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.login-card {
    background: var(--color-white);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 380px;
}

.login-card h1 {
    margin-bottom: 0.375rem;
    text-align: center;
    font-size: 1.25rem;
    color: var(--color-text);
}

.login-subtitle {
    text-align: center;
    color: var(--color-text-light);
    margin-bottom: 1.5rem;
    font-size: 0.8125rem;
}

.login-form {
    margin-bottom: 1.5rem;
}

.login-info {
    text-align: center;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* ==================== PRODUCT INFO CARD ==================== */
.info-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
}

.info-card h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.info-grid > div {
    background: var(--color-bg-alt);
    padding: 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-light);
}

.info-grid strong {
    display: block;
    color: var(--color-text-muted);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.125rem;
    font-weight: 500;
}

.cost-highlight {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-success);
}

/* ==================== COST TIMELINE ==================== */
.cost-timeline {
    position: relative;
    padding-left: 1.5rem;
}

.cost-timeline::before {
    content: '';
    position: absolute;
    left: 0.375rem;
    top: 0.5rem;
    bottom: 0.5rem;
    width: 2px;
    background: var(--color-border);
}

.timeline-entry {
    position: relative;
    padding: 0.5rem 0 0.75rem 0.75rem;
    font-size: 0.8125rem;
}

.timeline-entry::before {
    content: '';
    position: absolute;
    left: -1.25rem;
    top: 0.75rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-border);
    border: 2px solid var(--color-white);
}

.timeline-entry.current::before {
    background: var(--color-success);
    box-shadow: 0 0 0 3px var(--color-success-light);
}

.timeline-cost {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--color-text);
}

.timeline-date {
    color: var(--color-text-light);
    font-size: 0.75rem;
}

.timeline-meta {
    color: var(--color-text-muted);
    font-size: 0.6875rem;
}

/* ==================== FILTER BAR ==================== */
.filter-bar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--color-bg-alt);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-light);
    flex-wrap: wrap;
}

.filter-bar input,
.filter-bar select {
    padding: 0.375rem 0.625rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    background: var(--color-white);
}

.filter-bar input:focus,
.filter-bar select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.filter-bar label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-light);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

/* ==================== MODAL ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.modal:not(.hidden) {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    max-width: 520px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-content h2 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    padding-right: 2rem;
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    font-size: 1.125rem;
    cursor: pointer;
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--color-text-light);
    transition: all var(--transition);
}

.modal-close:hover {
    background: var(--color-error-light);
    color: var(--color-error);
    border-color: #fecaca;
}

/* ==================== EXPANDABLE ROWS ==================== */
.expandable-trigger {
    cursor: pointer;
    user-select: none;
}

.expandable-trigger:hover {
    background: var(--color-primary-light) !important;
}

.expand-icon {
    display: inline-block;
    transition: transform var(--transition);
    font-size: 0.625rem;
    color: var(--color-text-muted);
    margin-right: 0.25rem;
}

.expand-icon.open {
    transform: rotate(90deg);
}

.expandable-content {
    display: none;
}

.expandable-content.open {
    display: table-row;
}

.expandable-content td {
    padding: 0.75rem;
    background: var(--color-bg-alt);
    border-bottom: 1px solid var(--color-border);
}

.expandable-detail {
    padding: 0.75rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.detail-section {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.75rem;
}

.detail-section h4 {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    margin-bottom: 0.375rem;
}

.detail-list {
    list-style: none;
    font-size: 0.8125rem;
}

.detail-list li {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--color-border-light);
}

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

/* ==================== EMPTY STATE ==================== */
.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--color-text-muted);
}

.empty-state p {
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

/* ==================== TABS ==================== */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--color-border);
    margin-bottom: 1rem;
    gap: 0;
}

.tab {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-text-light);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition);
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}

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

.tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.tab-content {
    display: none;
}

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

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding-bottom: 1rem;
    }

    .content {
        margin-left: 0;
        padding: 1rem;
    }

    .page {
        padding: 1rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .summary-cards {
        grid-template-columns: 1fr 1fr;
    }

    .component-row {
        grid-template-columns: 1fr;
    }

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

    .table {
        font-size: 0.75rem;
    }

    .table th, .table td {
        padding: 0.5rem;
    }

    .sidebar-footer {
        position: relative;
        margin-top: 0.5rem;
    }

    .info-grid {
        grid-template-columns: 1fr 1fr;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ==================== UTILITIES ==================== */
code {
    background: var(--color-bg);
    padding: 1px 4px;
    border-radius: var(--radius-sm);
    font-family: "SF Mono", "Monaco", "Menlo", "Consolas", monospace;
    font-size: 0.8em;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.text-muted {
    color: var(--color-text-muted);
}

.text-success {
    color: var(--color-success);
}

.text-warning {
    color: var(--color-warning);
}

.text-error, .text-danger {
    color: var(--color-error);
}

.text-small {
    font-size: 0.75rem;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.gap-1 { gap: 0.5rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

.hidden { display: none !important; }

/* ==================== QUICK MAP INLINE ==================== */
.quick-map-row {
    background: var(--color-primary-light) !important;
}

.quick-map-row td {
    padding: 1rem 0.75rem;
}

.quick-map-inline {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.quick-map-inline .form-group {
    margin-bottom: 0.5rem;
}

.quick-map-inline .form-actions {
    grid-column: 1 / -1;
    margin-top: 0.5rem;
}

/* ==================== AUDIT LOG ==================== */
.audit-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    font-size: 0.75rem;
    margin-top: 0.375rem;
}

.audit-values {
    background: var(--color-bg-alt);
    padding: 0.375rem 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border-light);
    font-family: "SF Mono", "Monaco", "Menlo", monospace;
    font-size: 0.6875rem;
    word-break: break-all;
}

.audit-values.old {
    border-left: 2px solid var(--color-error);
}

.audit-values.new {
    border-left: 2px solid var(--color-success);
}

/* ==================== FILTER SECTION FOR AUDIT ==================== */
.filter-section {
    margin-bottom: 1rem;
}

.filter-form {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.filter-form .form-group {
    flex: 0 0 auto;
    margin-bottom: 0;
}

/* ==================== TWO-CLICK REMOVE BUTTON ==================== */
/* Two-click remove button states */
.remove-component-btn.confirm-state {
    background: var(--color-danger-dark, #a91e2c);
    transform: scale(1.05);
    transition: transform 0.1s ease;
}
