/* Compact database tools, scoped to the shared Studio and existing DB screens. */
.database-studio {
    --ds-bg: var(--studio-surface, #181c22);
    --ds-field: var(--studio-bg, #101318);
    --ds-line: var(--studio-line, #2c323c);
    --ds-text: var(--studio-text, #e4e8ef);
    --ds-muted: var(--studio-muted, #929cac);
    min-width: 0; margin-top: 20px; color: var(--ds-text); font: 400 12px/1.5 var(--studio-font, Arial, sans-serif);
}
.database-studio *, .database-studio *::before, .database-studio *::after { box-sizing: border-box; }
.database-studio h3, .database-studio h4, .database-studio p { margin: 0; }
.database-studio h3 { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.database-studio h4 { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.database-studio p, .database-studio .ds-hint { color: var(--ds-muted); font-size: 11px; }
.database-studio button, .database-studio input, .database-studio textarea, .database-studio select { font: inherit; }
.ds-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 0; }
.ds-eyebrow { display: block; margin-bottom: 5px; color: var(--ds-muted); font-size: 9px; letter-spacing: 1.4px; }
.ds-header p { margin-top: 4px; }
.ds-connection { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; color: var(--ds-muted); font-size: 11px; }
.ds-connection .connected { color: #77c4a3; }
.ds-connection .error { color: #e3979f; }
.database-studio .ds-button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 30px; padding: 6px 10px; border: 1px solid var(--ds-line); border-radius: 6px; background: #222730; color: var(--ds-text); font: 500 11px/1.4 var(--studio-font, Arial, sans-serif); letter-spacing: 0; text-transform: none; cursor: pointer; white-space: nowrap; box-shadow: none; }
.database-studio .ds-button:hover:not(:disabled) { background: #2b313c; border-color: #596273; }
.database-studio .ds-button.primary { background: #b8414b; border-color: #bd4c56; color: #fff; }
.database-studio .ds-button.danger { color: #e68b94; background: #2b2027; border-color: #55343d; }
.database-studio .ds-button:disabled, .database-studio button:disabled { opacity: .42; cursor: not-allowed; }
.database-studio :is(button,input,textarea,select):focus-visible { outline: 2px solid #8896ac; outline-offset: 2px; }
.ds-tabs { display: flex; gap: 4px; padding: 0 0 11px; }
.database-studio .ds-tab { min-height: 31px; padding: 6px 12px; border: 1px solid transparent; border-radius: 6px; color: var(--ds-muted); background: transparent; cursor: pointer; font-size: 11px; }
.database-studio .ds-tab.active { color: var(--ds-text); border-color: var(--ds-line); background: #242a34; }
.ds-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); border: 1px solid var(--ds-line); border-radius: 9px; background: var(--ds-bg); overflow: hidden; min-height: 280px; }
.ds-sidebar { min-width: 0; padding: 12px; border-right: 1px solid var(--ds-line); background: #15191f; }
.ds-sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 11px; }
.ds-sidebar-head strong { font-size: 11px; font-weight: 600; }
.ds-sidebar-head span { color: var(--ds-muted); font-weight: 400; }
.database-studio .ds-sidebar-head .ds-button { min-height: 25px; padding: 2px 7px; }
.database-studio .ds-input, .database-studio .ds-sql { width: 100%; min-width: 0; min-height: 32px; padding: 6px 9px; border: 1px solid var(--ds-line); border-radius: 5px; color: var(--ds-text); background: var(--ds-field); font: 400 12px/1.5 var(--studio-font, Arial, sans-serif); }
.database-studio .ds-input:disabled { opacity: .5; }
.ds-table-search { margin-bottom: 10px; }
.ds-table-list { display: grid; align-content: start; gap: 3px; max-height: 470px; overflow-y: auto; }
.database-studio .ds-table-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-width: 0; min-height: 32px; padding: 6px 9px; border: 1px solid transparent; border-radius: 5px; text-align: left; color: var(--ds-muted); background: transparent; cursor: pointer; font-size: 11px; }
.ds-table-link span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-table-link small { flex-shrink: 0; color: #7d889a; font-size: 10px; }
.database-studio .ds-table-link:hover:not(:disabled), .database-studio .ds-table-link.active { color: var(--ds-text); background: #252c36; border-color: #343e4b; }
.ds-sidebar-foot { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--ds-line); }
.ds-main { min-width: 0; }
.ds-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 15px; }
.ds-section-head p { margin-top: 4px; }
.ds-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.ds-empty { padding: 20px 12px; text-align: center; color: var(--ds-muted); font-size: 11px; }
.ds-welcome { padding: 55px 20px; }
.ds-welcome p { margin-top: 8px; }
.ds-table-scroll { position: relative; width: 100%; max-width: 100%; overflow-x: auto; border-top: 1px solid var(--ds-line); border-bottom: 1px solid var(--ds-line); scrollbar-width: thin; }
.ds-data-table { width: 100%; border-collapse: collapse; font: 400 11px/1.5 var(--studio-font, Arial, sans-serif); }
.ds-data-table th { padding: 10px 12px; color: #abb4c3; background: #202630; border-bottom: 1px solid var(--ds-line); font-size: 10px; font-weight: 500; text-align: left; white-space: nowrap; }
.ds-data-table td { max-width: 340px; min-width: 80px; padding: 9px 12px; border-bottom: 1px solid #252c36; color: var(--ds-text); overflow-wrap: anywhere; white-space: pre-wrap; vertical-align: top; }
.ds-data-table tr:last-child td { border-bottom: 0; }
.ds-data-table tbody tr:hover td { background: #1d232c; }
.ds-data-table .ds-row-actions { min-width: 130px; width: 130px; white-space: nowrap; }
.ds-data-table td.ds-row-actions { padding-top: 6px; padding-bottom: 6px; }
.database-studio .ds-row-actions .ds-button { min-height: 26px; padding: 4px 7px; margin-right: 5px; font-size: 10px; }
.ds-null { color: #788397; font-style: italic; font-size: 10px; }
.ds-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 15px; color: var(--ds-muted); font-size: 10px; }
.ds-code { font-family: Consolas, monospace; }
.ds-notice:empty { display: none; }
.ds-notice { margin-bottom: 12px; padding: 9px 12px; border: 1px solid #35483f; border-radius: 6px; color: #b1c8bd; background: #1a2520; overflow-wrap: anywhere; font-size: 11px; }
.ds-notice.error, .ds-query-status.error { border-color: #623a43; color: #edb1b9; background: #2a1f26; }
.ds-sql-form { padding: 0 15px 14px; }
.ds-sql-form .ds-section-head { padding-left: 0; padding-right: 0; }
.database-studio .ds-sql { display: block; min-height: 170px; max-height: 500px; resize: vertical; padding: 12px; font: 400 12px/1.7 Consolas, monospace; tab-size: 4; }
.ds-sql-form .ds-hint { display: block; margin-top: 8px; }
.ds-query-status { margin: 12px 15px; padding: 9px 11px; border: 1px solid var(--ds-line); border-radius: 5px; color: var(--ds-muted); font-size: 11px; overflow-wrap: anywhere; }
.ds-schema-hint { padding: 12px 15px; }
.ds-editor { margin-top: 14px; padding: 0 15px 14px; border: 1px solid var(--ds-line); border-radius: 8px; background: var(--ds-bg); }
.ds-editor .ds-section-head { padding-left: 0; padding-right: 0; }
.ds-editor-fields { display: grid; gap: 10px; max-height: 440px; overflow-y: auto; padding: 2px; }
.ds-cell-field { display: grid; grid-template-columns: minmax(120px, .8fr) 105px minmax(120px, 1.6fr); gap: 12px; align-items: start; }
.ds-cell-field > span { font-size: 11px; overflow-wrap: anywhere; }
.ds-cell-field small { display: block; margin-top: 3px; color: var(--ds-muted); font-size: 10px; }
.database-studio .ds-cell-value { min-height: 32px; max-height: 160px; resize: vertical; font-family: Consolas, monospace; }
.ds-editor-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 15px; padding-top: 12px; border-top: 1px solid var(--ds-line); }
.ds-editor-error { color: #e3a0aa; font-size: 11px; overflow-wrap: anywhere; }
.ds-form-label { display: grid; gap: 6px; max-width: 460px; margin-bottom: 14px; font-size: 11px; }
.ds-create-columns { display: grid; gap: 10px; margin-bottom: 12px; }
.ds-create-column { display: grid; grid-template-columns: minmax(110px,1fr) minmax(120px,1fr) auto auto auto minmax(100px,1fr) auto; gap: 8px; align-items: center; }
.ds-create-column label { white-space: nowrap; font-size: 10px; color: var(--ds-muted); }
.ds-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.v5-database-workspace .v5-database-credentials { padding: 18px !important; }
.v5-database-workspace .v5-database-credentials > .v5-card-head { padding: 0 0 13px !important; }
.v5-database-workspace .v5-info-list { gap: 10px !important; }
.v5-database-workspace .v5-info-item { padding: 10px 12px !important; border-radius: 6px !important; }
.v5-database-workspace .v5-info-item > span { font-size: 10px !important; letter-spacing: 0 !important; text-transform: none !important; }
.v5-database-workspace .v5-info-value { font-size: 12px !important; }
.v5-database-workspace .v5-head-actions > span { color: #929cac; font-size: 11px; }
.v5-database-connection-panel { margin-top: 12px; border-top: 1px solid #2c323c; padding-top: 11px; }
.v5-database-connection-panel > summary { padding: 2px 0; color: #aab4c3; cursor: pointer; font-size: 11px; }
.v5-database-connection-panel[open] > summary { margin-bottom: 12px; }
.db-studio-legacy-host { min-width: 0; }
.db-studio-launch { padding: 5px 9px; min-height: 29px; font-size: 11px; border: 1px solid #38414f; border-radius: 5px; color: #dce1ea; background: #252c36; cursor: pointer; }
.db-studio-launch:disabled { opacity: .4; cursor: not-allowed; }
#databaseManagerPage .db-admin-table th:last-child, #databaseManagerPage .db-admin-table td:last-child { text-align: right; }
html[data-compact-panel] body.legacy-clean.cs16-v111-theme .database-studio :is(input.ds-input,select.ds-input,textarea.ds-cell-value) { min-height: 32px !important; padding: 6px 9px !important; font-size: 11px !important; }
#databaseManagerPage { --db-bg: #101318; --db-card: #181c22; --db-card-2: #13171d; --db-border: #2c323c; --db-text: #e4e8ef; --db-muted: #929cac; --db-blue: #a6b3c7; --db-green: #79bb9e; --db-yellow: #d5b978; --db-red: #dc8590; }
#databaseManagerPage .db-card { border-radius: 8px; padding: 17px; }
#databaseManagerPage .db-card-head { padding-bottom: 12px; margin-bottom: 13px; }
#databaseManagerPage .db-card-head h3 { font-size: 14px; }
#databaseManagerPage .db-card-head p, #databaseManagerPage .db-page-head p { font-size: 11px; }
#databaseManagerPage .db-summary-card { border-radius: 7px; padding: 13px 15px; }
#databaseManagerPage .db-summary-card span, #databaseManagerPage .db-field label { font-size: 10px; letter-spacing: 0; text-transform: none; font-weight: 500; }
#databaseManagerPage .db-summary-card strong { font-size: 13px; }
#databaseManagerPage .db-limit-pill { border-radius: 5px; background: #242a34; border-color: #38414f; color: #bac4d3; font-size: 10px; }
@media (max-width: 1000px) {
    .ds-create-column { grid-template-columns: minmax(100px,1fr) minmax(110px,1fr) auto auto auto; }
    .ds-create-column [data-column-default] { grid-column: 1 / 3; }
}
@media (max-width: 700px) {
    .database-studio { margin-top: 14px; }
    .ds-header { align-items: flex-start; gap: 12px; }
    .ds-header h3 { font-size: 14px; }
    .ds-connection { flex-direction: column; align-items: flex-end; gap: 5px; max-width: 150px; text-align: right; }
    .ds-layout { grid-template-columns: minmax(0,1fr); }
    .ds-sidebar { border-right: 0; border-bottom: 1px solid var(--ds-line); }
    .ds-table-list { display: flex; overflow-x: auto; overflow-y: hidden; max-height: none; padding-bottom: 3px; }
    .database-studio .ds-table-link { flex: 0 0 auto; width: auto; max-width: 200px; }
    .ds-sidebar-foot { margin-top: 7px; padding-top: 8px; }
    .ds-section-head { flex-wrap: wrap; gap: 10px; padding: 13px; }
    .ds-section-head > .ds-actions { justify-content: flex-start; }
    .ds-data-table td { max-width: 230px; min-width: 90px; }
    .ds-cell-field { grid-template-columns: minmax(0,1fr) 90px; gap: 7px; }
    .ds-cell-field .ds-cell-value { grid-column: 1/-1; }
    .ds-editor-footer { align-items: flex-start; flex-wrap: wrap; }
    .ds-editor-footer .ds-actions { margin-left: auto; }
    .ds-create-column { grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto; padding-bottom: 10px; border-bottom: 1px solid var(--ds-line); }
    .ds-create-column label { grid-row: 2; }
    .ds-create-column [data-column-default] { grid-column: 1/3; }
    .ds-create-column > button { grid-column: 3; grid-row: 1; }
}
