/* --- LOCAL FONTS (Lexend) --- */
@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@300;400;500;600;700&display=swap');

:root {
    --bg: #F5F3EF; --surface: #FFFFFF; --text-main: #141414; --text-light: #666666;
    --primary: #66023c; --accent: #2e8b57; --danger: #b91c1c; --border: #E0E0E0;
    --radius: 8px; --shadow: 0 4px 20px rgba(0,0,0,0.03); --glass: rgba(255, 255, 255, 0.98);
    --sidebar-width: 260px;
}

* { box-sizing: border-box; margin: 0; padding: 0; outline: none; -webkit-font-smoothing: antialiased; }
body { font-family: 'Lexend', sans-serif; background-color: var(--bg); color: var(--text-main); line-height: 1.4; height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
button, input, select, textarea, .btn, body { font-family: 'Lexend', sans-serif !important; font-size: 0.85rem; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.02em; } a { text-decoration: none; color: inherit; transition: 0.2s; }

/* Branding */
.brand { display: inline-flex; align-items: baseline; gap: 6px; user-select: none; line-height: 1; white-space: nowrap; }
.brand big { font-weight: 700; color: var(--primary); letter-spacing: -0.04em; }
.brand .dot { color: var(--accent); font-size: 1em; margin: 0 1px; }
.brand small { font-weight: 300; color: #888; letter-spacing: -0.02em; }
.brand-lg big { font-size: 4rem; } .brand-md big { font-size: 2rem; } .brand-sm big { font-size: 1.4rem; } .brand-sm small { font-size: 0.8rem; }

/* Layouts */
.layout-center { height: 100vh; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; position: relative; overflow-y: auto; }
.layout-dash { display: flex; height: 100vh; width: 100%; }
.main-content { flex: 1; padding: 30px 40px; width: 100%; overflow-x: hidden; height: 100vh; overflow-y: auto; }

/* Components */
.card { background: var(--glass); backdrop-filter: blur(12px); padding: 40px; border-radius: 20px; width: 100%; max-width: 460px; box-shadow: var(--shadow); border: 1px solid #FFF; text-align: center; z-index: 2; }
.card-dash { background: var(--surface); padding: 25px; border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 20px; }
.site-footer { margin-top: 40px; font-size: 0.75rem; color: #999; text-align: center; line-height: 1.5; opacity: 0.6; max-width: 400px; margin-left: auto; margin-right: auto; }

/* Forms */
.input-group { margin-bottom: 15px; text-align: left; }
.input-group label { display: block; font-size: 0.7rem; font-weight: 700; margin-bottom: 5px; color: #888; text-transform: uppercase; letter-spacing: 0.5px; }
input, select, textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: #FAFAFA; transition: 0.2s; color: var(--text-main); font-weight: 300; }
input:focus, select:focus { border-color: var(--primary); background: #FFF; box-shadow: 0 0 0 3px rgba(102, 2, 60, 0.06); }

/* Checkbox fix */
input[type="checkbox"] { width: auto; height: auto; padding: 0; border: none; background: transparent; box-shadow: none; display: inline-block; accent-color: var(--primary); cursor: pointer; }
input[type="checkbox"]:focus { box-shadow: none; }

.prefix-group { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #FAFAFA; transition: 0.2s; }
.prefix-group:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(102, 2, 60, 0.06); background: #FFF; }
.prefix-addon { display: flex; align-items: center; padding: 0 12px; background: #EEE; color: #666; font-size: 0.85rem; border-right: 1px solid var(--border); user-select: none; }
.prefix-group input { border: none; box-shadow: none; background: transparent; border-radius: 0; padding: 10px 12px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; width: 100%; padding: 10px; border: none; border-radius: var(--radius); background: var(--primary); color: #FFF; font-weight: 500; cursor: pointer; font-size: 0.9rem; transition: 0.2s; text-transform: none; }
.btn:hover { opacity: 0.95; transform: translateY(-1px); }
.btn-accent { background: var(--accent); }
.btn-danger { background: #fee2e2; color: var(--danger); } .btn-danger:hover { background: #fecaca; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; width: auto; }
.btn-ghost { background: transparent; color: var(--text-light); border: 1px solid var(--border); } .btn-ghost:hover { border-color: var(--text-main); color: var(--text-main); background: #FFF; }
.btn-dashed { background: #FAFAFA; color: #666; border: 1px dashed #CCC; transition: 0.2s; cursor: pointer; text-transform: none; font-weight: 500; } 
.btn-dashed:hover { border-color: var(--primary); color: var(--primary); background: #FFF; transform: translateY(-1px); }
.btn-icon { padding: 4px; background: transparent; border: none; color: #ccc; cursor: pointer; font-size: 0.9rem; width: auto; border-radius: 4px; transition: 0.2s; display: flex; align-items: center; } .btn-icon:hover { color: var(--primary); background: rgba(102,2,60,0.05); }

/* File Upload */
.file-upload-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.file-upload-wrapper { position: relative; display: flex; align-items: center; gap: 8px; }
input[type="file"] { display: none; }
#file-name-display { font-size: 0.8rem; color: #888; font-weight: 300; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Sidebar */
.sidebar { width: var(--sidebar-width); background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; height: 100vh; flex-shrink: 0; }
.sidebar-header { padding: 25px 20px; flex-shrink: 0; display: flex; align-items: center; height: 80px; }
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 10px 20px; }
.sidebar-footer { padding: 20px; border-top: 1px solid var(--border); flex-shrink: 0; background: #FAFAFA; }
.nav-group { margin-bottom: 25px; }
.nav-title { font-size: 0.65rem; text-transform: uppercase; color: #AAA; font-weight: 700; margin-bottom: 10px; letter-spacing: 0.5px; }
.nav-link { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-radius: 6px; color: var(--text-light); font-weight: 400; margin-bottom: 2px; font-size: 0.85rem; position: relative; text-decoration: none; user-select: none; transition: 0.1s; }
.nav-link:hover { background: var(--bg); color: var(--primary); } .nav-link:hover .rename-icon { opacity: 1; }
.nav-link.active { background: rgba(102, 2, 60, 0.06); color: var(--primary); font-weight: 600; }
.count-badge { font-size: 0.7rem; background: #EEE; padding: 1px 6px; border-radius: 10px; color: #666; min-width: 20px; text-align: center; }
.nav-link.active .count-badge { background: var(--primary); color: white; }
.rename-icon { opacity: 0; transition: 0.2s; margin-left: 6px; }
.proj-search { padding: 8px 10px; font-size: 0.8rem; margin-bottom: 10px; background: #FAFAFA; width: 100%; }

/* User Card */
.user-card { display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 32px; height: 32px; background: linear-gradient(135deg, #66023c, #be123c); border-radius: 50%; flex-shrink: 0; }
.user-info { display: flex; flex-direction: column; overflow: hidden; }
.user-name { font-size: 0.85rem; font-weight: 600; color: var(--text-main); text-transform: uppercase; }
.user-role { font-size: 0.7rem; color: #999; }

/* Filter & Bulk */
.filter-bar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; align-items: flex-end; }
.filter-select { flex: 1; min-width: 120px; }
.bulk-actions { display: flex; gap: 8px; background: #fff; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; align-items: center; box-shadow: 0 2px 5px rgba(0,0,0,0.02); }

/* Table */
.table-wrapper { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { background: #FAFAFA; padding: 12px 15px; text-align: left; font-size: 0.7rem; text-transform: uppercase; color: var(--text-light); font-weight: 700; white-space: nowrap; }
td { padding: 10px 15px; border-top: 1px solid var(--border); font-size: 0.85rem; color: #555; vertical-align: middle; font-weight: 300; }
tr:hover td { background: #FCFCFC; }
.check-cell { width: 30px; text-align: center; padding-left: 10px; padding-right: 10px; }
.tag { display: inline-block; padding: 3px 8px; background: #F0F0F0; border-radius: 6px; font-size: 0.7rem; font-weight: 500; color: #666; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.is-live { background: var(--accent); } .is-arch { background: #f59e0b; } .is-dead { background: var(--danger); } .is-null { background: #ccc; }
.last-checked { display: block; font-size: 0.65rem; color: #AAA; margin-top: 2px; }

/* Utils */
.alert { padding: 10px 15px; border-radius: 8px; margin-bottom: 20px; font-size: 0.85rem; background: #eee; }
.alert-success { background: #dcfce7; color: #14532d; } .alert-error { background: #fee2e2; color: #7f1d1d; }
.flex-row { display: flex; gap: 10px; }
.error-box { margin-top: 10px; width: 100%; height: 100px; border: 1px solid #fecaca; background: #fff; padding: 10px; font-family: monospace; font-size: 0.8rem; color: var(--danger); resize: vertical; border-radius: 8px; }
.loader { width: 100%; height: 4px; background: #E5E5E5; margin-top: 25px; border-radius: 2px; overflow: hidden; }
.loader-bar { height: 100%; background: var(--accent); width: 0; animation: load 1s cubic-bezier(0.4, 0, 0.2, 1) forwards; } @keyframes load { to { width: 100%; } }
.svg-icon { width: 16px; height: 16px; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; fill: none; display: inline-block; vertical-align: middle; stroke: currentColor; }
.pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; font-size: 0.8rem; color: #666; }
.page-btn { text-decoration: none; padding: 6px 12px; border: 1px solid var(--border); border-radius: 6px; background: white; color: var(--text-main); transition: 0.1s; }
.page-btn:hover { border-color: var(--text-main); } .page-btn.disabled { opacity: 0.5; pointer-events: none; background: #f9f9f9; }

@media (max-width: 768px) {
    .layout-dash { flex-direction: column; } .sidebar { width: 100%; height: auto; overflow: visible; }
    .sidebar-scroll { max-height: 300px; border-bottom: 1px solid var(--border); } .main-content { padding: 20px; height: auto; overflow-y: visible; }
}