.admin-layout {
    --admin-bg: #070b13;
    --admin-surface: #111821;
    --admin-surface-2: #151d29;
    --admin-border: #263142;
    --admin-border-soft: #1f2937;
    --admin-text: #f4f7fb;
    --admin-muted: #9aa7b8;
    --admin-faint: #6e7b8e;
    --admin-blue: #0d6efd;
    --admin-green: #00e676;
    --admin-orange: #ff9100;
    min-height: 100vh;
    background: var(--admin-bg);
    color: var(--admin-text);
}

.admin-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    background: #121820 !important;
    border-right: 1px solid var(--admin-border-soft);
}

.admin-sidebar .nav-link {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    margin: 1px 0;
    font-size: 0.875rem;
}

.admin-sidebar .nav-link:hover {
    background: rgba(255, 255, 255, .1);
}

.admin-sidebar .nav-link.active {
    background: rgba(255, 255, 255, .15);
    font-weight: 600;
}

.admin-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(17, 24, 33, 0.96);
    border-bottom: 1px solid var(--admin-border);
    backdrop-filter: blur(10px);
}

.admin-title {
    color: var(--admin-text);
    font-weight: 700;
    letter-spacing: 0.01em;
}

.admin-user {
    color: var(--admin-muted);
}

.admin-content {
    min-height: 100vh;
    overflow-x: hidden;
    background:
        radial-gradient(circle at top right, rgba(13, 110, 253, 0.08), transparent 34rem),
        linear-gradient(180deg, #0b111b 0%, #070b13 100%);
}

.admin-main {
    min-height: calc(100vh - 49px);
    color: var(--admin-text);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-header h2 {
    font-weight: 700;
    margin: 0;
    color: var(--admin-text);
}

.admin-layout h1,
.admin-layout h2,
.admin-layout h3,
.admin-layout h4,
.admin-layout h5,
.admin-layout h6 {
    color: var(--admin-text);
}

.admin-layout .text-muted {
    color: var(--admin-muted) !important;
}

.admin-layout .text-secondary {
    color: var(--admin-faint) !important;
}

.admin-layout .card,
.admin-layout .modal-content,
.admin-layout .dropdown-menu,
.admin-layout .list-group-item,
.admin-layout .accordion-item {
    background-color: var(--admin-surface);
    color: var(--admin-text);
    border-color: var(--admin-border);
}

.admin-layout .card-header,
.admin-layout .modal-header,
.admin-layout .modal-footer,
.admin-layout .accordion-header {
    background-color: var(--admin-surface-2);
    border-color: var(--admin-border);
    color: var(--admin-text);
}

.admin-layout .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--admin-text);
    --bs-table-border-color: var(--admin-border);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.025);
    --bs-table-striped-color: var(--admin-text);
    --bs-table-hover-bg: rgba(13, 110, 253, 0.08);
    --bs-table-hover-color: var(--admin-text);
    color: var(--admin-text);
}

.admin-layout .form-control,
.admin-layout .form-select,
.admin-layout .input-group-text {
    background-color: #0d131d;
    color: var(--admin-text);
    border-color: var(--admin-border);
}

.admin-layout .form-control:focus,
.admin-layout .form-select:focus {
    background-color: #0d131d;
    color: var(--admin-text);
    border-color: var(--admin-blue);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.16);
}

.admin-layout .form-control::placeholder {
    color: var(--admin-faint);
}

.admin-layout .form-label,
.admin-layout label {
    color: var(--admin-muted);
}

.admin-layout .btn-outline-secondary {
    color: var(--admin-muted);
    border-color: var(--admin-border);
}

.admin-layout .btn-outline-secondary:hover {
    color: var(--admin-text);
    background-color: rgba(255, 255, 255, 0.06);
    border-color: #3a4657;
}

.admin-layout .bg-white,
.admin-layout .bg-light {
    background-color: var(--admin-surface) !important;
}

.admin-layout .border,
.admin-layout .border-bottom,
.admin-layout .border-top,
.admin-layout .border-start,
.admin-layout .border-end {
    border-color: var(--admin-border) !important;
}

.admin-layout .stat-card {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-left: 4px solid var(--admin-blue);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .28);
}

.admin-layout .stat-card .stat-value {
    color: var(--admin-text);
}

.admin-layout .stat-card .stat-label {
    color: var(--admin-muted);
}

.data-table {
    background: var(--admin-surface);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .28);
    border: 1px solid var(--admin-border);
    overflow: hidden;
}

.data-table .table {
    margin: 0;
}

.data-table .table th {
    background: var(--admin-surface-2);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--admin-muted);
    border-bottom: 2px solid var(--admin-border);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.data-table .table th:hover {
    color: var(--admin-text);
}

.data-table .table td {
    vertical-align: middle;
    font-size: 0.875rem;
}

.data-table-toolbar {
    padding: 1rem;
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.pipeline-board {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 1rem;
}

.pipeline-column {
    min-width: 250px;
    max-width: 280px;
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    flex-shrink: 0;
}

.pipeline-column-header {
    padding: 0.75rem;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    border-bottom: 2px solid;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pipeline-card {
    background: #0f1621;
    border: 1px solid var(--admin-border);
    border-radius: 6px;
    padding: 0.75rem;
    margin: 0.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .26);
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.pipeline-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}

.pipeline-card .job-ref {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--primary);
}

.pipeline-card .job-customer {
    font-size: 0.8rem;
    color: var(--admin-muted);
}

.pipeline-card .job-price {
    font-weight: 600;
    font-size: 0.9rem;
}

.pipeline-card-actions .btn {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
}

.pipeline-card.dragging {
    opacity: 0.4;
    transform: rotate(2deg);
}

.pipeline-card[draggable="true"] {
    cursor: grab;
}

.pipeline-card[draggable="true"]:active {
    cursor: grabbing;
}

.pipeline-drop-zone {
    transition: background-color 0.2s, border-color 0.2s;
    border: 2px dashed transparent;
    border-radius: 6px;
    padding: 4px;
}

.pipeline-drop-zone.drag-over {
    background-color: rgba(13, 110, 253, 0.08);
    border-color: rgba(13, 110, 253, 0.4);
}

.btn-purple {
    background-color: #6A1B9A;
    border-color: #6A1B9A;
    color: white;
}

.btn-purple:hover {
    background-color: #4A148C;
    border-color: #4A148C;
    color: white;
}

.form-section {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .28);
    margin-bottom: 1rem;
}

.estimate-builder .panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
}

.calendar-container {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .28);
}

.calendar-day {
    min-height: 100px;
    border: 1px solid var(--admin-border);
    padding: 0.25rem;
    cursor: pointer;
}

.calendar-day:hover {
    background: rgba(255, 255, 255, 0.04);
}

.calendar-day.today {
    background: rgba(13, 110, 253, 0.14);
}

.calendar-day.other-month {
    opacity: 0.4;
}

.calendar-event {
    font-size: 0.7rem;
    padding: 2px 4px;
    border-radius: 3px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, .5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.confirm-dialog {
    background: var(--admin-surface);
    color: var(--admin-text);
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .2);
}

.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 99999;
}

.toast-item {
    background: var(--admin-surface);
    color: var(--admin-text);
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease;
    min-width: 300px;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-success {
    border-left: 4px solid #4CAF50;
}

.toast-error {
    border-left: 4px solid #F44336;
}

.toast-info {
    border-left: 4px solid #2196F3;
}

/* ── Site Content Tree View ────────────────────────── */

.content-tree-layout {
    display: flex;
    gap: 0;
    min-height: calc(100vh - 180px);
}

.content-tree-panel {
    width: 260px;
    min-width: 260px;
    background: #1b1f23;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.content-tree-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #c9d1d9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.content-tree-header i {
    color: #58a6ff;
}

.content-tree-list {
    list-style: none;
    margin: 0;
    padding: 0.25rem 0;
}

.content-tree-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 1rem 0.5rem 1.25rem;
    font-size: 0.875rem;
    color: #c9d1d9;
    cursor: pointer;
    border-left: 2px solid transparent;
    transition: background 0.15s, border-color 0.15s;
    user-select: none;
}

.content-tree-item:hover {
    background: rgba(255, 255, 255, .06);
}

.content-tree-item.active {
    background: rgba(33, 150, 243, .12);
    border-left-color: #58a6ff;
    color: #fff;
    font-weight: 600;
}

.content-tree-item i {
    font-size: 1rem;
    color: #8b949e;
    flex-shrink: 0;
}

.content-tree-item.active i {
    color: #58a6ff;
}

.content-editor-panel {
    flex: 1;
    min-width: 0;
    margin-left: 1rem;
}

.content-editor-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: #6a737d;
    margin-bottom: 1rem;
}

.content-editor-breadcrumb .separator {
    color: #d1d5da;
}

.content-editor-breadcrumb .current-page {
    color: #24292f;
    font-weight: 600;
}

.content-editor-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
    overflow: hidden;
}

.content-editor-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background: #f6f8fa;
    border-bottom: 1px solid #d1d5da;
    font-size: 0.85rem;
    font-weight: 600;
    color: #24292f;
}

.content-editor-card-header .file-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.content-editor-card-header .file-info i {
    color: #57606a;
}

.content-editor-card-body {
    padding: 1.5rem;
}

.content-editor-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    color: #8b949e;
    text-align: center;
}

.content-editor-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.content-editor-empty p {
    font-size: 0.95rem;
    max-width: 300px;
}
