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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* Container */
.container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* Auth Card */
.auth-card {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.auth-card h1 {
    text-align: center;
    color: #667eea;
    font-size: 2rem;
    margin-bottom: 10px;
}

.auth-card h2 {
    text-align: center;
    color: #666;
    font-size: 1.2rem;
    font-weight: 400;
    margin-bottom: 30px;
}

/* Form */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #bbb;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-logout {
    background: transparent;
    color: #667eea;
    border: 1px solid #667eea;
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-logout:hover {
    background: #667eea;
    color: white;
}

.btn-settings {
    background: transparent;
    color: #666;
    border: 1px solid #ddd;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.btn-settings:hover {
    border-color: #667eea;
    color: #667eea;
}

/* Trial Banner */
.trial-banner {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 10px 20px;
    font-size: 0.9rem;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.alert-error {
    background: #fee;
    color: #c00;
    border: 1px solid #fcc;
}

.alert-success {
    background: #efe;
    color: #060;
    border: 1px solid #cfc;
}

/* Auth Link */
.auth-link {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.auth-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.auth-link a:hover {
    text-decoration: underline;
}

/* Navbar */
.navbar {
    background: white;
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-brand a {
    color: #667eea;
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-user span {
    color: #555;
    font-weight: 500;
}

/* Dashboard */
.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.dashboard-header {
    margin-bottom: 40px;
}

.dashboard-header h1 {
    color: white;
    font-size: 2rem;
    margin-bottom: 10px;
}

.btn-page-link {
    display: inline-block;
    margin-top: 16px;
    padding: 16px 32px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.btn-page-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.btn-page-link span {
    font-weight: 700;
}

/* Cards */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.card h3 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 24px;
    font-size: 1.1rem;
}

.card-content {
    padding: 24px;
}

.card-content p {
    margin-bottom: 12px;
    color: #555;
}

.card-content p:last-child {
    margin-bottom: 0;
}

.card-content strong {
    color: #333;
}

.placeholder-text {
    color: #999;
    font-style: italic;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.card-wide {
    grid-column: 1;
}

.card-full {
    grid-column: 1 / -1;
}

/* Form Elements */
.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s;
}

.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.btn-save {
    width: auto;
    padding: 12px 32px;
}

/* Stats */
.stats-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
}

.stat-label {
    color: #888;
}

/* Links Management */
.card h3 {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.link-counter {
    font-size: 0.9rem;
    font-weight: 400;
    opacity: 0.8;
}

.add-link-form {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #eee;
}

.add-link-form .form-row {
    margin-bottom: 0;
}

.add-link-form input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 1rem;
}

.add-link-form input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-add {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    white-space: nowrap;
    padding: 12px 24px;
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.limit-warning {
    background: #fff3cd;
    color: #856404;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
}

.limit-warning a {
    color: #667eea;
    font-weight: 600;
}

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

.link-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 12px;
    transition: all 0.2s;
}

.link-item:hover {
    background: #f0f1f3;
}

.link-drag-handle {
    color: #ccc;
    cursor: grab;
    font-size: 1.2rem;
    user-select: none;
}

.link-drag-handle:active {
    cursor: grabbing;
}

.link-item.dragging {
    opacity: 0.4;
    border: 2px dashed #667eea;
}

.link-item.drag-over {
    border-top: 3px solid #667eea;
}

/* Up/Down buttons: hidden on desktop, shown on mobile */
.btn-reorder {
    display: none;
    padding: 4px 8px;
    font-size: 0.8rem;
    min-width: 28px;
}

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

.link-title {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.link-url {
    display: block;
    font-size: 0.85rem;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-stats {
    text-align: center;
}

.click-count {
    font-size: 0.85rem;
    color: #667eea;
    font-weight: 500;
}

.link-actions {
    display: flex;
    gap: 8px;
}

.btn-edit, .btn-delete {
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 6px;
}

.btn-edit {
    background: #e9ecef;
    color: #495057;
}

.btn-edit:hover {
    background: #dee2e6;
}

.btn-delete {
    background: #fee;
    color: #c00;
}

.btn-delete:hover {
    background: #fcc;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #888;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 32px;
    border-radius: 16px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-content h3 {
    margin-bottom: 24px;
    color: #333;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.modal-actions .btn {
    flex: 1;
}

.btn-cancel {
    background: #e9ecef;
    color: #495057;
}

.btn-cancel:hover {
    background: #dee2e6;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    font-weight: 500;
    z-index: 2000;
    animation: slideIn 0.3s ease;
}

.notification-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.notification-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Avatar Card */
.avatar-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.avatar-circle-wrap {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.avatar-placeholder {
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    line-height: 1;
    user-select: none;
}

/* PRO state: actions column */
.avatar-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-upload {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-upload:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.4);
}

.avatar-remove-btn {
    padding: 6px 14px;
    font-size: 0.8rem;
}

/* FREE state: upgrade hint */
.avatar-upgrade-hint {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.avatar-pro-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3px 10px;
    border-radius: 9999px;
    width: fit-content;
}

.avatar-hint-text {
    font-size: 0.8rem;
    color: #888;
    line-height: 1.4;
}

/* Custom Icons */
.custom-icons-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.icons-help-text {
    font-size: 0.8rem;
    color: #aaa;
}

.custom-icons-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.custom-icons-empty {
    color: #aaa;
    font-size: 0.9rem;
}

.custom-icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 60px;
}

.custom-icon-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 4px;
    background: #fafafa;
}

.custom-icon-del {
    font-size: 0.7rem;
    color: #c00;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.custom-icon-del:hover {
    text-decoration: underline;
}

.custom-icons-free-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 0.8rem;
    color: #888;
}

.icon-preview-img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    vertical-align: middle;
}

/* ── Dashboard: PRO badge ───────────────────────────────────────────────── */
.pro-badge {
    font-size: 0.65rem;
    background: #7c3aed;
    color: #fff;
    padding: 2px 7px;
    border-radius: 10px;
    vertical-align: middle;
    margin-left: 6px;
}

/* Gold PRO badge for theme select options */
.theme-pro-badge {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
    font-size: 0.6rem;
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 600;
    vertical-align: middle;
    margin-left: 4px;
}

/* ── Dashboard: Analytics tabs ──────────────────────────────────────────── */
.analytics-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.tab-btn {
    padding: 6px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    font-size: 0.9rem;
}

.tab-btn.tab-active {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

/* ── Dashboard: Analytics table ─────────────────────────────────────────── */
.analytics-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.analytics-table th,
.analytics-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.analytics-table th {
    font-weight: 600;
    color: #555;
    background: #f8f8f8;
}

.analytics-loading {
    color: #888;
    padding: 16px 0;
}

.analytics-empty {
    color: #aaa;
    padding: 16px 0;
    font-size: 0.9rem;
}

/* ── Dashboard: Analytics chart pagination ──────────────────────────────── */
.clicks-pagination {
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    gap: 8px;
}

.pag-btn {
    padding: 5px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    font-size: 0.85rem;
    color: #555;
}

.pag-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pag-btn:not(:disabled):hover {
    background: #f5f5f5;
}

.pag-info {
    font-size: 0.8rem;
    color: #888;
}

/* ── Dashboard: Analytics table scroll wrapper ──────────────────────────── */
.table-scroll-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── Dashboard: Icon picker ─────────────────────────────────────────────── */
.icon-select-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-picker {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
    background: #fff;
}

.icon-preview-fa {
    font-size: 1.1rem;
    color: #555;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

/* ── Dashboard: Theme PRO hint ──────────────────────────────────────────── */
.theme-pro-hint {
    display: none;
    color: #7c3aed;
    margin-top: 4px;
}

/* ── Inline form (logout) ───────────────────────────────────────────────── */
.form-inline {
    display: inline;
}

/* ── Dashboard: Navbar plan badge ───────────────────────────────────────── */
.nav-plan-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    vertical-align: middle;
    margin-left: 4px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.nav-plan-badge--free {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #e5e7eb;
}

.nav-plan-badge--pro {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.btn-upgrade-nav {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 20px;
    text-decoration: none;
    transition: opacity 0.15s;
}

.btn-upgrade-nav:hover {
    opacity: 0.85;
}

.upgrade-inline-link {
    font-size: 0.78rem;
    color: #667eea;
    font-weight: 600;
    text-decoration: none;
}

.upgrade-inline-link:hover {
    text-decoration: underline;
}

/* ── Dashboard: Stats card improvements ─────────────────────────────────── */
.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
    padding: 12px 8px;
    border-radius: 10px;
    background: #f8f9ff;
    border: 1px solid #e8ebff;
    text-align: center;
}

.stat-icon-wrap {
    font-size: 1.2rem;
    color: #667eea;
    margin-bottom: 4px;
}

.stat-item--accent {
    background: linear-gradient(135deg, #f0f3ff 0%, #e8edff 100%);
    border-color: #c7d0ff;
}

.stat-item--accent .stat-icon-wrap {
    color: #5b6ee8;
}

.stat-value {
    font-size: 1.9rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1;
}

.stat-value--plan {
    font-size: 1rem;
    letter-spacing: 0.05em;
}

.sub-expiry {
    font-size: 0.7rem;
    color: #6b7280;
    margin-top: 2px;
}

.sub-expiry--warn {
    color: #f59e0b;
    font-weight: 600;
}

/* ── Dashboard: Locked card (PRO feature teaser) ─────────────────────────── */
.locked-card {
    border: 2px dashed #e5e7eb;
    background: #fafafa;
}

.locked-card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    text-align: center;
    gap: 12px;
}

.locked-icon {
    width: 56px;
    height: 56px;
    background: #f3f4f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #9ca3af;
}

.locked-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.locked-desc {
    color: #6b7280;
    font-size: 0.9rem;
    margin: 0;
    max-width: 260px;
}

.locked-cta {
    margin-top: 4px;
}

/* ── Dashboard: Upgrade banner ───────────────────────────────────────────── */
.upgrade-banner {
    background: linear-gradient(135deg, #f0f3ff 0%, #ede8ff 100%);
    border: 1px solid #c7d0ff;
    border-radius: 12px;
    padding: 16px 20px;
}

.upgrade-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.upgrade-banner-text {
    color: #4b5563;
    font-size: 0.9rem;
}

.upgrade-banner-text strong {
    color: #5b21b6;
}

.upgrade-banner-btn {
    background: transparent;
    border: 2px solid #667eea;
    color: #667eea;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
    display: inline-block;
}

.upgrade-banner-btn:hover {
    background: #667eea;
    color: #fff;
}

/* ── Dashboard: Empty state ──────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 36px 20px;
    color: #9ca3af;
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.4;
}

.empty-state-title {
    font-size: 1rem;
    font-weight: 600;
    color: #6b7280;
    margin: 0 0 4px;
}

.empty-state-hint {
    font-size: 0.875rem;
    margin: 0;
}

/* ── PRO styles ─────────────────────────────────────────────────────────── */
.card-pro {
    position: relative;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.12);
}

.card-pro::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 12px 12px 0 0;
    pointer-events: none;
}

/* ── Analytics: header with period filter ───────────────────────────────── */
.analytics-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.analytics-header .analytics-tabs {
    margin-bottom: 0;
}

.analytics-period-filter {
    display: flex;
    gap: 4px;
}

.period-btn {
    padding: 4px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    color: #666;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.period-btn--active,
.period-btn:hover {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

/* ── Analytics: bar chart ────────────────────────────────────────────────── */
.analytics-bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 120px;
    padding: 8px 0 4px;
    overflow-x: auto;
}

.bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 20px;
    max-width: 48px;
    height: 100%;
}

.bar-wrap {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: flex-end;
}

.bar-fill {
    width: 100%;
    min-height: 4px;
    background: linear-gradient(180deg, #667eea, #764ba2);
    border-radius: 3px 3px 0 0;
    transition: opacity 0.15s;
    cursor: pointer;
}

.bar-fill:hover {
    opacity: 0.75;
}

.bar-label {
    font-size: 0.65rem;
    color: #aaa;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-align: center;
}

/* ── Analytics: summary row ──────────────────────────────────────────────── */
.analytics-summary {
    display: flex;
    gap: 16px;
    padding: 12px 0;
    border-top: 1px solid #f0f0f0;
    margin-top: 8px;
    flex-wrap: wrap;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 80px;
}

.summary-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1;
}

.summary-label {
    font-size: 0.75rem;
    color: #888;
}

/* ── Analytics: referer progress bars ───────────────────────────────────── */
.referer-progress-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.referer-progress-bar {
    height: 6px;
    min-width: 4px;
    max-width: 120px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 3px;
    flex-shrink: 0;
}

.referer-progress-pct {
    font-size: 0.8rem;
    color: #666;
    white-space: nowrap;
}

/* ── Avatar: PRO compact section ─────────────────────────────────────────── */
.avatar-section-pro {
    display: flex;
    align-items: center;
    gap: 16px;
}

.avatar-circle-wrap--sm .avatar-img,
.avatar-circle-wrap--sm .avatar-placeholder {
    width: 80px;
    height: 80px;
}

.avatar-placeholder--sm {
    width: 80px;
    height: 80px;
    font-size: 1.8rem;
}

/* ── Verification Page ────────────────────────────────────────────────── */
.verification-card {
    max-width: 460px;
    text-align: center;
}

.verification-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
    animation: verificationFloat 3s ease-in-out infinite;
}

.ver-icon-static {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.ver-open-mail {
    display: none;
    width: 100%;
    margin-bottom: 12px;
}

@keyframes verificationFloat {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-8px); }
}

.verification-desc {
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
}

.verification-email-highlight {
    color: #667eea;
    word-break: break-all;
    font-weight: 600;
}

.verification-help {
    background: #f8f9ff;
    border: 1px solid #e4e8ff;
    border-radius: 10px;
    padding: 16px 20px;
    margin-top: 20px;
    text-align: left;
}

.verification-help-title {
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.verification-help ul {
    padding-left: 18px;
    color: #666;
    font-size: 0.875rem;
    line-height: 1.8;
    margin: 0;
}

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

    .card-wide {
        grid-column: 1 / -1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .card-wide, .card-full {
        grid-column: 1;
    }

    .form-row {
        flex-direction: column;
    }

    .add-link-form .form-row {
        flex-direction: column;
    }

    .link-item {
        flex-wrap: wrap;
    }

    .link-drag-handle {
        display: none;
    }

    .btn-reorder {
        display: inline-flex;
    }

    .link-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 8px;
    }

    .upgrade-banner-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-content {
        gap: 8px;
    }

    .analytics-tabs {
        flex-wrap: wrap;
    }

    .tab-btn {
        flex: 1 1 auto;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 30px 20px;
    }

    .verification-card {
        padding: 24px 20px;
    }

    .navbar {
        padding: 12px 16px;
    }

    .dashboard-header h1 {
        font-size: 1.5rem;
    }

    .analytics-table th,
    .analytics-table td {
        font-size: 0.8rem;
        padding: 6px 8px;
    }

    .analytics-table {
        min-width: 280px;
    }
}

/* ─── Language Switcher Dropdown ─────────────────────────── */
.lang-dropdown {
    position: relative;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
    line-height: 1.4;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.lang-btn:hover {
    color: #667eea;
    border-color: rgba(102, 126, 234, 0.4);
    background: #fff;
}

.lang-arrow {
    font-size: 0.6rem;
    transition: transform 0.2s;
}

.lang-dropdown.open .lang-arrow {
    transform: rotate(180deg);
}

.lang-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    min-width: 60px;
    overflow: hidden;
    z-index: 200;
}

.lang-dropdown.open .lang-menu {
    display: block;
}

.lang-menu a {
    display: block;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    transition: background 0.15s;
}

.lang-menu a:hover {
    background: #f3f4f6;
    color: #667eea;
}

/* Corner variant for auth pages */
.lang-dropdown--corner {
    position: fixed;
    top: 16px;
    right: 20px;
    z-index: 100;
}

/* .lang-btn--corner inherits all styles from .lang-btn */

/* ─── Cookie Banner ──────────────────────────────────────── */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #1a1a2e;
    color: #e8e8f0;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-size: 0.88rem;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.2);
}

.cookie-banner p {
    margin: 0;
    line-height: 1.5;
}

.cookie-banner a {
    color: #a8b4ff;
    text-decoration: underline;
}

.cookie-banner a:hover {
    color: #ffffff;
}

.cookie-banner__actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.cookie-banner__btn-accept {
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 18px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.cookie-banner__btn-accept:hover {
    background: #5a6fd6;
}

@media (max-width: 640px) {
    .cookie-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* ── Analytics Stats Widget ─────────────────────────────────────────────── */
.stats-widget .stats-widget-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stats-widget .stats-widget-row {
    display: flex;
    gap: 16px;
}

.stats-widget-actions {
    display: flex;
    gap: 12px;
}

.stats-widget-link {
    display: inline-block;
    font-size: 0.9rem;
}
