/* =========================================
   Hosting Panel — Dark Theme CSS
   ========================================= */

/* ---- CSS Custom Properties ---- */
:root {
    --bg:           #0d1117;
    --bg-secondary: #161b22;
    --card:         #1c2128;
    --card-hover:   #22272e;
    --border:       #30363d;
    --border-muted: #21262d;
    --text:         #e6edf3;
    --text-muted:   #8b949e;
    --text-link:    #58a6ff;

    --blue:         #388bfd;
    --blue-hover:   #58a6ff;
    --green:        #3fb950;
    --green-hover:  #56d364;
    --red:          #f85149;
    --red-hover:    #ff6a60;
    --yellow:       #d29922;
    --yellow-hover: #e3b341;
    --orange:       #e3721c;
    --grey:         #6e7681;

    --sidebar-width: 250px;
    --topbar-height: 60px;

    --radius-sm: 4px;
    --radius:    6px;
    --radius-lg: 10px;

    --shadow:    0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.5);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.6);

    --transition: 150ms ease;
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: var(--text-link);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover { color: var(--blue-hover); }

h1, h2, h3, h4 {
    font-weight: 600;
    line-height: 1.25;
    color: var(--text);
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.5rem 0;
}

/* ---- Layout ---- */
.layout {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 200;
    transition: transform var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.sidebar-logo svg {
    color: var(--blue);
    flex-shrink: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color var(--transition), color var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.nav-item:hover {
    background-color: var(--card);
    color: var(--text);
}

.nav-item.active {
    background-color: rgba(56,139,253,0.15);
    color: var(--blue-hover);
}

.nav-item svg { flex-shrink: 0; }

.nav-divider {
    height: 1px;
    background: var(--border);
    margin: 0.5rem 0.75rem;
}

.api-status-item {
    cursor: default;
}
.api-status-item:hover {
    background-color: transparent;
    color: var(--text-muted);
}

.api-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: auto;
    flex-shrink: 0;
}
.api-dot-online   { background-color: var(--green); box-shadow: 0 0 6px var(--green); }
.api-dot-offline  { background-color: var(--red);   box-shadow: 0 0 6px var(--red); }
.api-dot-checking { background-color: var(--grey);  animation: dot-pulse 1.4s ease-in-out infinite; }
@keyframes dot-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

.sidebar-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.8125rem;
    overflow: hidden;
}

.sidebar-user span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- Main Wrapper ---- */
.main-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ---- Topbar ---- */
.topbar {
    height: var(--topbar-height);
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: color var(--transition);
}
.sidebar-toggle:hover { color: var(--text); }

.topbar-title {
    font-size: 1rem;
    font-weight: 600;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

/* ---- Content ---- */
.content {
    flex: 1;
    padding: 1.5rem;
    overflow-x: hidden;
}

/* ---- Flash Container ---- */
.flash-container {
    padding: 0.75rem 1.5rem 0;
}

/* ---- Cards ---- */
.card {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-muted);
}

.card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
}

.card-body { /* just for semantic clarity */ }

/* ---- Stat Cards ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: border-color var(--transition), background-color var(--transition);
}

.stat-card:hover {
    border-color: var(--border-muted);
    background-color: var(--card-hover);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.25rem;
}

.stat-icon-blue   { background: rgba(56,139,253,0.15); color: var(--blue); }
.stat-icon-green  { background: rgba(63,185,80,0.15);  color: var(--green); }
.stat-icon-yellow { background: rgba(210,153,34,0.15); color: var(--yellow); }
.stat-icon-red    { background: rgba(248,81,73,0.15);  color: var(--red); }
.stat-icon-grey   { background: rgba(110,118,129,0.15);color: var(--grey); }

.stat-info { flex: 1; min-width: 0; }

.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background-color var(--transition), border-color var(--transition), color var(--transition), opacity var(--transition);
    white-space: nowrap;
    line-height: 1.25;
    background: none;
}

.btn:disabled, .btn.loading {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background-color: var(--blue);
    border-color: var(--blue);
    color: #fff;
}
.btn-primary:hover { background-color: var(--blue-hover); border-color: var(--blue-hover); color: #fff; }

.btn-success {
    background-color: var(--green);
    border-color: var(--green);
    color: #fff;
}
.btn-success:hover { background-color: var(--green-hover); border-color: var(--green-hover); color: #fff; }

.btn-danger {
    background-color: var(--red);
    border-color: var(--red);
    color: #fff;
}
.btn-danger:hover { background-color: var(--red-hover); border-color: var(--red-hover); color: #fff; }

.btn-warning {
    background-color: var(--yellow);
    border-color: var(--yellow);
    color: #fff;
}
.btn-warning:hover { background-color: var(--yellow-hover); border-color: var(--yellow-hover); color: #fff; }

.btn-secondary {
    background-color: transparent;
    border-color: var(--border);
    color: var(--text-muted);
}
.btn-secondary:hover { background-color: var(--card); border-color: var(--text-muted); color: var(--text); }

.btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.8125rem;
}

.btn-icon {
    padding: 0.375rem;
    aspect-ratio: 1;
}

.btn-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

/* ---- Badges ---- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2em 0.55em;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.badge-active    { background: rgba(63,185,80,0.15);   color: var(--green);  border: 1px solid rgba(63,185,80,0.3); }
.badge-suspended { background: rgba(210,153,34,0.15);  color: var(--yellow); border: 1px solid rgba(210,153,34,0.3); }
.badge-stopped   { background: rgba(110,118,129,0.15); color: var(--grey);   border: 1px solid rgba(110,118,129,0.3); }
.badge-expired   { background: rgba(248,81,73,0.15);   color: var(--red);    border: 1px solid rgba(248,81,73,0.3); }
.badge-info      { background: rgba(56,139,253,0.15);  color: var(--blue);   border: 1px solid rgba(56,139,253,0.3); }
.badge-none      { background: rgba(110,118,129,0.1);  color: var(--grey);   border: 1px solid rgba(110,118,129,0.2); }

.expiry-soon    { color: var(--orange); font-weight: 600; }
.expiry-expired { color: var(--red);    font-weight: 600; }
.expiry-ok      { color: var(--green); }
.expiry-none    { color: var(--grey); }

/* ---- Tables ---- */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

table.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table thead th {
    background-color: var(--bg-secondary);
    color: var(--text-muted);
    font-weight: 600;
    padding: 0.6rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
}

.table tbody tr {
    border-bottom: 1px solid var(--border-muted);
    transition: background-color var(--transition);
}

.table tbody tr:last-child { border-bottom: none; }

.table tbody tr:hover { background-color: var(--card-hover); }

.table tbody td {
    padding: 0.75rem 1rem;
    color: var(--text);
    vertical-align: middle;
}

.table-empty {
    text-align: center;
    padding: 2.5rem 1rem !important;
    color: var(--text-muted) !important;
}

/* ---- Forms ---- */
.form-group {
    margin-bottom: 1.1rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 0.375rem;
}

.form-label-muted {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 0.375rem;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.875rem;
    line-height: 1.5;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
    font-family: inherit;
}

.form-control:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(56,139,253,0.2);
}

.form-control::placeholder { color: var(--text-muted); opacity: 0.7; }

.form-control:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

select.form-control {
    cursor: pointer;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.form-error {
    font-size: 0.75rem;
    color: var(--red);
    margin-top: 0.3rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

/* ---- Tabs ---- */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
    overflow-x: auto;
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    transition: color var(--transition), border-color var(--transition);
    text-decoration: none;
}

.tab-btn:hover { color: var(--text); }

.tab-btn.active {
    color: var(--blue-hover);
    border-bottom-color: var(--blue);
}

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ---- Alerts ---- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    line-height: 1.5;
    position: relative;
    border: 1px solid transparent;
    margin-bottom: 1rem;
}

.alert svg { flex-shrink: 0; margin-top: 2px; }

.alert-close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0;
    transition: opacity var(--transition);
}
.alert-close:hover { opacity: 1; }

.alert-success { background: rgba(63,185,80,0.1);  border-color: rgba(63,185,80,0.3);  color: var(--green); }
.alert-danger  { background: rgba(248,81,73,0.1);  border-color: rgba(248,81,73,0.3);  color: var(--red); }
.alert-warning { background: rgba(210,153,34,0.1); border-color: rgba(210,153,34,0.3); color: var(--yellow); }
.alert-info    { background: rgba(56,139,253,0.1); border-color: rgba(56,139,253,0.3); color: var(--blue-hover); }

/* ---- Modal ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    max-width: 480px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95);
    transition: transform var(--transition);
}

.modal-overlay.open .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.modal-title {
    font-size: 1rem;
    font-weight: 600;
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0;
    transition: color var(--transition);
}
.modal-close-btn:hover { color: var(--text); }

.modal-body {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.modal-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* ---- Progress Bar ---- */
.progress-container {
    background: var(--bg);
    border-radius: 20px;
    height: 8px;
    overflow: hidden;
    border: 1px solid var(--border-muted);
}

.progress-bar {
    height: 100%;
    border-radius: 20px;
    transition: width 0.6s ease;
    min-width: 2px;
}

.progress-bar-blue   { background: var(--blue); }
.progress-bar-green  { background: var(--green); }
.progress-bar-yellow { background: var(--yellow); }
.progress-bar-red    { background: var(--red); }

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

/* ---- Container Stats ---- */
.stats-loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-item {
    background: var(--bg);
    border: 1px solid var(--border-muted);
    border-radius: var(--radius);
    padding: 0.75rem;
}

.stat-item-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
}

.stat-item-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

/* ---- Danger Zone ---- */
.danger-zone {
    border: 1px solid rgba(248,81,73,0.4);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-top: 1.5rem;
}

.danger-zone-title {
    color: var(--red);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.danger-zone-body {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ---- Page Header ---- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-header-title {
    font-size: 1.25rem;
    font-weight: 600;
}

/* ---- Search/Filter Bar ---- */
.filter-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.filter-bar .form-control {
    max-width: 300px;
}

/* ---- Info List ---- */
.info-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 1.5rem;
    font-size: 0.875rem;
}

.info-list dt {
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}

.info-list dd {
    color: var(--text);
    word-break: break-word;
}

/* ---- Section Title ---- */
.section-title {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    margin-top: 1.5rem;
}

.section-title:first-child { margin-top: 0; }

/* ---- Spinner ---- */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Site control loading overlay ---- */
#siteControlOverlay {
    position: fixed;
    inset: 0;
    background: rgba(13, 17, 23, 0.82);
    backdrop-filter: blur(3px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.loading-overlay-inner {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem 3rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
    max-width: 360px;
}
.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    margin: 0 auto 1.25rem;
}
.loading-message {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}
.loading-hint {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

.empty-state svg {
    opacity: 0.3;
    margin-bottom: 1rem;
}

.empty-state-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.empty-state-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    opacity: 0.7;
}

/* ---- Pagination ---- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 0.875rem;
    text-decoration: none;
    transition: all var(--transition);
}

.page-link:hover {
    background: var(--card);
    color: var(--text);
    border-color: var(--text-muted);
}

.page-link.active {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
}

.page-link.disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* ---- Login Page ---- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 1rem;
}

.login-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    text-align: center;
    margin-bottom: 1.75rem;
}

.login-logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: rgba(56,139,253,0.15);
    border-radius: var(--radius-lg);
    margin-bottom: 0.75rem;
    color: var(--blue);
}

.login-logo-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.login-logo-subtitle {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ---- Utilities ---- */
.text-muted   { color: var(--text-muted); }
.text-success { color: var(--green); }
.text-danger  { color: var(--red); }
.text-warning { color: var(--yellow); }
.text-primary { color: var(--blue); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.flex-wrap { flex-wrap: wrap; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }

.w-100 { width: 100%; }
.text-right { text-align: right; }
.text-center { text-align: center; }

.font-mono { font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace; font-size: 0.8125rem; }

.code-text {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.8125rem;
    background: var(--bg);
    border: 1px solid var(--border-muted);
    border-radius: var(--radius-sm);
    padding: 0.125rem 0.375rem;
    color: var(--text);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 150;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.open {
        display: block;
    }

    .main-wrapper {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: flex;
    }

    .topbar-user {
        display: none;
    }

    .content {
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .filter-bar .form-control {
        max-width: 100%;
    }

    .table tbody td,
    .table thead th {
        padding: 0.6rem 0.75rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .btn-group {
        flex-direction: column;
        align-items: flex-start;
    }

    .modal {
        padding: 1.25rem;
    }
}

/* =========================================
   File Manager
   ========================================= */

.fm-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.fm-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    flex-wrap: wrap;
    font-size: 0.875rem;
    color: var(--text-muted);
    min-width: 0;
}

.fm-bc-item {
    color: var(--text-link);
    text-decoration: none;
    padding: 0.15rem 0.3rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
    white-space: nowrap;
}
.fm-bc-item:hover { background: var(--card-hover); }
.fm-bc-current { color: var(--text); font-weight: 500; cursor: default; }
.fm-bc-sep { color: var(--border); padding: 0 0.1rem; user-select: none; }

.fm-name-link {
    color: var(--text-link);
    text-decoration: none;
    font-weight: 500;
}
.fm-name-link:hover { text-decoration: underline; }

.fm-filename { color: var(--text); }

/* Drag-and-drop overlay */
.fm-drop-hint {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2.5rem 1rem;
    margin-bottom: 0.75rem;
    border: 2px dashed var(--blue);
    border-radius: var(--radius);
    color: var(--text-muted);
    background: rgba(56, 139, 253, 0.06);
    pointer-events: none;
    font-size: 0.9rem;
}

/* Monaco Editor full-screen modal */
.fm-editor-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 1.5rem;
}

.fm-editor-dialog {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1280px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.fm-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    flex-shrink: 0;
    gap: 1rem;
}

.fm-editor-filename {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.85rem;
    color: var(--text);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#fmEditorContainer {
    flex: 1;
    min-height: 0;
    height: calc(100vh - 10rem);
}

@media (max-width: 768px) {
    .fm-editor-modal { padding: 0; }
    .fm-editor-dialog { border-radius: 0; }
    #fmEditorContainer { height: calc(100vh - 56px); }
}
