/* Light dashboard - minimal styles */
body { font-family: system-ui, -apple-system, sans-serif; background: #f5f5f5; }
#wrapper { display: flex; min-height: 100vh; }
#content-wrapper { flex: 1; overflow-x: hidden; padding: 1rem; }
.navbar { background: #343a40 !important; }
.navbar-brand { font-weight: 600; }
.card { border: none; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.card-header { background: #fff; border-bottom: 1px solid #eee; font-weight: 600; }
.table-responsive { font-size: 0.9rem; }
.btn-sm { font-size: 0.8rem; }
.modal-content { border: none; box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.form-control:focus { border-color: #80bdff; box-shadow: 0 0 0 0.2rem rgba(0,123,255,.2); }
#sidebarToggle { color: rgba(255,255,255,.8); text-decoration: none; }
#sidebarToggle:hover { color: #fff; }
.dropdown-menu { border: 1px solid #eee; }
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter { margin-bottom: 0.75rem; }
@media (max-width: 768px) { .table { font-size: 0.85rem; } }

/* Source context and in-place redirect editing. */
#url_table td { vertical-align: middle; }
.rule-source { min-width: 15rem; }
.source-host { display: inline-block; padding: .2rem .55rem; margin-bottom: .45rem; border-radius: 5px; background: #eaf1ff; color: #2555a4; font-size: .73rem; font-weight: 600; }
.rule-full-url { margin: 0 0 .45rem; overflow-wrap: anywhere; line-height: 1.6; color: #25354b; }
.rule-source a, .copy_url { font-size: .75rem; text-decoration: none; }
.copy_url { border: 0; background: none; color: #52657c; margin-left: .9rem; padding: 0; }
.copy_url:hover { color: #0d6efd; text-decoration: underline; }
.rule-destination { display: block; border: 0; padding: .3rem; background: transparent; text-align: left; overflow-wrap: anywhere; color: #41536b; min-width: 12rem; width: 100%; border-radius: 5px; }
.empty-redirect { border: 0; color: #926518; background: #fff6df; padding: .25rem .55rem; border-radius: 5px; font-size: .75rem; }
.redirect-edit { cursor: pointer; }
.redirect-edit:hover { color: #0d6efd; background: #eaf1ff; }
.redirect-edit:focus-visible { outline: 2px solid #0d6efd; outline-offset: 3px; }
#url_table .redirect-cell-active { background: #f3f7ff; box-shadow: none; }
.redirect-cell-editor { min-width: 12rem; margin: 0; }
.redirect-cell-editor input { width: 100%; }
.cell-editor-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .5rem; }
.cell-editor-hint { color: #75839a; font-size: .68rem; margin-left: auto; }
.redirect-cell-editor .editor-message { margin-top: .5rem; padding: .5rem; font-size: .75rem; }
#url_table .rule-is-editing > td { background: #eff5ff; box-shadow: none; border-bottom-color: #cbdcfa; }
#url_table .rule-editor-row > td { padding: 0; background: #fff; box-shadow: none; }
.rule-editor { position: sticky; left: 0; max-width: 100%; box-sizing: border-box; padding: 1.25rem 1.5rem; border-left: 3px solid #0d6efd; background: linear-gradient(120deg, #f7faff, #fff 70%); animation: editor-appear .16s ease-out; }
.editor-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.editor-heading > div { display: flex; align-items: center; gap: .8rem; }
.editor-eyebrow { color: #466286; font-size: .65rem; font-weight: 700; letter-spacing: .1em; }
.editor-origin { font-size: .9rem; color: #1f3b62; }
.editor-state { font-size: .72rem; color: #65758c; }
.editor-source { padding: .7rem .9rem; border: 1px solid #dce6f3; border-radius: 8px; background: #fff; margin-bottom: 1rem; }
.editor-caption { color: #6b7d94; font-size: .7rem; display: block; margin-bottom: .25rem; }
.editor-full-url { color: #244875; font-size: .85rem; overflow-wrap: anywhere; user-select: all; }
.editor-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.editor-fields > div { min-width: 0; }
.editor-fields .form-label { color: #3e5067; font-size: .78rem; font-weight: 600; }
.editor-fields input { font-size: .9rem; padding: .65rem .75rem; border-color: #cdd9e8; border-radius: 7px; }
.editor-fields input.is-invalid { border-color: #dc3545; }
.editor-footer { margin-top: 1rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.editor-actions { display: flex; align-items: center; gap: .5rem; }
.editor-actions .btn { padding: .45rem .8rem; border-radius: 6px; }
.editor-cancel { color: #617189; text-decoration: none; }
.editor-shortcuts { color: #7a8798; font-size: .7rem; }
.editor-shortcuts kbd { background: #edf1f6; color: #55677e; padding: .15rem .3rem; }
.editor-message { color: #9a3d22; background: #fff1e9; border-radius: 6px; margin-top: .8rem; padding: .65rem .8rem; font-size: .8rem; }
.rule-editing-lock .dataTables_paginate { pointer-events: none; opacity: .45; }
.rule-editing-lock #url_table thead th, .rule-editing-lock .dataTables_scrollHead th { pointer-events: none; }
.rule-notification { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 1090; max-width: min(28rem, calc(100vw - 3rem)); padding: .85rem 1.2rem; border-radius: 10px; color: #fff; background: #173c34; box-shadow: 0 8px 28px #183b3526; font-size: .85rem; }
#url_table .rule-just-saved > td { animation: rule-saved 2s ease-out; }
@keyframes editor-appear { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes rule-saved { from { background: #dff4e8; } to { background: transparent; } }
@media (max-width: 768px) {
    .rule-editor { padding: 1rem; }
    .editor-fields { grid-template-columns: 1fr; }
    .editor-heading { align-items: flex-start; }
    .editor-heading > div { flex-direction: column; align-items: flex-start; gap: .25rem; }
    .editor-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
    .editor-actions .editor-cancel { grid-column: 1 / -1; }
    .editor-shortcuts { display: none; }
    .rule-notification { top: 4.5rem; bottom: auto; right: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
    .rule-editor, #url_table .rule-just-saved > td { animation: none; }
}
