/* Core Performance — Admin Panel Styles */
.core-wrap { max-width: 1200px; margin: 20px 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.core-header { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; }
.core-header h1 { font-size: 22px; font-weight: 600; color: #1d2327; margin: 0; }
.core-ver { font-size: 11px; color: #8c8f94; background: #f0f0f1; padding: 2px 8px; border-radius: 3px; }

.core-nav { display: flex; gap: 0; margin-bottom: 20px; border-bottom: 2px solid #dcdcde; }
.core-tab { padding: 10px 20px; border: none; background: none; cursor: pointer; font-size: 13px; color: #50575e; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.2s; }
.core-tab:hover { color: #2271b1; }
.core-tab.active { color: #2271b1; border-bottom-color: #2271b1; font-weight: 600; }

.core-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 15px; }
.core-card { background: #fff; border: 1px solid #c3c4c7; border-radius: 4px; padding: 15px 20px; }
.core-card h3 { margin: 0 0 12px 0; font-size: 14px; font-weight: 600; color: #1d2327; }

.core-info { width: 100%; border-collapse: collapse; }
.core-info td { padding: 6px 8px; font-size: 13px; border-bottom: 1px solid #f0f0f1; }
.core-info td:first-child { color: #646970; width: 100px; font-weight: 500; }
.core-info td:last-child { color: #1d2327; word-break: break-all; }

.core-site-list { list-style: none; margin: 0; padding: 0; }
.core-site-list li { padding: 4px 0; font-size: 13px; border-bottom: 1px solid #f0f0f1; }
.core-site-list li.has-wp { color: #1d2327; }
.core-badge { display: inline-block; background: #2271b1; color: #fff; padding: 1px 6px; border-radius: 2px; font-size: 10px; margin-left: 6px; }

.core-func-list { display: flex; flex-wrap: wrap; gap: 4px; }
.core-func-list code { background: #f0f0f1; padding: 2px 6px; border-radius: 2px; font-size: 11px; color: #3c434a; }

/* Progress bars */
.core-progress-bg { background: #f0f0f1; border-radius: 4px; height: 8px; overflow: hidden; }
.core-progress-fill { height: 100%; border-radius: 4px; transition: width 0.6s ease; min-width: 2px; }

/* Terminal */
.core-terminal-wrap { background: #0c0c0c; border-radius: 6px; overflow: hidden; border: 1px solid #2d2d2d; }
.core-term-header { display: flex; gap: 10px; padding: 12px 14px; background: #161616; align-items: center; border-bottom: 1px solid #2d2d2d; }
.core-term-title { color: #888; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; margin-right: 8px; }
.core-cmd-input { flex: 1; padding: 8px 12px; background: #0c0c0c; border: 1px solid #333; color: #e0e0e0; font-family: "SF Mono", "Cascadia Code", "Fira Code", Consolas, monospace; font-size: 13px; border-radius: 3px; }
.core-cmd-input:focus { outline: none; border-color: #4ec9b0; }
.core-select { padding: 8px 12px; background: #0c0c0c; border: 1px solid #333; color: #c0c0c0; font-size: 12px; border-radius: 3px; min-width: 150px; cursor: pointer; }
.core-btn { padding: 8px 16px; background: #1a5a3a; color: #e0e0e0; border: 1px solid #2d7a4a; border-radius: 3px; cursor: pointer; font-size: 13px; white-space: nowrap; transition: all 0.15s; }
.core-btn:hover { background: #226a44; }
.core-btn-sm { padding: 4px 10px; font-size: 12px; }
.core-btn-clear { background: #3a3a3a; border-color: #555; }
.core-btn-clear:hover { background: #4a4a4a; }
.core-term-output { padding: 14px 16px; font-family: "SF Mono", "Cascadia Code", "Fira Code", Consolas, monospace; font-size: 13px; color: #c0c0c0; min-height: 350px; max-height: 650px; overflow-y: auto; line-height: 1.5; user-select: text; -webkit-user-select: text; }
.core-term-welcome { color: #4ec9b0; font-family: "SF Mono", "Cascadia Code", monospace; font-size: 12px; line-height: 1.6; }
.core-cmd-block { margin-bottom: 2px; }
.core-cmd-prompt { color: #4ec9b0; font-weight: 600; display: inline; white-space: nowrap; }
.core-cwd { color: #ce9d50; }
.core-cursor-static { color: #4ec9b0; animation: blink 1s step-end infinite; display: inline; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }
.core-input-text { color: #e0e0e0; display: inline; white-space: pre-wrap; }
.core-term-line { min-height: 20px; line-height: 1.5; }
.core-cmd-result { color: #c0c0c0; margin-bottom: 2px; }
.core-cmd-result pre { margin: 0; padding: 0; font-family: inherit; font-size: inherit; color: #c0c0c0; background: none; border: none; white-space: pre-wrap; word-break: break-all; }
.core-prompt { color: #666; font-style: italic; }

/* File Manager */
.core-files-wrap { background: #fff; border: 1px solid #c3c4c7; border-radius: 4px; }
.core-files-nav { display: flex; gap: 8px; padding: 10px; border-bottom: 1px solid #dcdcde; align-items: center; background: #f9f9f9; }
.core-files-nav .core-cmd-input { background: #fff; color: #1d2327; border: 1px solid #8c8f94; }
.core-files-list { padding: 10px; max-height: 500px; overflow-y: auto; }
.core-files-table { width: 100%; border-collapse: collapse; }
.core-files-table th { text-align: left; padding: 8px 10px; font-size: 12px; color: #646970; border-bottom: 2px solid #dcdcde; font-weight: 600; }
.core-files-table td { padding: 6px 10px; font-size: 13px; border-bottom: 1px solid #f0f0f1; }
.core-filerow { cursor: pointer; transition: background 0.1s; }
.core-filerow:hover { background: #f6f7f7; }
.core-filerow-dir { color: #2271b1; }

.core-file-content { border-top: 1px solid #dcdcde; }
.core-file-header { display: flex; gap: 8px; padding: 8px 10px; background: #f0f0f1; align-items: center; }
.core-file-header span { flex: 1; font-size: 13px; font-family: monospace; }

.core-editor-wrap { display: flex; height: 450px; background: #1d1d1d; }
.core-editor-gutter { width: 48px; min-width: 48px; background: #151515; color: #666; font-family: "SF Mono", "Cascadia Code", monospace; font-size: 13px; line-height: 19px; padding: 10px 0; overflow: hidden; user-select: none; border-right: 1px solid #2d2d2d; text-align: right; }
.core-editor-gutter div { padding: 0 8px 0 4px; height: 19px; line-height: 19px; }
.core-file-editor { flex: 1; padding: 10px 12px; font-family: "SF Mono", Monaco, "Cascadia Code", monospace; font-size: 13px; line-height: 19px; border: none; resize: none; background: #1d1d1d; color: #e0e0e0; outline: none; overflow: auto; white-space: pre; tab-size: 4; }

.core-hint { color: #8c8f94; font-size: 12px; margin-left: 8px; }
.core-error { color: #d63638; padding: 10px; }

/* Database */
.core-db-wrap { max-width: 100%; }
.core-db-connect { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; background: #fff; border: 1px solid #c3c4c7; padding: 10px 12px; border-radius: 4px; margin-bottom: 8px; }
.core-db-connect input { padding: 6px 8px; border: 1px solid #8c8f94; border-radius: 3px; font-size: 12px; font-family: monospace; }
.core-db-connect input:focus { outline: none; border-color: #2271b1; }
#db-status { font-size: 12px; margin-left: 8px; }

.core-db-tables { display: flex; gap: 10px; height: calc(100vh - 280px); min-height: 400px; }
.core-db-sidebar { width: 185px; min-width: 185px; background: #fff; border: 1px solid #c3c4c7; border-radius: 4px; overflow: hidden; display: flex; flex-direction: column; }
.core-db-sidebar-header { padding: 8px 10px; font-weight: 600; font-size: 12px; text-transform: uppercase; color: #646970; background: #f0f0f1; border-bottom: 1px solid #dcdcde; }
#db-table-list { flex: 1; overflow-y: auto; padding: 4px 0; }
.core-db-sidebar-footer { padding: 6px 8px; border-top: 1px solid #dcdcde; background: #f9f9f9; }
.core-db-sidebar .db-table-link { display: block; padding: 5px 10px; font-size: 12px; color: #2271b1; cursor: pointer; font-family: monospace; border-left: 2px solid transparent; }
.core-db-sidebar .db-table-link:hover { background: #f0f6fc; }
.core-db-sidebar .db-table-link.active { background: #e5f0fa; border-left-color: #2271b1; font-weight: 600; }

.core-db-main { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.core-db-toolbar { display: flex; justify-content: space-between; align-items: center; background: #fff; border: 1px solid #c3c4c7; padding: 8px 10px; border-radius: 4px; flex-wrap: wrap; gap: 6px; }
.core-db-toolbar-left { display: flex; align-items: center; }
.core-db-toolbar-right { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }

.core-db-query { display: flex; gap: 6px; }
.core-db-query input { flex: 1; padding: 6px 8px; border: 1px solid #8c8f94; border-radius: 3px; font-size: 12px; font-family: monospace; background: #fff; color: #1d2327; }
.core-db-query input:focus { outline: none; border-color: #2271b1; }

.core-db-results { background: #fff; border: 1px solid #c3c4c7; border-radius: 4px; overflow: auto; max-height: 420px; flex: 1; }
.core-db-results table { width: 100%; border-collapse: collapse; font-size: 11px; }
.core-db-results th { background: #f0f0f1; padding: 7px 8px; text-align: left; font-weight: 600; border-bottom: 2px solid #dcdcde; position: sticky; top: 0; white-space: nowrap; z-index: 1; }
.core-db-results th input[type=checkbox] { margin: 0; vertical-align: middle; }
.core-db-results td { padding: 4px 8px; border-bottom: 1px solid #f0f0f1; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: monospace; font-size: 11px; }
.core-db-results tr:hover td { background: #f6f7f7; }
.core-db-results tr.selected td { background: #e5f0fa; }
.core-db-results .db-actions { white-space: nowrap; text-align: right; }
.core-db-results .db-actions button { margin-left: 2px; }

.core-db-pagination { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 6px; background: #fff; border: 1px solid #c3c4c7; border-radius: 4px; }
.core-db-edit { background: #fff; border: 1px solid #c3c4c7; border-radius: 4px; padding: 12px; }
.core-db-edit-header { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.core-db-edit-header span { flex: 1; font-weight: 600; font-size: 14px; }
.core-db-edit-field { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.core-db-edit-field label { width: 150px; font-size: 12px; font-weight: 500; color: #646970; text-align: right; font-family: monospace; }
.core-db-edit-field input, .core-db-edit-field textarea, .core-db-edit-field select { flex: 1; padding: 6px 8px; border: 1px solid #8c8f94; border-radius: 3px; font-size: 13px; font-family: monospace; }
.core-db-edit-field textarea { min-height: 60px; resize: vertical; }
.core-db-edit-field input[type=checkbox] { flex: 0; width: auto; margin: 0 8px 0 0; }
.db-msg { padding: 8px 12px; font-size: 13px; border-radius: 3px; }
.db-msg-ok { background: #edfaef; color: #1e7a34; }
.db-msg-err { background: #fcf0f1; color: #d63638; }

@media (max-width: 782px) {
    .core-grid { grid-template-columns: 1fr; }
    .core-term-header { flex-wrap: wrap; }
    .core-nav { overflow-x: auto; }
}
