/* === Variable aliases (map to existing navy scale) === */
:root {
    --gray-50: var(--navy-50);
    --gray-100: var(--navy-100);
    --gray-200: var(--navy-200);
    --gray-300: var(--navy-300);
    --gray-400: var(--navy-400);
    --gray-500: var(--navy-500);
    --gray-600: var(--navy-600);
    --gray-700: var(--navy-700);
    --gray-800: var(--navy-800);
    --primary: var(--primary-500);
}

/* === Dashboard layout === */
.dashboard {
    padding: 2rem 0;
    max-width: 960px;
    margin: 0 auto;
}
.dashboard h1 { margin-bottom: 0.5rem; }
.dashboard h2 { margin-bottom: 0.75rem; font-size: 1.1rem; }

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--navy-200);
}
.site-links { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* === Dashboard cards — the main structure fix === */
.dash-card {
    background: white;
    border: 1px solid var(--navy-200);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow);
}
.dash-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}
.dash-card-header h2 { margin: 0; }
.dash-card-muted { color: var(--navy-500); font-size: 0.85rem; }

/* === Two-column dashboard grid === */
.dash-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}
@media (max-width: 768px) {
    .dash-grid { grid-template-columns: 1fr; }
}

/* === Help panel === */
.help-panel {
    background: white;
    border: 1px solid var(--navy-200);
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.help-toggle {
    display: block;
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--primary-500);
    background: var(--navy-50);
    border-bottom: 1px solid var(--navy-200);
    user-select: none;
    list-style: none;
}
.help-toggle::-webkit-details-marker { display: none; }
.help-toggle::before { content: '+ '; font-weight: 700; }
.help-panel[open] .help-toggle::before { content: '- '; }
.help-toggle:hover { background: var(--navy-100); }
.help-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    padding: 1.25rem;
    background: var(--navy-50);
}
.help-card {
    background: white;
    border: 1px solid var(--navy-100);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
}
.help-card h3 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--navy-800);
}
.help-card p, .help-card li { font-size: 0.82rem; color: var(--navy-600); line-height: 1.6; }
.help-card ol, .help-card ul { padding-left: 1.25rem; margin-bottom: 0; }
.help-card .code-block {
    background: var(--navy-900);
    color: var(--navy-300);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    overflow-x: auto;
    white-space: pre;
}
.help-card .badge-sm {
    display: inline-block;
    font-size: 0.68rem;
    padding: 0.15rem 0.45rem;
    background: var(--navy-100);
    color: var(--navy-600);
    border-radius: 4px;
    margin: 0.1rem;
    font-weight: 600;
}

/* === Quota bar === */
.quota-bar {
    background: var(--navy-200);
    border-radius: 20px;
    height: 26px;
    position: relative;
    overflow: hidden;
}
.quota-fill {
    background: var(--gradient-button);
    height: 100%;
    border-radius: 20px;
    transition: width 0.3s;
    min-width: 0;
}
.quota-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--navy-700);
    white-space: nowrap;
}
.quota-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--navy-500);
    margin-bottom: 0.4rem;
}

/* === Dropzone === */
.dropzone {
    border: 2px dashed var(--navy-300);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    transition: all 0.2s;
    background: var(--navy-50);
}
.dropzone.drag-over { border-color: var(--primary-500); background: #eef2ff; }
.dropzone-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.dropzone-content p { color: var(--navy-500); margin: 0; }
.dropzone-link { color: var(--primary-500); cursor: pointer; text-decoration: underline; }
.dropzone-buttons { display: flex; gap: 0.5rem; justify-content: center; margin-top: 0.75rem; }
.dropzone-hint { font-size: 0.72rem; color: var(--navy-400); margin-top: 0.75rem !important; }

.upload-progress { margin-top: 1rem; }
.upload-item { padding: 0.3rem 0; font-size: 0.85rem; }
.upload-item.success { color: var(--success); }
.upload-item.error { color: var(--danger); }

/* === File list === */
.file-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}
.file-list-header h2 { margin: 0; font-size: 1rem; }
.file-list-actions { display: flex; gap: 0.5rem; }

.new-folder-inline { margin-bottom: 0.75rem; }
.new-folder-form { display: flex; gap: 0.5rem; align-items: center; }
.new-folder-form .form-control { max-width: 220px; }

.file-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.file-table th {
    background: var(--navy-100);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--navy-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.file-table th, .file-table td {
    padding: 0.55rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--navy-100);
}
.file-table tr:last-child td { border-bottom: none; }
.file-table tr:hover td { background: var(--navy-50); }
.file-icon { margin-right: 0.3rem; }
.file-actions { display: flex; gap: 0.3rem; align-items: center; justify-content: flex-end; }

/* === Empty state === */
.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--navy-400);
    background: var(--navy-50);
    border-radius: var(--radius-sm);
    border: 1px dashed var(--navy-200);
}

/* === Live preview === */
.preview-header { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; }
.preview-container {
    border: 1px solid var(--navy-200);
    border-radius: var(--radius);
    overflow: hidden;
}
.preview-iframe { width: 100%; height: 500px; border: none; background: white; }

/* === Settings === */
.settings-card h2 { margin-bottom: 0.5rem; }
.settings-form { margin-bottom: 0.75rem; }
.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--navy-100);
}
.setting-row:last-child { border-bottom: none; }
.setting-desc { font-size: 0.78rem; color: var(--navy-400); margin: 0.15rem 0 0; }

/* Toggle switch */
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; cursor: pointer; inset: 0;
    background: var(--navy-300); border-radius: 24px; transition: 0.3s;
}
.toggle-slider::before {
    content: ''; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px;
    background: white; border-radius: 50%; transition: 0.3s;
}
.toggle input:checked + .toggle-slider { background: var(--primary-500); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* === Referral bar === */
.referral-bar {
    background: var(--navy-50);
    border: 1px solid var(--navy-200);
    border-radius: var(--radius-sm);
    padding: 0.6rem 1rem;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.referral-bar code {
    background: var(--navy-200);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    user-select: all;
}

/* === Stats grid (admin) === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: white;
    border: 1px solid var(--navy-200);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    box-shadow: var(--shadow);
}
.stat-value { font-size: 1.8rem; font-weight: 800; color: var(--primary-500); }
.stat-label { font-size: 0.8rem; color: var(--navy-500); margin-top: 0.15rem; }

.admin-links { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.pagination { display: flex; align-items: center; gap: 1rem; justify-content: center; margin-top: 1.5rem; }

/* === Bandwidth === */
.bandwidth-section { margin-bottom: 0; }
.quota-bar-danger { background: #fecaca; }
.quota-fill-danger { background: var(--danger); }

/* === Upsell banner === */
.upsell-banner {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}
.upsell-banner.upsell-warning {
    background: #fffbeb;
    border-color: #fde68a;
}
.upsell-content strong { display: block; margin-bottom: 0.25rem; }
.upsell-content p { font-size: 0.9rem; color: var(--navy-500); margin-bottom: 0.75rem; }

/* === Code editor === */
.editor-container { margin-top: 1rem; }
.editor-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; gap: 1rem; flex-wrap: wrap; }
.editor-path { font-size: 0.85rem; color: var(--navy-400); font-family: 'JetBrains Mono', monospace; margin-left: 0.75rem; }
.CodeMirror { border: 1px solid var(--navy-200); border-radius: var(--radius); font-size: 0.85rem; height: auto; min-height: 400px; }
.editor-actions { display: flex; gap: 0.5rem; margin-top: 1rem; }
.editor-status { font-size: 0.85rem; color: var(--navy-500); margin-top: 0.5rem; }
.editor-status.saved { color: var(--success); }
.editor-status.error { color: var(--danger); }

/* === Admin two-column layout === */
.admin-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}
@media (max-width: 768px) {
    .admin-two-col { grid-template-columns: 1fr; }
}
.admin-panel {
    background: white;
    border: 1px solid var(--navy-200);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
}
.admin-panel h3 { font-size: 0.9rem; font-weight: 700; margin-bottom: 0.75rem; color: var(--navy-700); }
.admin-panel table { width: 100%; font-size: 0.82rem; }
.admin-panel td, .admin-panel th { padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--navy-100); }

/* Admin search */
.admin-search { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; }
.admin-search .form-control { max-width: 300px; }

/* Admin tabs */
.admin-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--navy-200);
}
.tab {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--navy-400);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}
.tab:hover { color: var(--navy-700); }
.tab.active { color: var(--primary-500); border-bottom-color: var(--primary-500); }

/* Bulk action bar */
.bulk-bar {
    background: var(--navy-800);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.bulk-bar span { font-size: 0.85rem; }
.bulk-bar .btn { margin-left: 0.5rem; }

/* Revenue cards */
.revenue-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.revenue-card {
    background: white;
    border: 1px solid var(--navy-200);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
}
.revenue-value { font-size: 1.8rem; font-weight: 800; color: var(--primary-500); }
.revenue-label { font-size: 0.8rem; color: var(--navy-500); }

/* Detail grid */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.5rem 2rem;
    margin: 1rem 0;
    font-size: 0.88rem;
}

/* Mail form */
.mail-form {
    background: var(--navy-50);
    border: 1px solid var(--navy-200);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-top: 1.5rem;
}
.mail-form h3 { font-size: 0.95rem; margin-bottom: 0.75rem; }
.mail-form .form-group { margin-bottom: 0.75rem; }
.mail-form textarea { min-height: 100px; }

/* === Showcase === */
.showcase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}
.showcase-card {
    background: white;
    border: 1px solid var(--navy-200);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}
.showcase-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.showcase-screenshot {
    width: 100%;
    height: 200px;
    background: var(--navy-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--navy-400);
    font-size: 0.85rem;
    overflow: hidden;
}
.showcase-screenshot img { width: 100%; height: 100%; object-fit: cover; }
.showcase-info { padding: 1rem 1.25rem; }
.showcase-info h3 { font-size: 1rem; margin-bottom: 0.25rem; }
.showcase-info p { font-size: 0.85rem; color: var(--navy-500); margin-bottom: 0.5rem; }

/* === Domain page === */
.domain-active-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}
.domain-badges { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.domain-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
}
.domain-badge-ok { background: #dcfce7; color: #166534; }
.domain-badge-pending { background: #fef9c3; color: #854d0e; }
.domain-error { font-size: 0.82rem; color: var(--danger); margin-top: 0.5rem; }

/* Domain setup steps */
.domain-steps { display: flex; flex-direction: column; gap: 1.5rem; }
.domain-step { display: flex; gap: 1rem; }
.domain-step-num {
    flex-shrink: 0;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--primary-500);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}
.domain-step-content { flex: 1; }
.domain-step-content h3 { font-size: 0.95rem; margin-bottom: 0.3rem; }
.domain-step-content p { font-size: 0.85rem; color: var(--navy-500); margin-bottom: 0.5rem; }

/* DNS record display */
.domain-dns-block {
    background: var(--navy-50);
    border: 1px solid var(--navy-200);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.domain-dns-row {
    display: flex;
    border-bottom: 1px solid var(--navy-200);
    font-size: 0.82rem;
}
.domain-dns-row:last-child { border-bottom: none; }
.domain-dns-label {
    width: 70px;
    padding: 0.45rem 0.75rem;
    background: var(--navy-100);
    font-weight: 600;
    color: var(--navy-500);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.domain-dns-value {
    padding: 0.45rem 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--navy-800);
    user-select: all;
}

/* === Breadcrumbs & folder links === */
.breadcrumb-nav { font-size: 0.82rem; color: var(--navy-400); }
.breadcrumb-link { color: var(--primary-500); text-decoration: none; font-weight: 600; }
.breadcrumb-link:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--navy-300); margin: 0 0.15rem; }
.breadcrumb-current { color: var(--navy-600); font-weight: 600; }
.folder-link { color: var(--navy-800); text-decoration: none; font-weight: 600; }
.folder-link:hover { color: var(--primary-500); text-decoration: underline; }

/* === Badge small (inline) === */
.badge-sm {
    display: inline-block;
    font-size: 0.68rem;
    padding: 0.15rem 0.45rem;
    background: var(--navy-100);
    color: var(--navy-600);
    border-radius: 4px;
    margin: 0.1rem;
    font-weight: 600;
}

/* === Inline form === */
.inline-form { display: inline; }

/* === Disabled button === */
.btn-disabled {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--navy-400);
    background: var(--navy-100);
    border: 1px solid var(--navy-200);
    border-radius: var(--radius-sm);
    cursor: not-allowed;
    opacity: 0.7;
    text-decoration: none;
}

/* === Sites grid === */
.sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}
.site-card {
    display: block;
    background: white;
    border: 1px solid var(--navy-200);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow);
    transition: transform 0.15s, box-shadow 0.15s;
}
.site-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: var(--primary-500);
}
.site-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.site-card-header h3 { font-size: 1.1rem; margin: 0; color: var(--navy-800); }
.site-card-meta { font-size: 0.78rem; color: var(--navy-400); margin-bottom: 0.5rem; }
.site-card-stats { font-size: 0.78rem; color: var(--navy-500); }

.site-card-new {
    border-style: dashed;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    color: var(--navy-400);
}
.site-card-new:hover { color: var(--primary-500); }
.site-card-new-icon { font-size: 2rem; font-weight: 300; line-height: 1; margin-bottom: 0.25rem; }
.site-card-new p { margin: 0; font-size: 0.85rem; }

/* === Site switcher === */
.site-switcher {
    font-size: 0.82rem;
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--navy-300);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--navy-700);
    cursor: pointer;
}

/* === New site form === */
.input-suffix-group {
    display: flex;
    align-items: center;
}
.input-suffix-group .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}
.input-suffix {
    padding: 0.5rem 0.75rem;
    background: var(--navy-100);
    border: 1px solid var(--navy-300);
    border-top-right-radius: var(--radius-sm);
    border-bottom-right-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: var(--navy-500);
    white-space: nowrap;
}
.form-hint { font-size: 0.78rem; color: var(--navy-400); margin-top: 0.35rem; }
