/**
 * HR360 Creative Design System
 * Distinctive, polished, and engaging styles
 */

/* ========== Creative Variables ========== */
:root {
    --accent: #0ea5e9;
    --accent-dark: #0284c7;
    --accent-glow: rgba(14, 165, 233, 0.25);
    --gradient-primary: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
    --gradient-warm: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-hero: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
    --pattern-dots: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.08) 1px, transparent 0);
    --pattern-size: 24px;
    --glass: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.12);
    --animate-in: 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    --animate-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ========== Staggered Animations ========== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

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

@keyframes pulse-soft {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes ring-progress {
    from { stroke-dashoffset: 283; }
}

/* Stagger children */
.stagger-children > * {
    animation: fadeInUp var(--animate-in) both;
}
.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.3s; }

/* ========== Creative Login ========== */
body.login-page {
    background: var(--gradient-hero);
    background-size: 400% 400%;
    animation: gradient-shift 15s ease infinite;
    position: relative;
    overflow: hidden;
}

body.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--pattern-dots);
    background-size: var(--pattern-size) var(--pattern-size);
    opacity: 0.6;
    pointer-events: none;
}

/* ========== Feedback Assignments (Admin) ========== */
.fa-page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}
.fa-alert-flow {
    margin-bottom: 1.5rem;
}
.fa-collapsible-card {
    margin-bottom: 2rem;
}
.fa-help-text {
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.fa-giver-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}
.fa-giver-toolbar-left {
    min-width: 260px;
    flex: 1 1 420px;
}
.fa-giver-toolbar-right {
    flex: 0 0 auto;
    min-width: 220px;
}
.fa-giver-toolbar-right .fa-deadline-wrap input[type="date"] {
    max-width: 220px;
}
.fa-inline-label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 800;
}
.fa-form-actions {
    align-self: flex-end;
}
.fa-search-input {
    width: 100%;
    max-width: 360px;
    margin: 0.35rem 0 0.5rem;
    padding: 0.55rem 0.8rem;
    border: 1px solid rgba(0,0,0,0.10);
    border-radius: 14px;
    background: rgba(255,255,255,0.92);
    box-shadow: 0 12px 30px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.fa-search-input:focus {
    outline: none;
    border-color: rgba(14, 165, 233, 0.45);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.16);
}
.fa-giver-section {
    margin: 0;
    padding: 0.95rem;
    border: 1px solid rgba(0,0,0,0.10);
    border-radius: 18px;
    background: rgba(255,255,255,0.92);
    box-shadow: 0 16px 36px rgba(0,0,0,0.08);
}
.fa-giver-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}
@media (max-width: 900px) {
    .fa-giver-grid { grid-template-columns: 1fr; }
}
.fa-giver-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}
.fa-giver-hint {
    margin-top: 0.2rem;
    font-size: 0.78rem;
    color: rgba(15, 23, 42, 0.68);
    font-weight: 600;
}
.fa-deadline-wrap {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.fa-date-hint {
    font-size: 0.8rem;
    color: rgba(15, 23, 42, 0.62);
    font-weight: 600;
}
.fa-required-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: auto;
    color: rgba(15, 23, 42, 0.92);
    font-weight: 800;
}
.fa-required-inline input[type="checkbox"] {
    transform: translateY(1px);
}
.fa-giver-list {
    max-height: 240px;
    overflow: auto;
    border: 1px solid rgba(0,0,0,0.10);
    border-radius: 16px;
    padding: 0.65rem;
    background: rgba(255,255,255,0.92);
    box-shadow: 0 18px 40px rgba(0,0,0,0.08);
}
.fa-giver-item {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    padding: 0.35rem 0.4rem;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.2;
    cursor: pointer;
}
.fa-giver-item input[type="checkbox"] {
    margin-top: 0.15rem;
}
.fa-giver-item:hover {
    background: rgba(14, 165, 233, 0.10);
}

/* ========== Give Feedback (Employee) ========== */
.gf-flow-card {
    margin-bottom: 1.5rem;
    border: 1px solid rgba(14, 165, 233, 0.22);
    background: linear-gradient(135deg, rgba(14,165,233,0.10) 0%, rgba(99,102,241,0.08) 40%, rgba(255,255,255,0.75) 100%);
    box-shadow: 0 18px 45px rgba(0,0,0,0.08);
}
.gf-flow-body {
    padding: 1.05rem 1.25rem;
}
.gf-flow-title {
    margin: 0 0 0.75rem 0;
    font-size: 0.95rem;
    font-weight: 800;
    color: #1e3a8a;
}
.gf-flow-steps {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: rgba(15, 23, 42, 0.75);
}
.gf-flow-step {
    background: rgba(255,255,255,0.85);
    border: 1px solid rgba(0,0,0,0.08);
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.05);
}
.gf-flow-step-active {
    background: rgba(14, 165, 233, 0.14);
    border-color: rgba(14, 165, 233, 0.30);
    color: #0f172a;
    font-weight: 800;
}
.gf-assigned-section {
    margin-bottom: 2rem;
}
.gf-row-overdue td {
    background: rgba(239, 68, 68, 0.06);
}
.gf-alert-tip {
    margin-bottom: 1.5rem;
}
.gf-form-title {
    margin: 0 0 1rem;
}
.gf-type-pill {
    margin: 0.35rem 0 0;
    padding: 0.65rem 0.8rem;
    background: rgba(255,255,255,0.85);
    border: 1px solid rgba(0,0,0,0.10);
    border-radius: 14px;
    color: rgba(15, 23, 42, 0.88);
    box-shadow: 0 12px 30px rgba(0,0,0,0.06);
}
.gf-rating-title {
    margin: 0 0 0.25rem;
}
.gf-rating-subtitle {
    margin: 0 0 1rem 0;
}
.gf-bullets {
    margin: 0.35rem 0 0.5rem 1.25rem;
    padding: 0;
    color: rgba(15, 23, 42, 0.72);
    font-size: 0.9rem;
}
.gf-footnote {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: rgba(15, 23, 42, 0.65);
}
.gf-my-feedback-section {
    margin-top: 1.5rem;
}

.login-container {
    position: relative;
    z-index: 1;
}

.login-box {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.1);
    animation: scaleIn 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.login-logo-wrap {
    width: 160px;
    height: auto;
    max-height: 80px;
    margin: 0 auto 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-logo-wrap .login-logo-img {
    width: 100%;
    height: auto;
    max-height: 80px;
    object-fit: contain;
    display: block;
}

.login-box h1 {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.875rem;
    letter-spacing: -0.03em;
}

.login-box .btn-primary {
    background: var(--gradient-primary);
    border: none;
    box-shadow: 0 4px 14px 0 rgba(14, 165, 233, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}
.login-box .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px -5px rgba(14, 165, 233, 0.45);
}

/* ========== Creative Stat Cards ========== */
.stat-card-creative {
    position: relative;
    overflow: hidden;
    border: none;
    background: var(--surface);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    transition: transform var(--animate-in), box-shadow 0.3s;
}
.stat-card-creative::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s;
}
.stat-card-creative:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}
.stat-card-creative:hover::before {
    opacity: 1;
}
.stat-card-creative .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    background: var(--primary-light);
    color: var(--primary);
}
.stat-card-creative .stat-number {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========== Progress Ring ========== */
.progress-ring-wrap {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 1rem;
}
.progress-ring-wrap svg {
    transform: rotate(-90deg);
}
.progress-ring-bg {
    fill: none;
    stroke: var(--border);
    stroke-width: 8;
}
.progress-ring-fill {
    fill: none;
    stroke: url(#progressGradient);
    stroke: var(--primary);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.progress-ring-value {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

/* ========== Welcome Card ========== */
.welcome-card {
    background: var(--gradient-primary);
    color: #fff;
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 40px -15px rgba(14, 165, 233, 0.4);
}
.welcome-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    pointer-events: none;
}
.welcome-card h1 {
    color: #fff;
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
    position: relative;
}
.welcome-card p {
    color: rgba(255,255,255,0.9);
    font-size: 1rem;
    position: relative;
}
.welcome-card .welcome-avatar {
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    width: 80px;
    height: 80px;
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    border: 2px solid rgba(255,255,255,0.3);
}

/* ========== Creative Empty State ========== */
.empty-state-creative {
    padding: 4rem 2rem;
    text-align: center;
}
.empty-state-creative .empty-illustration {
    width: 160px;
    height: 160px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--primary-light) 0%, rgba(99, 102, 241, 0.15) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    animation: pulse-soft 3s ease-in-out infinite;
}
.empty-state-creative h3 {
    font-size: 1.25rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}
.empty-state-creative p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}
.empty-state-creative .btn {
    box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.3);
}

/* ========== Quick Actions ========== */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.25rem 1rem;
    background: var(--surface);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    border: 1px solid var(--border);
    transition: all 0.25s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.quick-action:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -10px rgba(37, 99, 235, 0.25);
}
.quick-action-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}
.quick-action span {
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
}

/* ========== Section Headers ========== */
.section-header-creative {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.section-header-creative h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}
.section-header-creative h2::before {
    content: '';
    width: 4px;
    height: 24px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

/* ========== Table Polish ========== */
.data-table tbody tr {
    transition: background 0.2s;
}
.data-table tbody tr:hover {
    background: rgba(14, 165, 233, 0.04);
}

/* ========== Button Creative ========== */
.btn-primary {
    background: var(--gradient-primary);
    border: none;
    box-shadow: 0 4px 14px 0 rgba(14, 165, 233, 0.35);
}
.btn-primary:hover {
    box-shadow: 0 8px 25px -5px rgba(14, 165, 233, 0.4);
}

/* ========== Logo 360 accent ========== */
.logo-icon {
    background: var(--gradient-primary);
    box-shadow: 0 4px 12px -2px rgba(14, 165, 233, 0.4);
}

/* ========== Footer Creative ========== */
.main-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 1.25rem 1.5rem;
}
.main-footer .footer-content p:first-child {
    font-size: 0.9375rem;
    color: var(--text);
}
.main-footer .text-muted {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ========== Page Headers ========== */
.page-header h1 {
    font-weight: 800;
    letter-spacing: -0.03em;
}
.page-header p {
    color: var(--text-muted);
}

/* ========== Form Container Polish ========== */
.form-container {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* ========== Notification Bell ========== */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.notification-bell-wrap {
    position: relative;
}

.notification-bell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.notification-bell:hover {
    background: var(--bg);
    color: var(--primary);
}

.notification-bell .notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    color: #fff;
    background: var(--gradient-warm);
    border-radius: 9px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.notification-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    max-width: calc(100vw - 2rem);
    max-height: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    display: none;
    flex-direction: column;
    z-index: 200;
    overflow: hidden;
}

.notification-dropdown.is-open {
    display: flex;
}

.notification-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.9375rem;
}

.notification-mark-all {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--primary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.notification-mark-all:hover {
    text-decoration: underline;
}

.notification-list {
    flex: 1;
    overflow-y: auto;
    min-height: 120px;
}

.notification-item {
    display: block;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
    text-align: left;
}

.notification-item:hover {
    background: var(--bg);
}

.notification-item.is-read {
    opacity: 0.75;
}

.notification-item-title {
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.notification-item-message {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    line-height: 1.35;
}

.notification-item-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.notification-dropdown-footer {
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

.notification-dropdown-footer a {
    font-size: 0.8125rem;
    color: var(--primary);
    text-decoration: none;
}

.notification-dropdown-footer a:hover {
    text-decoration: underline;
}

.notification-loading,
.notification-empty {
    padding: 1.5rem 1rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ========== Feed (LinkedIn-style) ========== */
.feed-page {
    max-width: 680px;
    margin: 0 auto;
}

.feed-composer.card {
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.feed-composer-header {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.feed-composer-avatar,
.feed-card-avatar {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
}

.feed-composer-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.feed-composer-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.9375rem;
    resize: vertical;
    min-height: 72px;
}

.feed-composer-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.feed-composer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.feed-attach-label {
    cursor: pointer;
    margin: 0;
}

.feed-attach-input {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

.feed-attach-btn {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: background 0.15s, color 0.15s;
}

.feed-attach-btn:hover {
    background: var(--bg);
    color: var(--primary);
}

.feed-composer-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 0;
}

.feed-attach-preview-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.feed-attach-preview-item img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

.feed-post-btn {
    flex-shrink: 0;
}

.feed-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feed-card.card {
    padding: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}
.feed-card.card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.feed-card-header {
    padding: 1rem 1.25rem 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.feed-card-owner-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.feed-owner-btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.8125rem;
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
}
.feed-owner-btn:hover {
    background: var(--bg);
    color: var(--primary);
}
.feed-delete-btn:hover { color: var(--error); }

.feed-delete-form { display: inline; margin: 0; }

.feed-edit-form-wrap {
    padding: 0 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
}

.feed-edit-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.9375rem;
    resize: vertical;
    margin-bottom: 0.5rem;
}

.feed-edit-form-actions {
    display: flex;
    gap: 0.5rem;
}

.feed-card-author {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.feed-card-avatar {
    width: 48px;
    height: 48px;
    min-width: 48px;
}

.feed-card-name {
    display: block;
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text);
}

.feed-card-meta {
    font-size: 0.8125rem;
    color: var(--text-muted);
}
.feed-time-ago { font-variant-numeric: tabular-nums; }
.feed-copy-link-btn {
    padding: 0; margin: 0; border: none; background: none; font-size: inherit;
    color: var(--primary); cursor: pointer; font-family: inherit;
}
.feed-copy-link-btn:hover { text-decoration: underline; }
.feed-liked-by {
    padding: 0.25rem 1.25rem 0.125rem; font-size: 0.8125rem; color: var(--text-muted);
    display: flex; align-items: center; gap: 0.35rem;
    border-top: 1px solid var(--border);
}
.feed-liked-icon { font-size: 0.875rem; }

.feed-card-body {
    padding: 0.75rem 1.25rem 1rem;
}

.feed-card-content,
.feed-original-content {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.feed-share-intro {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0 0 0.5rem;
}

.feed-share-comment {
    margin: 0 0 0.75rem;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.feed-original-post {
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius);
    border-left: 3px solid var(--primary);
}

.feed-original-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.25rem;
}

.feed-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.feed-attach {
    display: block;
}

.feed-attach-image {
    max-width: 100%;
}

.feed-attach-image img {
    max-width: 100%;
    max-height: 400px;
    width: auto;
    height: auto;
    border-radius: var(--radius);
    object-fit: contain;
    display: block;
}

/* Stickers: smaller + smoother (WhatsApp-like) */
.feed-attach-sticker img.feed-sticker-img {
    max-height: 180px;
    border-radius: 22px;
    background: transparent;
    filter: drop-shadow(0 10px 18px rgba(0,0,0,0.12));
}

.feed-comment-attachments .feed-attach-sticker img.feed-sticker-img {
    max-height: 140px;
}

.feed-attach-video {
    max-width: 100%;
    min-height: 120px;
    border-radius: var(--radius);
    background: #000;
    overflow: hidden;
}
.feed-attach-video video {
    display: block;
    max-width: 100%;
    max-height: 400px;
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    background: #000;
    object-fit: contain;
    vertical-align: middle;
}

.feed-attach-doc {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--primary);
    text-decoration: none;
}

.feed-attach-doc:hover {
    background: var(--primary-light);
}

.feed-attach-pdf {
    display: block;
    width: 100%;
    max-width: 100%;
    margin-top: 0.5rem;
}

.feed-pdf-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.feed-pdf-zoom-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    cursor: default;
}

.feed-pdf-toolbar .feed-pdf-zoom-level {
    font-size: 0.875rem;
    color: var(--text-muted);
    min-width: 2.5rem;
}

.feed-pdf-toolbar .feed-pdf-zoom {
    width: 120px;
    height: 0.5rem;
    accent-color: var(--primary);
    cursor: pointer;
}

.feed-pdf-wrap {
    width: 100%;
    height: 75vh;
    max-height: calc(100vh - 200px);
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #e8e8e8;
}

.feed-pdf-zoom-wrap {
    transform-origin: 0 0;
    width: 100%;
    height: 75vh;
    max-height: calc(100vh - 200px);
    transition: transform 0.2s ease-out;
}

.feed-pdf-zoom-wrap .feed-pdf-viewer {
    display: block;
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
}

.feed-pdf-toolbar .feed-attach-doc-link {
    margin-top: 0;
    margin-left: auto;
}

.feed-attach-doc-link {
    display: inline-block;
    font-size: 0.875rem;
    color: var(--primary);
    text-decoration: none;
}

.feed-attach-doc-link:hover {
    text-decoration: underline;
}

.feed-card-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 1rem 0.5rem;
    border-top: 1px solid var(--border);
}

.feed-action {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.75rem;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.feed-action:hover {
    background: var(--bg);
    color: var(--primary);
}

.feed-action.active,
.feed-action-like.active {
    color: var(--primary);
}

.feed-action-count {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.feed-action-share-wrap {
    position: relative;
}

.feed-share-form-wrap {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 0.5rem;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 10;
    min-width: 280px;
}

.feed-share-form textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    resize: vertical;
    min-height: 60px;
}

.feed-card-comments {
    padding: 0 1.25rem 1rem;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.feed-card-comments:not(.is-open) .feed-comment {
    display: none;
}

.feed-comment {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

.feed-comment:last-of-type {
    border-bottom: none;
}

.feed-comment strong {
    margin-right: 0.5rem;
}

.feed-comment-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.feed-comment p {
    margin: 0.25rem 0 0;
    line-height: 1.4;
}

.feed-comment-form {
    padding-top: 0.75rem;
}

.feed-comment-input-wrap {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.feed-media-toolbar {
    display: flex;
    gap: 0.35rem;
    margin-top: 0.35rem;
    flex-wrap: wrap;
}

.feed-media-btn {
    border: 1px solid var(--border);
    background: var(--card-bg, #fff);
    border-radius: 10px;
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
    cursor: pointer;
}
.feed-media-btn:hover {
    border-color: var(--primary);
}

.feed-media-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
}
.feed-media-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
}
.feed-media-panel {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(720px, calc(100vw - 24px));
    max-height: min(560px, calc(100vh - 24px));
    background: var(--card-bg, #fff);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.feed-media-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid var(--border);
}
.feed-media-tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.feed-media-tab {
    border: 1px solid var(--border);
    background: transparent;
    border-radius: 10px;
    padding: 0.35rem 0.6rem;
    cursor: pointer;
    font-size: 0.85rem;
}
.feed-media-tab.active {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(14, 165, 233, 0.08);
}
.feed-media-close {
    border: none;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted);
}
.feed-media-body { padding: 0.85rem; overflow: auto; }
.feed-media-grid {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 0.35rem;
}
@media (max-width: 600px) {
    .feed-media-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}
.feed-media-item {
    border: 1px solid var(--border);
    background: transparent;
    border-radius: 10px;
    padding: 0.35rem 0;
    cursor: pointer;
    font-size: 1.1rem;
}

.feed-emoji-tabs {
    margin-bottom: 0.75rem;
}
.feed-media-item:hover { border-color: var(--primary); }
.feed-media-search { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; }
.feed-media-search-input {
    flex: 1;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 10px;
}
.feed-media-search-btn {
    border: 1px solid var(--border);
    background: var(--card-bg, #fff);
    border-radius: 10px;
    padding: 0.55rem 0.75rem;
    cursor: pointer;
}
.feed-media-results {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
}
@media (max-width: 700px) {
    .feed-media-results { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.feed-media-thumb {
    border: 1px solid var(--border);
    background: transparent;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    padding: 0;
}
.feed-media-thumb img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}
.feed-media-hint {
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.feed-sticker-tabs {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}
.feed-sticker-tab {
    border: 1px solid var(--border);
    background: transparent;
    border-radius: 999px;
    padding: 0.3rem 0.7rem;
    cursor: pointer;
    font-size: 0.85rem;
}
.feed-sticker-tab.active {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(14, 165, 233, 0.08);
}
.feed-sticker-thumb img {
    height: 88px;
    object-fit: contain;
    background: rgba(0,0,0,0.02);
    border-radius: 18px;
}

.feed-pending-media-wrap {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}
.feed-pending-media-chip {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.feed-comment-input-wrap input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.feed-comment-input-wrap input:focus {
    outline: none;
    border-color: var(--primary);
}

.feed-mention-wrapper {
    position: relative;
}

.feed-mention-dropdown {
    position: fixed;
    z-index: 9999;
    min-width: 220px;
    max-height: 280px;
    overflow-y: auto;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    list-style: none;
    margin: 0;
    padding: 0.25rem 0;
}

.feed-mention-dropdown[data-visible="1"] {
    display: block !important;
}

.feed-mention-dropdown .feed-mention-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.9375rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.feed-mention-dropdown .feed-mention-name,
.feed-mention-dropdown .feed-mention-dept,
.feed-mention-dropdown .feed-mention-meta {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.feed-mention-dropdown .feed-mention-name {
    font-weight: 600;
}

.feed-mention-dropdown .feed-mention-dept,
.feed-mention-dropdown .feed-mention-meta {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.feed-mention-dropdown .feed-mention-item:hover,
.feed-mention-dropdown .feed-mention-item.feed-mention-selected {
    background: rgba(14, 165, 233, 0.1);
    color: var(--primary);
}

.feed-mention-dropdown .feed-mention-item:empty {
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    cursor: default;
}

.feed-empty.card {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}

.feed-view-original {
    display: inline-block;
    font-size: 0.8125rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}
.feed-view-original:hover { text-decoration: underline; }

.feed-permalink {
    color: var(--text-muted);
    font-size: 0.8125rem;
}
.feed-permalink:hover { color: var(--primary); }

.mention {
    color: var(--primary);
    font-weight: 500;
}

.feed-comment-reply {
    margin-left: 1.5rem;
    padding-left: 0.75rem;
    border-left: 2px solid var(--border);
}

.feed-comment-reply-btn {
    margin-top: 0.25rem;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    color: var(--primary);
    background: none;
    border: none;
    cursor: pointer;
}
.feed-comment-reply-btn:hover { text-decoration: underline; }

.feed-comment-reply-to {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.feed-comment-attachments {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.feed-comment-attachments .feed-attach-image img { max-height: 200px; }
.feed-comment-attachments .feed-attach-video video { max-height: 200px; }
.feed-comment-attachments .feed-pdf-wrap { height: 280px; max-height: 280px; }
.feed-comment-attachments .feed-pdf-zoom-wrap { height: 250px; max-height: 250px; }

.feed-comment-attach-label {
    cursor: pointer;
    margin: 0;
    font-size: 1rem;
}
.feed-comment-attach-input { position: absolute; width: 0.1px; height: 0.1px; opacity: 0; z-index: -1; }

/* ========== Accessibility ========== */
@media (prefers-reduced-motion: reduce) {
    .stagger-children > *,
    .login-box,
    .login-logo-wrap,
    .stat-card-creative:hover,
    .quick-action:hover {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== Feed: YouTube previews ========== */
.feed-yt-preview {
    display: block;
    margin-top: 10px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.08);
    background: rgba(255,255,255,0.9);
}
.feed-yt-play {
    position: relative;
    width: 100%;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    display: block;
}
.feed-yt-thumb {
    width: 100%;
    height: auto;
    display: block;
}
.feed-yt-play-icon {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 44px;
    border-radius: 12px;
    background: rgba(0,0,0,0.65);
    color: #fff;
    font-size: 22px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.22);
}
.feed-yt-iframe-wrap {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: #000;
}
.feed-yt-iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ========== Feed: Link previews (generic) ========== */
.feed-link-preview {
    display: block;
    margin-top: 12px;
}
.feed-link-preview-card {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 14px;
    align-items: stretch;
    text-decoration: none;
    color: inherit;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.08);
    background: rgba(255,255,255,0.92);
    box-shadow: 0 10px 22px rgba(0,0,0,0.06);
    transition: transform var(--animate-in), box-shadow 0.25s, border-color 0.25s;
}
.feed-link-preview-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(0,0,0,0.10);
    border-color: rgba(14, 165, 233, 0.28);
}
.feed-link-preview-img {
    background: rgba(0,0,0,0.06);
    min-height: 104px;
}
.feed-link-preview-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.feed-link-preview-body {
    padding: 12px 14px 12px 0;
    min-width: 0;
}
.feed-link-preview-title {
    font-weight: 800;
    font-size: 0.95rem;
    line-height: 1.25;
    margin-bottom: 6px;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.feed-link-preview-desc {
    font-size: 0.86rem;
    color: var(--text-muted);
    line-height: 1.25;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.feed-link-preview-host {
    font-size: 0.78rem;
    color: rgba(0,0,0,0.55);
    font-weight: 700;
    letter-spacing: 0.02em;
    opacity: 0.9;
}
@media (max-width: 520px) {
    .feed-link-preview-card { grid-template-columns: 1fr; }
    .feed-link-preview-body { padding: 12px 14px; }
    .feed-link-preview-img { min-height: 0; }
}
