:root {
    --bg: #f4f7f6;
    --surface: #ffffff;
    --text: #1e293b;
    --muted: #64748b;
    --border: #e2e8f0;
    --accent: #0f172a;
    --radius: 8px;
    --shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Halaman Publik BioLink */
.bio-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 28px 20px 48px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 7px 12px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
}

.btn-icon:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}

.profile-header {
    text-align: center;
    margin-bottom: 28px;
}

.avatar-img, .avatar-fallback {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    margin: 0 auto 14px;
    object-fit: cover;
    border: 3px solid var(--surface);
    box-shadow: var(--shadow);
}

.avatar-fallback {
    background-color: var(--accent);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 700;
}

.profile-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.profile-username {
    font-size: 13px;
    color: var(--muted);
    margin-top: 2px;
}

.profile-bio {
    font-size: 14px;
    color: var(--text);
    margin-top: 10px;
    max-width: 380px;
    margin-left: auto;
    margin-right: auto;
}

.links-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.link-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 14px 18px;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    font-size: 15px;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
}

.link-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.link-icon {
    width: 22px;
    height: 22px;
    color: var(--accent);
    display: flex;
    align-items: center;
}

.link-icon svg {
    width: 20px;
    height: 20px;
}

.link-title {
    flex: 1;
    text-align: center;
    padding: 0 12px;
}

.link-arrow {
    color: var(--muted);
    display: flex;
    align-items: center;
    transition: transform 0.2s ease;
}

.link-card:hover .link-arrow {
    color: var(--accent);
    transform: translate(2px, -2px);
}

.empty-state {
    text-align: center;
    color: var(--muted);
    padding: 28px;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    font-size: 14px;
}

.bio-footer {
    text-align: center;
    margin-top: 36px;
    font-size: 12px;
    color: var(--muted);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--accent);
    color: #ffffff;
    padding: 10px 18px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Auth & Admin Layout */
.auth-container {
    max-width: 400px;
    margin: 70px auto;
    padding: 0 20px;
}

.admin-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 20px 60px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.admin-header h1 {
    font-size: 22px;
    font-weight: 700;
}

.admin-nav {
    display: flex;
    gap: 10px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
}

.card-title {
    font-size: 20px;
    margin-bottom: 4px;
}

.card-subtitle, .text-muted {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 18px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    box-shadow: var(--shadow);
}

.stat-label {
    display: block;
    font-size: 13px;
    color: var(--muted);
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.mt-20 { margin-top: 20px; }

/* Form & Buttons */
.form-group {
    margin-bottom: 14px;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

.form-row .form-color {
    flex: 0 0 110px;
}

label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
}

input[type="text"],
input[type="password"],
input[type="url"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    background: #ffffff;
    transition: border-color 0.2s ease;
}

input[type="color"] {
    width: 100%;
    height: 39px;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #ffffff;
    cursor: pointer;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.btn-block { width: 100%; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

.btn-primary {
    background: var(--accent);
    color: #ffffff;
}
.btn-primary:hover { opacity: 0.92; }

.btn-outline {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}
.btn-outline:hover { border-color: var(--accent); }

.btn-danger-outline {
    background: var(--surface);
    border-color: #fecaca;
    color: #dc2626;
}
.btn-danger-outline:hover { background: #fef2f2; }

/* Alerts & Table */
.alert {
    padding: 11px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 18px;
}
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

.table-responsive { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th, .data-table td {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--muted);
    letter-spacing: 0.03em;
}

.table-link-info {
    display: flex;
    flex-direction: column;
}

.table-link-info small {
    color: var(--muted);
    font-size: 12px;
    max-width: 260px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge {
    background: var(--bg);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.status-pill {
    border: none;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.status-pill.active { background: #dcfce7; color: #166534; }
.status-pill.inactive { background: #f1f5f9; color: #475569; }

.inline-form { display: inline; }
.action-cell { white-space: nowrap; }

.auth-footer { margin-top: 16px; text-align: center; }
.auth-footer a { font-size: 13px; color: var(--muted); text-decoration: none; }

/* Modal */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 50;
}

.modal-card {
    background: var(--surface);
    border-radius: var(--radius);
    width: 100%;
    max-width: 440px;
    padding: 22px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

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

.close-btn {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--muted);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}
