* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; font-family: Inter, system-ui, -apple-system, sans-serif; color: #172033; background: #eef3f8; }
button, input, select, textarea { font: inherit; }
.app-container { height: 100vh; display: grid; grid-template-columns: 300px 1fr; overflow: hidden; }
.sidebar { background: #101827; color: #e5edf7; display: flex; flex-direction: column; border-right: 1px solid #223149; }
.sidebar-header { height: 64px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #223149; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 800; }
.logo i { color: #38bdf8; }
.btn-new-conn, .btn { border: 0; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: .18s ease; }
.btn-new-conn { width: 34px; height: 34px; color: #fff; background: #2563eb; }
.btn-new-conn:hover, .btn-primary:hover { background: #1d4ed8; }
.sidebar-content { padding: 16px; overflow-y: auto; }
.section-title { margin: 14px 0 8px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: #8ea0b8; }
.connection-item, .table-item { padding: 10px 12px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; }
.connection-item:hover, .table-item:hover, .connection-item.active, .table-item.active { background: #1b2940; border-color: #2d405f; }
.connection-name, .table-name { font-weight: 700; }
.connection-meta, .table-meta { margin-top: 3px; color: #9fb0c6; font-size: 12px; }
#db-selector { width: 100%; padding: 10px; border: 1px solid #2d405f; border-radius: 8px; color: #e5edf7; background: #172236; }
.main-content { display: grid; grid-template-rows: 64px 1fr 48px; min-width: 0; }
.main-header, .main-footer { background: #fff; border-bottom: 1px solid #dbe4ef; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; }
.main-footer { border-bottom: 0; border-top: 1px solid #dbe4ef; }
.breadcrumb { font-weight: 800; color: #172033; }
.header-actions { display: flex; gap: 8px; }
.btn { min-height: 36px; padding: 0 14px; background: #eef3f8; color: #26344d; }
.btn:hover { background: #e2eaf4; }
.btn-primary { background: #2563eb; color: #fff; }
.btn-secondary { background: #eef3f8; color: #26344d; }
.btn-danger { background: #fee2e2; color: #b91c1c; }
.content-body { overflow: auto; padding: 18px; }
.welcome-screen { height: 100%; min-height: 420px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #7b8ba3; text-align: center; }
.welcome-screen i { font-size: 56px; color: #c5d2e2; margin-bottom: 16px; }
.panel { background: #fff; border: 1px solid #dbe4ef; border-radius: 10px; overflow: hidden; }
.panel-header { padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e7eef7; }
.panel-title { font-weight: 800; }
.table-wrap { overflow: auto; max-height: calc(100vh - 210px); }
.data-grid { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-grid th, .data-grid td { padding: 9px 10px; border-bottom: 1px solid #edf2f7; text-align: left; white-space: nowrap; }
.data-grid th { position: sticky; top: 0; background: #f8fafc; color: #475569; z-index: 1; }
.data-grid tr:hover td { background: #f8fbff; }
.sql-results { margin-top: 12px; max-height: 320px; overflow: auto; border: 1px solid #dbe4ef; border-radius: 8px; background: #f8fafc; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #10b981; margin-right: 6px; }
.pagination { display: flex; align-items: center; gap: 8px; }
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: none; align-items: center; justify-content: center; padding: 20px; z-index: 1000; }
.modal-overlay.active { display: flex; }
.modal { width: min(560px, 96vw); max-height: 90vh; background: #fff; border-radius: 12px; box-shadow: 0 24px 70px rgba(15,23,42,.28); overflow: hidden; display: flex; flex-direction: column; }
.modal-lg { width: min(900px, 96vw); }
.modal-md { width: min(680px, 96vw); }
.modal-header, .modal-footer { padding: 14px 18px; border-bottom: 1px solid #e7eef7; display: flex; align-items: center; justify-content: space-between; }
.modal-footer { border-bottom: 0; border-top: 1px solid #e7eef7; justify-content: flex-end; gap: 8px; }
.modal-body { padding: 18px; overflow-y: auto; }
.close-btn { border: 0; background: transparent; font-size: 24px; cursor: pointer; color: #64748b; }
.form-group { margin-bottom: 14px; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }
.flex-3 { flex: 3 !important; }
.flex-1 { flex: 1 !important; }
label { display: block; margin-bottom: 6px; color: #475569; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
input, select, textarea { width: 100%; padding: 11px 12px; border: 1px solid #cfd9e6; border-radius: 8px; outline: none; background: #fff; color: #172033; }
input:focus, select:focus, textarea:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.14); }
.sql-editor, .excel-paste-area { min-height: 220px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; line-height: 1.55; }
.help-text { color: #64748b; margin-top: 0; }
.import-preview { margin-top: 12px; max-height: 220px; overflow: auto; }
@media (max-width: 860px) { .app-container { grid-template-columns: 1fr; } .sidebar { display: none; } .main-header { gap: 12px; align-items: flex-start; flex-direction: column; height: auto; padding: 12px; } }
