:root {
    --bg-app: #f3f4f6;
    --bg-sidebar: #1f2937;
    --bg-card: #ffffff;
    
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-sidebar: #e5e7eb;
    --text-sidebar-muted: #9ca3af;

    --border-color: #e5e7eb;
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    
    --success: #10b981;
    --danger: #ef4444;
}

* { box-sizing: border-box; }

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

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: var(--bg-sidebar);
    color: var(--text-sidebar);
    display: flex;
    flex-direction: column;
    border-right: 1px solid #374151;
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #374151;
}

.sidebar-header h2 { margin: 0; font-size: 1.25rem; font-weight: 600; }
.badge { background: #374151; padding: 2px 8px; border-radius: 4px; font-size: 0.75rem; color: #d1d5db; }

.sidebar-actions {
    padding: 1rem;
    display: flex;
    gap: 10px;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 1rem;
}

.table-list { display: flex; flex-direction: column; gap: 2px; }

.table-item {
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-sidebar-muted);
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
}

.table-item:hover { background-color: #374151; color: white; }
.table-item.active { background-color: var(--primary-color); color: white; }

.table-item .meta { font-size: 0.75rem; opacity: 0.7; }

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid #374151;
    font-size: 0.8rem;
}

.status-indicator { display: flex; align-items: center; gap: 8px; color: var(--text-sidebar-muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background-color: #6b7280; }
.dot.ok { background-color: var(--success); }
.dot.error { background-color: var(--danger); }

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-app);
    overflow: hidden;
}

.top-bar {
    height: 60px;
    background: white;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 2rem;
}

.breadcrumbs { font-size: 0.9rem; color: var(--text-secondary); }
.crumb-active { font-weight: 600; color: var(--text-primary); }
.crumb-separator { margin: 0 8px; color: #d1d5db; }

.content-area {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    text-align: center;
}
.empty-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.3; }

/* Detail View */
.detail-view { display: flex; flex-direction: column; gap: 2rem; }

.card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.card-header h3 { margin: 0; font-size: 1rem; font-weight: 600; }

.card-body { padding: 1.5rem; }
.card-body.p-0 { padding: 0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.full-width { grid-column: span 2; }

.field-group label { display: block; font-size: 0.75rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.05em; }
.field-group .value { font-size: 0.95rem; font-weight: 500; }
.field-group .value.mono { font-family: monospace; color: #4b5563; }

/* Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th {
    text-align: left;
    padding: 12px 24px;
    border-bottom: 1px solid var(--border-color);
    background-color: #f9fafb;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
}

.data-table td {
    padding: 12px 24px;
    border-bottom: 1px solid var(--border-color);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover { background-color: #f9fafb; }

.type-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    background: #e0e7ff;
    color: #4338ca;
    font-size: 0.75rem;
    font-family: monospace;
}

.req-check { color: var(--text-secondary); opacity: 0.3; }
.req-check.active { color: var(--danger); opacity: 1; font-weight: bold; }

/* Buttons */
.btn { border: none; border-radius: 6px; cursor: pointer; font-weight: 500; transition: background 0.1s; }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.btn-primary { background: var(--primary-color); color: white; width: 100%; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: white; border: 1px solid #d1d5db; color: #374151; }
.btn-secondary:hover { background: #f9fafb; }
.btn-icon { background: none; border: none; color: #9ca3af; cursor: pointer; font-size: 1.2rem; }
.btn-icon:hover { color: white; }

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal {
    background: white;
    border-radius: 8px;
    width: 500px;
    max-width: 90%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
}

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

.modal-body { padding: 1.5rem; }

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-close {
    background: none; border: none; font-size: 1.5rem; cursor: pointer; color: #9ca3af;
}
.btn-close:hover { color: #374151; }

.input-readonly { background-color: #f3f4f6; color: #6b7280; border: 1px solid #d1d5db; }
.hint { font-size: 0.75rem; color: #6b7280; margin-top: 4px; display: block; }
.separator { height: 1px; background: var(--border-color); margin: 1.5rem 0; }

/* Form Elements */
select, input[type="text"], textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-top: 4px;
    font-family: inherit;
}
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 2px rgba(59,130,246,0.1); }
select:disabled, input:disabled, textarea:disabled { background-color: #f9fafb; cursor: not-allowed; }
