/* Smart Links Hub — Spacious Full-Canvas SaaS UI */
.slh-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1e293b;
    width: 100% !important;
    max-width: 1440px !important;
    margin: 0 auto !important;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.07);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    line-height: 1.5;
}
.slh-wrap * { box-sizing: border-box; }

/* Auth Card */
.slh-auth-outer {
    min-height: calc(100vh - 40px);
    display: flex;
    align-items: center;
    justify-content: center;
}
.slh-auth-wrap {
    max-width: 460px !important;
    padding: 34px 30px;
}
.slh-auth-header { text-align: center; margin-bottom: 22px; }
.slh-logo-badge {
    display: inline-block;
    font-size: 21px;
    font-weight: 700;
    color: #4f46e5;
    margin-bottom: 8px;
}
.slh-subtitle { color: #64748b; font-size: 14px; margin: 0; }
.slh-auth-tabs {
    display: flex;
    gap: 8px;
    background: #f1f5f9;
    padding: 5px;
    border-radius: 10px;
    margin-bottom: 20px;
}
.slh-auth-tabs .slh-tab-btn { flex: 1; text-align: center; }

/* Topbar */
.slh-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 28px;
    background: #0f172a;
    color: #ffffff;
    flex-wrap: wrap;
    gap: 12px;
}
.slh-brand { font-size: 18px; display: flex; align-items: center; gap: 8px; }
.slh-user-info { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.slh-user-name { font-size: 14px; font-weight: 500; color: #e2e8f0; }
.slh-role-pill {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 11px;
    border-radius: 999px;
}
.slh-role-admin { background: #ef4444; color: #fff; }
.slh-role-linker { background: #4f46e5; color: #fff; }
.slh-role-user { background: #475569; color: #fff; }
.slh-topbar .slh-btn-ghost { color: #cbd5e1; border: 1px solid #334155; }
.slh-topbar .slh-btn-ghost:hover { background: #1e293b; color: #fff; }

/* Main Tabs */
.slh-main-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 28px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}
.slh-tab-btn {
    border: none;
    background: transparent;
    color: #475569;
    font-size: 14px;
    font-weight: 600;
    padding: 9px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}
.slh-tab-btn:hover { background: #e2e8f0; color: #0f172a; }
.slh-tab-btn.active { background: #4f46e5; color: #ffffff; box-shadow: 0 2px 8px rgba(79,70,229,0.25); }
.slh-tab-admin.active { background: #0f172a; }

/* Panels */
.slh-panel { display: none; padding: 28px; }
.slh-panel.active { display: block; }
.slh-form { display: none; }
.slh-form.active { display: block; }

/* Toolbar */
.slh-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 22px;
    align-items: center;
}
.slh-toolbar .slh-input { flex: 1; min-width: 240px; }

/* Inputs & Forms */
.slh-field { margin-bottom: 18px; }
.slh-field label { display: block; font-size: 13.5px; font-weight: 600; color: #334155; margin-bottom: 6px; }
.slh-input, .slh-select, .slh-wrap textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #0f172a;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.slh-select { width: auto; min-width: 190px; }
.slh-field .slh-select { width: 100%; }
.slh-input:focus, .slh-select:focus, .slh-wrap textarea:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.slh-help { display: block; font-size: 12.5px; color: #64748b; margin-top: 6px; line-height: 1.45; }
.slh-checkbox-inline label { display: flex; align-items: flex-start; gap: 9px; font-weight: 500; cursor: pointer; }
.slh-checkbox-inline input { width: auto; margin-top: 3px; }

.slh-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}
.slh-field-full { grid-column: 1 / -1; }
.slh-card-form {
    max-width: 820px;
    margin: 0 auto;
    background: #f8fafc;
    padding: 28px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
}
.slh-card-form h3 { margin: 0 0 20px; font-size: 19px; }

.slh-slug-group {
    display: flex;
    align-items: center;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.slh-slug-prefix {
    background: #f1f5f9;
    padding: 10px 13px;
    font-size: 13.5px;
    color: #475569;
    border-right: 1px solid #cbd5e1;
    white-space: nowrap;
}
.slh-slug-group .slh-input { border: none; border-radius: 0; }
.slh-slug-status { display: block; font-size: 13px; margin-top: 6px; font-weight: 600; }
.slh-slug-ok { color: #16a34a; }
.slh-slug-err { color: #dc2626; }

/* Buttons */
.slh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}
.slh-btn-primary { background: #4f46e5; color: #ffffff; }
.slh-btn-primary:hover { background: #4338ca; color: #ffffff; }
.slh-btn-secondary { background: #e2e8f0; color: #0f172a; }
.slh-btn-secondary:hover { background: #cbd5e1; color: #0f172a; }
.slh-btn-danger { background: #fee2e2; color: #b91c1c; }
.slh-btn-danger:hover { background: #fecaca; }
.slh-btn-ghost { background: transparent; color: #475569; }
.slh-btn-ghost:hover { background: #f1f5f9; }
.slh-btn-sm { padding: 7px 13px; font-size: 13px; }
.slh-btn-block { width: 100%; }
.slh-icon-btn {
    border: 1px solid #e2e8f0;
    background: #fff;
    padding: 6px 10px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s;
}
.slh-icon-btn:hover { background: #f1f5f9; border-color: #cbd5e1; }
.slh-icon-btn.danger:hover { background: #fee2e2; border-color: #fca5a5; }

/* Spacious Table */
.slh-table-wrap { overflow-x: auto; border: 1px solid #e2e8f0; border-radius: 12px; }
.slh-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.slh-table th {
    background: #f8fafc;
    text-align: left;
    padding: 15px 18px;
    font-weight: 600;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}
.slh-table td {
    padding: 16px 18px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.slh-table tr:last-child td { border-bottom: none; }
.slh-table tr:hover td { background: #fafbff; }
.slh-col-cb { width: 42px; text-align: center; }
.slh-empty { text-align: center; color: #94a3b8; padding: 38px !important; }

.slh-link-title { font-weight: 600; color: #0f172a; display: block; margin-bottom: 4px; font-size: 14.5px; }
.slh-short-url { color: #4f46e5; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 13.5px; text-decoration: none; font-weight: 600; }
.slh-short-url:hover { text-decoration: underline; }
.slh-dest-cell { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #64748b; }
.slh-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    padding: 5px 11px;
    border-radius: 7px;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
}
.slh-clicks-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
}
.slh-qr-sub { font-size: 12px; color: #4f46e5; background: #eef2ff; padding: 3px 8px; border-radius: 6px; }
.slh-actions-cell { display: flex; gap: 7px; flex-wrap: nowrap; }

/* Toggle Switch */
.slh-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.slh-switch input { opacity: 0; width: 0; height: 0; }
.slh-slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1; transition: 0.25s; border-radius: 24px;
}
.slh-slider:before {
    position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px;
    background-color: white; transition: 0.25s; border-radius: 50%;
}
.slh-switch input:checked + .slh-slider { background-color: #16a34a; }
.slh-switch input:checked + .slh-slider:before { transform: translateX(20px); }

/* Alerts & Toast */
.slh-alert { padding: 12px 15px; border-radius: 8px; font-size: 13.5px; margin-bottom: 16px; }
.slh-alert-error { background: #fee2e2; color: #991b1b; }
.slh-alert-success { background: #dcfce7; color: #166534; }
.slh-info-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    padding: 13px 16px;
    border-radius: 9px;
    font-size: 13.5px;
}
.slh-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #0f172a;
    color: #fff;
    padding: 13px 22px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    z-index: 999999;
}

/* CSV & Admin Grids */
.slh-csv-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}
.slh-admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}
.slh-card-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 24px;
    min-width: 0;
}
.slh-card-box h3 { margin: 0 0 14px; font-size: 17px; }
.slh-instructions { padding-left: 18px; font-size: 13.5px; color: #475569; margin: 12px 0 16px; }
.slh-instructions li { margin-bottom: 6px; }
.slh-csv-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.slh-csv-upload { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.slh-csv-result { margin-top: 14px; padding: 12px; border-radius: 8px; background: #fff; border: 1px solid #e2e8f0; font-size: 13px; }

/* Pagination */
.slh-pagination { display: flex; gap: 6px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.slh-page-btn {
    border: 1px solid #cbd5e1;
    background: #fff;
    padding: 7px 13px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 13.5px;
}
.slh-page-btn.active { background: #4f46e5; color: #fff; border-color: #4f46e5; }

/* Modals */
.slh-modal {
    position: fixed; inset: 0; z-index: 99999;
    display: flex; align-items: center; justify-content: center; padding: 16px;
}
.slh-modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.55); }
.slh-modal-content {
    position: relative; background: #fff; width: 100%; max-width: 540px;
    border-radius: 14px; padding: 24px 26px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    max-height: 90vh; overflow-y: auto;
}
.slh-modal-sm { max-width: 410px; }
.slh-modal-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid #e2e8f0;
}
.slh-modal-header h3 { margin: 0; font-size: 17px; }
.slh-modal-close {
    background: transparent; border: none; font-size: 24px; cursor: pointer; color: #64748b; line-height: 1;
}
.slh-modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

.slh-qr-body { text-align: center; }
.slh-qr-title { font-weight: 700; margin-bottom: 12px; font-size: 15px; }
.slh-qr-box {
    display: inline-flex; justify-content: center; align-items: center;
    padding: 16px; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
    margin-bottom: 12px;
}
.slh-qr-url-box { margin-bottom: 10px; word-break: break-all; font-size: 12.5px; color: #4f46e5; }

@media (max-width: 960px) {
    .slh-form-grid, .slh-csv-grid, .slh-admin-grid { grid-template-columns: 1fr; }
    .slh-panel { padding: 18px; }
    .slh-topbar, .slh-main-tabs { padding: 14px 18px; }
}


/* 2-Step Icon & Color Picker (OnlineNotepad.io Style) */
.slh-picker-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 14px 16px;
}
.slh-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.slh-picker-preview-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}
.slh-picker-preview {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0,0,0,0.06);
    flex-shrink: 0;
}
.slh-picker-preview svg {
    width: 21px;
    height: 21px;
}
.slh-picker-drawer {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #e2e8f0;
}
.slh-picker-step {
    margin-bottom: 14px;
}
.slh-picker-step:last-child {
    margin-bottom: 0;
}
.slh-picker-step-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.slh-step-badge {
    background: #4f46e5;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
}
.slh-input-sm {
    padding: 6px 10px !important;
    font-size: 13px !important;
    max-width: 220px;
    margin-left: auto;
}
.slh-icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 6px;
    max-height: 185px;
    overflow-y: auto;
    padding: 4px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
}
.slh-icon-choice {
    width: 40px;
    height: 40px;
    border: 1px solid transparent;
    background: #ffffff;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #334155;
    transition: all 0.12s;
}
.slh-icon-choice:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
}
.slh-icon-choice.selected {
    border-color: currentColor;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}
.slh-icon-choice svg {
    width: 18px;
    height: 18px;
}
.slh-color-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.slh-color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1px #cbd5e1;
    cursor: pointer;
    transition: transform 0.12s, box-shadow 0.12s;
    padding: 0;
}
.slh-color-swatch:hover {
    transform: scale(1.12);
}
.slh-color-swatch.selected {
    transform: scale(1.15);
    box-shadow: 0 0 0 2px #0f172a;
}
.slh-custom-color-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 999px;
    cursor: pointer;
    border: 1px solid #cbd5e1;
}
.slh-custom-color-label input[type="color"] {
    width: 18px;
    height: 18px;
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
}

/* Vector Icon Badges in Tables */
.slh-link-cell-flex {
    display: flex;
    align-items: center;
    gap: 12px;
}
.slh-row-icon-box {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.slh-row-icon-box svg {
    width: 18px;
    height: 18px;
}
.slh-type-badge svg, .slh-icon-btn svg {
    width: 15px;
    height: 15px;
    vertical-align: middle;
}
