/* =========================
   FRONTEND BASE
========================= */

.fx-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.fx-section {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.fx-title {
    font-size: 24px;
    font-weight: 800;
    color: #111827;
    line-height: 1.25;
}

/* =========================
   STATIC PAGE CONTENT
========================= */

.static-page-content {
    margin-top: 18px;
    color: var(--site-text-soft, #374151);
    font-size: 16px;
    line-height: 1.85;
    overflow-wrap: anywhere;
}

.static-page-content > :first-child {
    margin-top: 0 !important;
}

.static-page-content > :last-child {
    margin-bottom: 0 !important;
}

.static-page-content p {
    margin: 0 0 1em;
    font-size: 1rem !important;
}

.static-page-content h1,
.static-page-content h2 {
    margin: 1.65em 0 0.65em;
    color: var(--site-text, #111827);
    font-size: clamp(24px, 2.6vw, 28px) !important;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.static-page-content h3 {
    margin: 1.4em 0 0.6em;
    color: var(--site-text, #111827);
    font-size: clamp(20px, 2vw, 22px) !important;
    font-weight: 750;
    line-height: 1.4;
    letter-spacing: -0.012em;
}

.static-page-content strong {
    color: var(--site-text, #111827);
    font-weight: 750;
}

.static-page-content a {
    color: var(--site-primary, #4f46e5);
    font-weight: 650;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.static-page-content ul,
.static-page-content ol {
    margin: 0 0 1.1em;
    padding-left: 1.6em;
}

.static-page-content ul {
    list-style: disc;
}

.static-page-content ol {
    list-style: decimal;
}

.static-page-content li {
    margin: 0.35em 0;
    padding-left: 0.2em;
    font-size: 1rem !important;
}

.static-page-content blockquote {
    margin: 1.25em 0;
    border-left: 4px solid var(--site-primary, #4f46e5);
    border-radius: 0 10px 10px 0;
    background: var(--site-surface-soft, #f3f4f6);
    padding: 0.8em 1em;
    color: var(--site-text, #374151);
}

.static-page-content figure {
    margin: 1.5em 0;
}

.static-page-content img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

.static-page-content figcaption {
    margin-top: 0.5em;
    color: var(--site-text-faint, #6b7280);
    font-size: 14px;
    text-align: center;
}

.fx-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin-top: 4px;
}

.fx-muted {
    color: #6b7280;
}

.fx-link {
    color: #4f46e5;
    font-weight: 600;
    text-decoration: none;
}

.fx-link:hover {
    text-decoration: underline;
}

/* =========================
   BUTTONS
========================= */

.fx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: 12px;
    border: none;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: 0.18s ease;
    white-space: nowrap;
}

.fx-btn-primary {
    background: #4f46e5;
    color: #ffffff;
}

.fx-btn-primary:hover {
    background: #4338ca;
}

.fx-btn-dark {
    background: #111827;
    color: #ffffff;
}

.fx-btn-dark:hover {
    background: #1f2937;
}

.fx-btn-danger {
    background: #16a34a;
    color: #ffffff;
}

.fx-btn-danger:hover {
    background: #b91c1c;
}

.fx-btn-soft {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.fx-btn-soft:hover {
    background: #e5e7eb;
}

.fx-btn-green {
    background: #16a34a;
    color: #ffffff;
}

.fx-btn-green:hover {
    background: #15803d;
}

.fx-btn[disabled] {
    opacity: 0.65;
    cursor: not-allowed;
}

/* =========================
   BADGES
========================= */

.fx-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.fx-badge-new {
    background: #dc2626;
    color: #ffffff;
}

.fx-badge-soft-red {
    background: #fee2e2;
    color: #b91c1c;
}

.fx-badge-soft-indigo {
    background: #eef2ff;
    color: #4338ca;
}

.fx-badge-soft-green {
    background: #dcfce7;
    color: #15803d;
}

/* =========================
   ACCOUNT
========================= */

.fx-account-hero {
    overflow: hidden;
    margin-bottom: 24px;
}

.fx-account-header {
    background: #374151;
    padding: 28px 32px;
    color: #ffffff;
}

.fx-account-top {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto auto auto;
    align-items: center;
    gap: 24px;
}

.fx-account-user {
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 0;
}

.fx-account-avatar {
    width: 96px;
    height: 96px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: 800;
    flex-shrink: 0;
}

.fx-account-hello {
    opacity: 0.85;
    font-size: 14px;
    margin: 0 0 4px;
}

.fx-account-name {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.2;
    margin: 0;
}

.fx-account-email {
    font-size: 14px;
    opacity: 0.9;
    margin-top: 8px;
    word-break: break-word;
}

.fx-account-status {
    display: inline-flex;
    margin-top: 12px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.25);
    font-size: 14px;
    font-weight: 700;
}

.fx-account-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.fx-account-action-btn {
    min-width: 220px;
    height: 44px;
    border: 0;
    border-radius: 12px;
    background: #16a34a;
    color: #ffffff;
    font-weight: 900;
    cursor: pointer;
    padding: 0 18px;
    transition: 0.18s ease;
}

.fx-account-action-btn:hover {
    background: #15803d;
}

.fx-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-top: 28px;
}

.fx-stat-card {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    padding: 16px;
    color: #ffffff;
    text-decoration: none;
    min-width: 0;
}

.fx-stat-label {
    font-size: 12px;
    opacity: 0.85;
    margin: 0;
}

.fx-stat-value {
    font-size: 18px;
    font-weight: 800;
    margin-top: 8px;
    word-break: break-word;
}

.fx-account-menu {
    padding: 16px;
    background: #ffffff;
}

.fx-menu-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.fx-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #f9fafb;
    color: #374151;
    border: 1px solid #e5e7eb;
    font-weight: 700;
    text-decoration: none;
    transition: 0.18s ease;
}

.fx-menu-item:hover {
    background: #f3f4f6;
}

.fx-menu-item.active {
    background: #eef2ff;
    color: #4338ca;
    border-color: #c7d2fe;
}

@media (max-width: 1023px) {
    .fx-account-top {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .fx-account-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 767px) {
    .fx-account-header {
        padding: 26px 20px;
    }

    .fx-account-top {
        gap: 18px;
    }

    .fx-account-user {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .fx-account-avatar {
        width: 88px;
        height: 88px;
        font-size: 36px;
    }

    .fx-account-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        width: 100%;
    }

    .fx-account-action-btn {
        width: 100%;
        min-width: 0;
    }

    .fx-account-top > .fx-stat-card {
        width: 100%;
    }

    .fx-account-top form {
        width: 100%;
    }

    .fx-account-top form .fx-btn {
        width: 100%;
    }

    .fx-stat-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-top: 22px;
    }

    .fx-menu-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================
   LIST ITEMS
========================= */

.fx-list {
    display: grid;
    gap: 12px;
}

.fx-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 16px;
    background: #ffffff;
    transition: 0.18s ease;
}

.fx-list-item:hover {
    background: #f9fafb;
}

.fx-list-item-red {
    border-color: #fecaca;
    background: #fef2f2;
}

.fx-list-item-red:hover {
    background: #fee2e2;
}

.fx-list-title {
    font-weight: 800;
    color: #111827;
    text-decoration: none;
}

.fx-list-title:hover {
    color: #4f46e5;
}

.fx-list-desc {
    font-size: 14px;
    color: #6b7280;
    margin-top: 4px;
}

.fx-list-time {
    font-size: 12px;
    color: #9ca3af;
    white-space: nowrap;
}

/* =========================
   STORY CARD GRID
========================= */

.fx-story-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.fx-story-card {
    display: block;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: 0.18s ease;
}

.fx-story-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.fx-story-cover {
    aspect-ratio: 3 / 4;
    background: #f3f4f6;
}

.fx-story-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fx-story-body {
    padding: 12px;
}

.fx-story-title {
    font-size: 14px;
    font-weight: 800;
    color: #111827;
    line-height: 1.35;
}

.fx-story-meta {
    font-size: 12px;
    color: #6b7280;
    margin-top: 6px;
}

.fx-story-latest {
    font-size: 12px;
    color: #4f46e5;
    font-weight: 700;
    margin-top: 6px;
}

/* =========================
   EMPTY
========================= */

.fx-empty {
    border: 1px dashed #d1d5db;
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    color: #6b7280;
    background: #ffffff;
}

/* =========================
   TOAST
========================= */

.fx-toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9999;
    padding: 12px 16px;
    border-radius: 12px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    transition: 0.2s ease;
}

.fx-toast-success {
    background: #16a34a;
}

.fx-toast-error {
    background: #dc2626;
}

/* =========================
   RESPONSIVE
========================= */

@media (min-width: 768px) {
    .fx-story-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .fx-story-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .fx-account-top {
        flex-direction: column;
        align-items: stretch;
    }

    .fx-account-user {
        flex-direction: row;
        align-items: center;
        gap: 14px;
        width: 100%;
    }

    .fx-account-avatar {
        width: 78px;
        height: 78px;
        font-size: 34px;
    }

    .fx-account-hello {
        opacity: .85;
        font-size: 13px;
        margin: 0 0 4px;
    }

    .fx-account-name {
        font-size: 22px;
        margin: 0;
    }

    .fx-account-email {
        font-size: 13px;
        margin-top: 6px;
        word-break: break-word;
    }

    .fx-stat-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }

    .fx-menu-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }

    .fx-list-item {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* =========================
   SAFE LOGO FIX
========================= */

.site-header-row{
    margin-left: 2em;
}

.site-logo-safe {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    flex-shrink: 0;
    width: auto;
    overflow: hidden;
    text-decoration: none;
}

.site-logo-safe img {
    display: block;

    max-width: 80px ;
    max-height: 80px ;

    width: auto;
    height: auto;

    object-fit: contain !important;
}

@media (max-width: 767px) {
    .site-logo-safe {
        max-width: 80px;
        height: 80px;
    }

    .site-logo-safe img {
        max-width: 80px !important;
        max-height: 80px !important;
    }
}


/* =========================
   HOT STORY SLIDER
========================= */

.hot-slider-shell {
    width: 100%;
    overflow: hidden;

    --hot-auto-delay: 5000;
    --hot-slide-duration: 550ms;
    --hot-slide-gap: 16px;
}

.hot-story-slider {
    display: flex !important;
    gap: var(--hot-slide-gap);
    width: 100%;

    overflow: visible;
    transform: translate3d(0, 0, 0);
    transition: transform var(--hot-slide-duration) ease;

    will-change: transform;
    touch-action: pan-y;
    user-select: none;

    padding-bottom: 4px;
}

.hot-story-slider.is-jump {
    transition: none !important;
}

.hot-story-slider.is-dragging {
    transition: none !important;
    cursor: grabbing;
}

.hot-story-card {
    flex: 0 0 calc((100% - 66px) / 5);
    min-width: 0;
}

.hot-slide-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 34px;
    height: 34px;

    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #ffffff;
    color: #111827;

    font-size: 24px;
    font-weight: 800;
    line-height: 1;

    cursor: pointer;
    transition: 0.18s ease;
}

.hot-slide-btn:hover {
    background: #f3f4f6;
    color: #4f46e5;
}

@media (max-width: 1023px) {
    .hot-story-card {
        flex-basis: calc((100% - 32px) / 3);
    }
}

@media (max-width: 767px) {
    .hot-story-card {
        flex-basis: calc((100% - 16px) / 2);
    }

    .hot-slide-btn {
        width: 32px;
        height: 32px;
        font-size: 22px;
    }
}

@media (max-width: 420px) {
    .hot-story-card {
        flex-basis: calc((100% - 16px) / 2);
    }
}

/* =========================
   HEADER NAV RESPONSIVE FIX
========================= */

/*
   app.blade.php đang dùng các class:
   - .site-header-row: hàng chứa logo + desktop nav + nút mobile
   - .site-desktop-nav: menu desktop
   - .site-mobile-toggle: nút ☰ mobile
   - #mobileMenu.site-mobile-menu: menu xổ xuống mobile
*/

.site-header-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px !important;
    margin-left: 0 !important;
}

.site-desktop-nav {
    align-items: center !important;
    gap: 16px !important;
    margin-left: auto !important;
}

.site-mobile-toggle {
    flex-shrink: 0;
}

#mobileMenu.site-mobile-menu {
    width: 100%;
}

/* Mobile: chỉ hiện logo + nút ☰, ẩn menu desktop */
@media (max-width: 767px) {
    .site-header-row {
        margin-left: 0 !important;
    }

    .site-desktop-nav {
        display: none !important;
    }

    .site-mobile-toggle {
        display: inline-flex !important;
    }

    #mobileMenu.site-mobile-menu {
        display: none !important;
    }

    #mobileMenu.site-mobile-menu.is-open {
        display: block !important;
    }
}

/* Desktop: hiện menu ngang, ẩn nút ☰ và menu mobile */
@media (min-width: 768px) {
    .site-desktop-nav {
        display: flex !important;
    }

    .site-mobile-toggle {
        display: none !important;
    }

    #mobileMenu.site-mobile-menu {
        display: none !important;
    }
}


/* =========================
   DONATION RESPONSIVE LAYOUT
========================= */

.donation-hero-card {
    margin-bottom: 24px;
    padding: clamp(18px, 2.4vw, 28px);
}

.donation-main-layout,
.donation-qr-layout {
    display: block;
}

.donation-main-layout > div + div,
.donation-qr-layout > div + div {
    margin-top: 20px;
}

.donation-ranking-panel,
.donation-cta-panel {
    min-width: 0;
}

.donation-ranking-panel {
    display: flex;
    flex-direction: column;
}

.donation-panel-heading {
    margin-bottom: 18px;
}

.donation-ranking-table-wrap {
    overflow: hidden;
    overflow-x: auto;
    border: 1px solid var(--site-border, #e5e7eb);
    border-radius: 18px;
    background: var(--site-surface, #fff);
}

.donation-ranking-note {
    margin: 13px 0 0;
    color: var(--site-text-faint, #6b7280);
    font-size: 13px;
    line-height: 1.7;
}

.donation-cta-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid color-mix(in srgb, var(--site-primary, #4f46e5) 24%, var(--site-border, #e5e7eb));
    border-radius: 20px;
    background:
        radial-gradient(circle at 100% 0, color-mix(in srgb, var(--site-primary, #4f46e5) 12%, transparent), transparent 42%),
        var(--site-surface-soft, #eef2ff);
    padding: clamp(22px, 3vw, 32px);
}

.donation-cta-eyebrow {
    margin: 0;
    color: var(--site-primary, #4f46e5);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.donation-cta-title {
    margin: 9px 0 0;
    color: var(--site-text, #111827);
    font-size: clamp(25px, 2.4vw, 30px);
    font-weight: 900;
    line-height: 1.25;
}

.donation-cta-description {
    margin: 15px 0 0;
    color: var(--site-text-soft, #4b5563);
    font-size: 15px;
    line-height: 1.75;
}

.donation-cta-note {
    margin: 11px 0 0;
    color: var(--site-text-faint, #6b7280);
    font-size: 13px;
    line-height: 1.7;
}

.donation-cta-button {
    width: 100%;
    margin-top: 24px;
}

@media (min-width: 960px) {
    .donation-main-layout {
        display: grid;
        grid-template-columns: minmax(0, 1.1fr) minmax(340px, .9fr);
        align-items: stretch;
        gap: 24px;
    }

    .donation-main-layout > div + div {
        margin-top: 0;
    }
}

@media (min-width: 768px) {
    .donation-qr-layout {
        display: grid;
        grid-template-columns: 260px 1fr;
        align-items: start;
        gap: 20px;
    }

    .donation-qr-layout > div + div {
        margin-top: 0;
    }
}

@media (max-width: 520px) {
    .donation-cta-panel {
        padding: 20px;
    }

    .donation-cta-title {
        font-size: 24px;
    }
}

/* =========================
   DONATION RECENT RESPONSIVE
========================= */

.donation-recent-table-wrap {
    overflow-x: auto;
    margin-top: 18px;
}

.donation-recent-mobile-list {
    display: none;
}

@media (max-width: 767px) {
    .donation-recent-table-wrap {
        display: none !important;
    }

    .donation-recent-mobile-list {
        display: grid;
        gap: 12px;
        margin-top: 16px;
    }

    .donation-recent-card {
        background: #ffffff;
        border: 1px solid #e5e7eb;
        border-radius: 16px;
        padding: 14px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }

    .donation-recent-card-head {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        align-items: flex-start;
        padding-bottom: 12px;
        border-bottom: 1px solid #f3f4f6;
        margin-bottom: 12px;
    }

    .donation-recent-label {
        font-size: 12px;
        color: #6b7280;
        font-weight: 700;
        margin: 0;
    }

    .donation-recent-name {
        font-size: 15px;
        color: #111827;
        font-weight: 900;
        margin: 4px 0 0;
    }

    .donation-recent-time {
        font-size: 12px;
        color: #6b7280;
        text-align: right;
        white-space: nowrap;
        line-height: 1.5;
    }

    .donation-recent-row {
        display: grid;
        grid-template-columns: 92px minmax(0, 1fr);
        gap: 10px;
        align-items: start;
        font-size: 13px;
        line-height: 1.6;
        padding: 5px 0;
        text-wrap-mode: nowrap;
    }

    .donation-recent-row span {
        color: #6b7280;
        font-weight: 700;
    }

    .donation-recent-row strong {
        color: #111827;
        font-weight: 900;
        text-align: right;
        word-break: break-word;
    }

    .donation-recent-row .donation-recent-green {
        color: #16a34a;
    }

    .donation-recent-empty {
        border: 1px dashed #d1d5db;
        border-radius: 16px;
        padding: 20px;
        text-align: center;
        color: #6b7280;
        background: #ffffff;
    }
}
/* =========================================================
   AUTHOR FRONTEND UI V2
   Tách riêng CSS khu tác giả để không đụng layout account cũ.
========================================================= */
.author-shell,
.author-shell * {
    box-sizing: border-box;
}

.author-shell {
    width: min(1120px, calc(100% - 32px));
    margin-left: auto;
    margin-right: auto;
}

.author-shell-top {
    padding-top: 28px;
}

.author-main {
    display: grid;
    gap: 22px;
    padding: 18px 0 56px;
}

.author-topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 22px;
    padding: 22px;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    background:
        radial-gradient(circle at top left, rgba(79, 70, 229, .10), transparent 32%),
        linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 10px 30px rgba(15, 23, 42, .06);
}

.author-topbar-text {
    min-width: 0;
}

.author-eyebrow {
    margin: 0 0 6px;
    color: #4f46e5;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.author-topbar h1 {
    margin: 0;
    color: #0f172a;
    font-size: clamp(24px, 3vw, 36px);
    line-height: 1.12;
    font-weight: 950;
}

.author-topbar p:not(.author-eyebrow) {
    margin: 8px 0 0;
    max-width: 680px;
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
}

.author-tabs {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.author-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 11px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #ffffff;
    color: #334155;
    font-size: 14px;
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    transition: .18s ease;
}

.author-tab:hover {
    transform: translateY(-1px);
    border-color: #c7d2fe;
    color: #4338ca;
    box-shadow: 0 8px 18px rgba(79, 70, 229, .12);
    text-decoration: none;
}

.author-tab.is-active {
    background: #16a34a;
    border-color: #16a34a;
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(22, 163, 74, .20);
}

.author-tab-primary {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(79, 70, 229, .22);
}

.author-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .06);
}

.author-dashboard-card {
    overflow: hidden;
}

.author-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.author-card-head > div:first-child {
    min-width: 0;
}

.author-card-title {
    margin: 0;
    color: #0f172a;
    font-size: clamp(22px, 2vw, 30px);
    line-height: 1.2;
    font-weight: 950;
}

.author-card-desc {
    margin: 7px 0 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
}

.author-card-actions,
.author-row-actions,
.author-story-actions,
.author-form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.author-card-actions form,
.author-row-actions form,
.author-story-actions form {
    margin: 0;
}

.author-link {
    color: #4f46e5;
    font-weight: 900;
    text-decoration: none;
}

.author-link:hover {
    text-decoration: underline;
}

.author-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 10px 15px;
    border: 1px solid transparent;
    border-radius: 13px;
    font-size: 14px;
    font-weight: 950;
    line-height: 1;
    text-decoration: none !important;
    cursor: pointer;
    white-space: nowrap;
    transition: .18s ease;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}

.author-btn:hover {
    transform: translateY(-1px);
}

.author-btn-primary {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(79, 70, 229, .22);
}

.author-btn-success {
    background: #16a34a;
    border-color: #16a34a;
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(22, 163, 74, .18);
}

.author-btn-soft {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #334155;
}

.author-btn-warning {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(245, 158, 11, .18);
}

.author-btn-danger {
    background: #dc2626;
    border-color: #dc2626;
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(220, 38, 38, .18);
}

.author-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.author-stat-box {
    position: relative;
    overflow: hidden;
    min-height: 126px;
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.author-stat-box::after {
    content: "";
    position: absolute;
    right: -28px;
    bottom: -28px;
    width: 84px;
    height: 84px;
    border-radius: 999px;
    background: rgba(79, 70, 229, .08);
}

.author-stat-icon {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #eef2ff;
    margin-bottom: 14px;
}

.author-stat-box p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
}

.author-stat-box strong {
    display: block;
    margin-top: 6px;
    color: #0f172a;
    font-size: 30px;
    line-height: 1;
    font-weight: 950;
}

.author-list {
    display: grid;
    gap: 12px;
}

.author-row,
.author-story-row {
    display: grid;
    gap: 16px;
    align-items: center;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #ffffff;
    transition: .18s ease;
}

.author-row {
    grid-template-columns: minmax(0, 1fr) auto;
}

.author-story-row {
    grid-template-columns: 86px minmax(0, 1fr) auto;
}

.author-row:hover,
.author-story-row:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.author-row.is-muted,
.author-story-row.is-muted {
    opacity: .62;
}

.author-row-main,
.author-story-info {
    min-width: 0;
}

.author-row-main h3,
.author-story-info h3 {
    margin: 0;
    color: #0f172a;
    font-size: 17px;
    line-height: 1.35;
    font-weight: 950;
}

.author-row-main h3 a,
.author-story-info h3 a {
    color: inherit;
    text-decoration: none;
}

.author-row-main h3 a:hover,
.author-story-info h3 a:hover {
    color: #4f46e5;
}

.author-row-main p,
.author-meta {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.6;
}

.author-cover-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 86px;
    height: 112px;
    overflow: hidden;
    border-radius: 16px;
    background: #f1f5f9;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
    border: 1px solid #e2e8f0;
}

.author-cover-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-badge-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.author-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 950;
    line-height: 1;
}

.author-badge.is-public {
    background: #dcfce7;
    color: #166534;
}

.author-badge.is-hidden {
    background: #f1f5f9;
    color: #475569;
}

.author-badge.is-info {
    background: #eef2ff;
    color: #3730a3;
}

.author-badge.is-deleted {
    background: #fee2e2;
    color: #991b1b;
}

.author-alert {
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid transparent;
    font-size: 14px;
    line-height: 1.6;
}

.author-alert ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

.author-alert-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.author-alert-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
    margin-bottom: 18px;
}

.author-empty {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 36px 20px;
    border: 1px dashed #cbd5e1;
    border-radius: 18px;
    background: #f8fafc;
    text-align: center;
    color: #64748b;
}

.author-empty strong {
    color: #0f172a;
    font-size: 17px;
}

.author-empty p {
    margin: 0;
}

.author-pagination {
    margin-top: 18px;
}

.author-form {
    display: grid;
    gap: 18px;
}

.author-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.author-field {
    display: grid;
    gap: 7px;
}

.author-field label {
    color: #334155;
    font-size: 13px;
    font-weight: 950;
}

.author-field input,
.author-field select,
.author-field textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    background: #ffffff;
    color: #0f172a;
    padding: 12px 13px;
    font-size: 14px;
    outline: none;
    transition: .18s ease;
}

.author-field input:focus,
.author-field select:focus,
.author-field textarea:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, .10);
}

.author-field textarea {
    min-height: 160px;
    resize: vertical;
    line-height: 1.75;
}

.author-field input[type="file"] {
    padding: 10px;
    background: #f8fafc;
}

.author-check {
    display: flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    color: #334155;
    font-weight: 900;
    cursor: pointer;
}

.author-check input {
    width: 18px;
    height: 18px;
    accent-color: #16a34a;
}

.author-current-cover {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #f8fafc;
}

.author-current-cover img {
    width: 76px;
    height: 102px;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
}

.author-current-cover strong {
    display: block;
    color: #0f172a;
    font-weight: 950;
}

.author-current-cover p {
    margin: 5px 0 0;
    color: #64748b;
    font-size: 13px;
}

@media (max-width: 1023px) {
    .author-topbar {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .author-tabs {
        justify-content: flex-start;
        width: 100%;
    }

    .author-tab {
        flex: 1 1 180px;
    }

    .author-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .author-story-row {
        grid-template-columns: 76px minmax(0, 1fr);
    }

    .author-story-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}

@media (max-width: 767px) {
    .author-shell {
        width: min(100% - 20px, 1120px);
    }

    .author-shell-top {
        padding-top: 16px;
    }

    .author-topbar,
    .author-card {
        border-radius: 18px;
        padding: 18px;
    }

    .author-tabs {
        display: grid;
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .author-tab,
    .author-btn {
        width: 100%;
    }

    .author-card-head {
        display: grid;
        gap: 14px;
    }

    .author-card-actions,
    .author-row-actions,
    .author-story-actions,
    .author-form-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .author-stats-grid,
    .author-form-grid {
        grid-template-columns: 1fr;
    }

    .author-row,
    .author-story-row {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .author-cover-thumb {
        width: 100%;
        height: 220px;
    }

    .author-row-actions form,
    .author-story-actions form,
    .author-card-actions form {
        width: 100%;
    }

    .author-current-cover {
        align-items: flex-start;
    }
}


/* =========================
   ACCOUNT AUTHOR BOX FIX
========================= */

.fx-author-account-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 22px;
    margin: 0 0 24px;
    padding: 22px 24px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.fx-author-account-main {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    min-width: 0;
}

.fx-author-account-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #eef2ff;
    color: #4338ca;
    font-size: 24px;
    border: 1px solid #c7d2fe;
}

.fx-author-account-content {
    min-width: 0;
}

.fx-author-account-kicker {
    margin: 0 0 4px;
    color: #6b7280;
    font-size: 13px;
    font-weight: 800;
}

.fx-author-account-title {
    margin: 0;
    color: #111827;
    font-size: 26px;
    line-height: 1.2;
    font-weight: 950;
    letter-spacing: -0.02em;
}

.fx-author-account-desc {
    margin: 8px 0 0;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.6;
}

.fx-author-account-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-top: 12px;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.fx-author-account-badge-green {
    background: #dcfce7;
    color: #15803d;
}

.fx-author-account-badge-purple {
    background: #ede9fe;
    color: #5b21b6;
}

.fx-author-account-badge-yellow {
    background: #fef3c7;
    color: #92400e;
}

.fx-author-account-alert {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    font-size: 14px;
    line-height: 1.5;
}

.fx-author-account-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.fx-author-account-btn {
    min-height: 42px;
    padding: 0 16px;
    border-radius: 12px;
    border: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
    transition: 0.18s ease;
}

.fx-author-account-btn-primary {
    background: #4f46e5;
    color: #ffffff;
}

.fx-author-account-btn-primary:hover {
    background: #4338ca;
    color: #ffffff;
}

.fx-author-account-btn-green {
    background: #16a34a;
    color: #ffffff;
}

.fx-author-account-btn-green:hover {
    background: #15803d;
    color: #ffffff;
}

.fx-author-account-btn-soft {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.fx-author-account-btn-soft:hover {
    background: #e5e7eb;
    color: #111827;
}

@media (max-width: 900px) {
    .fx-author-account-card {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .fx-author-account-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .fx-author-account-card {
        padding: 18px;
        border-radius: 18px;
    }

    .fx-author-account-main {
        flex-direction: column;
        gap: 12px;
    }

    .fx-author-account-title {
        font-size: 22px;
    }

    .fx-author-account-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .fx-author-account-btn {
        width: 100%;
    }
}

/* =========================================================
   CSS CLEANUP PACK - MOVED FROM BLADE FILES
========================================================= */


/* =========================================================
   PUBLIC STORY INDEX FILTER + GRID
   CSS tách khỏi resources/views/frontend/stories/index.blade.php
========================================================= */
.story-index-page {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 26px 0 54px;
}

.story-index-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.story-index-kicker {
    margin: 0 0 4px;
    color: #4f46e5;
    font-size: 12px;
    font-weight: 950;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.story-index-title {
    margin: 0;
    color: #0f172a;
    font-size: clamp(26px, 3vw, 36px);
    line-height: 1.1;
    font-weight: 950;
    letter-spacing: -.03em;
}

.story-index-desc {
    margin: 8px 0 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
}

.story-filter-shell {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .07);
    padding: 18px;
    margin-bottom: 22px;
}

.story-filter-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px 220px;
    gap: 14px;
    align-items: end;
}

.story-filter-field {
    min-width: 0;
}

.story-filter-label {
    display: block;
    font-size: 13px;
    color: #111827;
    font-weight: 950;
    margin-bottom: 7px;
}

.story-filter-input,
.story-filter-select {
    width: 100%;
    min-height: 46px;
    border: 1px solid #cbd5e1;
    border-radius: 13px;
    background: #ffffff;
    color: #111827;
    padding: 0 13px;
    outline: none;
    transition: .16s ease;
}

.story-filter-input:focus,
.story-filter-select:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, .12);
}

.story-category-picker {
    position: relative;
    margin-top: 14px;
}

.story-category-box {
    position: relative;
    min-height: 52px;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    background: #ffffff;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    padding: 8px 10px;
    cursor: text;
    transition: .16s ease;
}

.story-category-box:focus-within {
    border-color: #94a3b8;
    box-shadow: none;
}

.story-category-tags-slot {
    display: contents;
}

.story-category-empty {
    color: #94a3b8;
    padding: 6px 4px;
    font-size: 14px;
    font-weight: 800;
}

.story-category-tag {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 30px;
    padding: 0 9px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
    font-size: 13px;
    font-weight: 950;
}

.story-category-tag button {
    border: 0;
    background: transparent;
    color: #4338ca;
    font-weight: 950;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.story-category-search {
    min-width: 220px;
    flex: 1 1 220px;
    height: 32px;
    border: 0;
    outline: none;
    font-size: 14px;
    color: #111827;
    background: transparent;
    box-shadow: none;
}

.story-category-search:focus {
    border: 0;
    outline: none;
    box-shadow: none;
}

.story-category-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    z-index: 30;
    display: none;
    max-height: 300px;
    overflow-y: auto;
    padding: 8px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .10);
}

.story-category-picker.is-open .story-category-dropdown {
    display: grid;
    gap: 4px;
}

.story-category-option {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 0;
    background: transparent;
    color: #111827;
    padding: 10px 11px;
    border-radius: 11px;
    font-size: 14px;
    font-weight: 850;
    text-align: left;
    cursor: pointer;
}

.story-category-option:hover {
    background: #f3f4f6;
}

.story-category-option.is-selected {
    background: #eef2ff;
    color: #4338ca;
}

.story-category-check {
    opacity: 0;
    font-weight: 950;
}

.story-category-option.is-selected .story-category-check {
    opacity: 1;
}

.story-category-no-result {
    padding: 14px;
    color: #6b7280;
    font-size: 14px;
    text-align: center;
}

.story-filter-selected-note {
    margin: 9px 0 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.5;
}

.story-filter-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 14px;
}

.story-filter-btn {
    min-height: 46px;
    border-radius: 13px;
    border: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    font-size: 14px;
    font-weight: 950;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.story-filter-btn-soft {
    background: #f3f4f6;
    color: #374151;
}

.story-filter-btn-soft:hover {
    background: #e5e7eb;
    color: #111827;
}

.story-filter-btn-primary {
    background: #4f46e5;
    color: #ffffff;
    box-shadow: 0 10px 20px rgba(79, 70, 229, .18);
}

.story-filter-btn-primary:hover {
    background: #4338ca;
    color: #ffffff;
}

.story-public-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 18px;
}

.story-public-card {
    display: block;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: inherit;
    text-decoration: none;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .05);
    transition: .18s ease;
}

.story-public-card:hover {
    transform: translateY(-2px);
    border-color: #cbd5e1;
    box-shadow: 0 14px 30px rgba(15, 23, 42, .10);
    text-decoration: none;
}

.story-public-cover {
    aspect-ratio: 3 / 4;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 900;
}

.story-public-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-public-body {
    padding: 12px;
}

.story-public-title {
    margin: 0;
    color: #0f172a;
    font-size: 14px;
    font-weight: 950;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.story-public-author,
.story-public-meta-row {
    margin: 7px 0 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.45;
}

.story-public-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.story-public-latest {
    margin: 7px 0 0;
    color: #4f46e5;
    font-size: 12px;
    font-weight: 850;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.story-public-empty {
    grid-column: 1 / -1;
    padding: 30px;
    border: 1px dashed #cbd5e1;
    border-radius: 18px;
    background: #ffffff;
    color: #64748b;
    text-align: center;
}

.story-public-pagination {
    margin-top: 22px;
}

@media (max-width: 1180px) {
    .story-public-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 1024px) {
    .story-filter-top {
        grid-template-columns: 1fr;
    }

    .story-filter-actions {
        justify-content: flex-start;
    }

    .story-public-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .story-index-page {
        width: min(100% - 20px, 1120px);
        padding-top: 18px;
    }

    .story-filter-shell {
        padding: 14px;
        border-radius: 18px;
    }

    .story-category-dropdown {
        position: static;
        margin-top: 8px;
        max-height: 260px;
    }

    .story-filter-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .story-filter-btn {
        width: 100%;
    }

    .story-public-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
}


/* =========================================================
   AUTHOR CATEGORY PICKER
   CSS tách khỏi create/edit story blade
========================================================= */
        .author-category-picker {
            position: relative;
        }

        .author-category-control {
            min-height: 56px;
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
            padding: 9px 42px 9px 12px;
            border: 1px solid #cbd5e1;
            border-radius: 16px;
            background: #ffffff;
            cursor: text;
            transition: .18s ease;
        }

        .author-category-picker.is-open .author-category-control,
        .author-category-control:focus-within {
            border-color: #4f46e5;
            box-shadow: 0 0 0 4px rgba(79, 70, 229, .12);
        }

        .author-category-tags {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 7px;
            min-width: 0;
        }

        .author-category-tag {
            display: inline-flex;
            align-items: center;
            gap: 7px;
            height: 30px;
            padding: 0 10px;
            border: 1px solid #c7d2fe;
            border-radius: 999px;
            background: #eef2ff;
            color: #4338ca;
            font-size: 13px;
            font-weight: 900;
            line-height: 1;
        }

        .author-category-tag button {
            border: 0;
            background: transparent;
            color: inherit;
            cursor: pointer;
            font-size: 16px;
            line-height: 1;
            padding: 0;
            font-weight: 900;
        }

        .author-category-placeholder {
            color: #94a3b8;
            font-size: 14px;
            font-weight: 700;
        }

        .author-category-search {
            flex: 1 1 180px;
            min-width: 120px;
            border: 0 !important;
            outline: none !important;
            box-shadow: none !important;
            padding: 8px 0 !important;
            font-size: 14px;
            background: transparent !important;
        }

        .author-category-arrow {
            position: absolute;
            top: 19px;
            right: 16px;
            color: #64748b;
            font-size: 16px;
            pointer-events: none;
            transition: .18s ease;
        }

        .author-category-picker.is-open .author-category-arrow {
            transform: rotate(180deg);
        }

        .author-category-dropdown {
            position: absolute;
            left: 0;
            right: 0;
            top: calc(100% + 8px);
            z-index: 30;
            display: none;
            max-height: 290px;
            overflow: auto;
            padding: 8px;
            border: 1px solid #e5e7eb;
            border-radius: 16px;
            background: #ffffff;
            box-shadow: 0 18px 45px rgba(15, 23, 42, .16);
        }

        .author-category-picker.is-open .author-category-dropdown {
            display: block;
        }

        .author-category-options {
            display: grid;
            gap: 4px;
        }

        .author-category-option {
            display: flex;
            align-items: center;
            gap: 10px;
            min-height: 40px;
            padding: 9px 10px;
            border-radius: 12px;
            cursor: pointer;
            color: #111827;
            font-size: 14px;
            font-weight: 800;
            transition: .14s ease;
        }

        .author-category-option:hover {
            background: #f3f4f6;
        }

        .author-category-option.is-selected {
            background: #eef2ff;
            color: #4338ca;
        }

        .author-category-option input {
            width: 16px;
            height: 16px;
            accent-color: #4f46e5;
            flex-shrink: 0;
        }

        .author-category-empty {
            padding: 16px;
            text-align: center;
            color: #64748b;
            font-size: 14px;
            font-weight: 700;
        }

        .author-category-help {
            margin-top: 7px;
            color: #64748b;
            font-size: 13px;
            line-height: 1.5;
        }

        .author-category-error {
            margin-top: 7px;
            color: #dc2626;
            font-size: 13px;
            font-weight: 800;
            line-height: 1.5;
        }

        @media (max-width: 640px) {
            .author-category-dropdown {
                position: static;
                margin-top: 8px;
                max-height: 240px;
            }
        }


/* =========================================================
   AUTHOR AFFILIATE PAGE
   CSS tách khỏi resources/views/frontend/affiliate/index.blade.php
========================================================= */
        .aff-page {
            display: grid;
            gap: 22px;
        }

        .aff-hero {
            position: relative;
            overflow: hidden;
            border-radius: 24px;
            border: 1px solid #e5e7eb;
            background: linear-gradient(135deg, #111827 0%, #312e81 54%, #4f46e5 100%);
            color: #ffffff;
            padding: 30px;
            box-shadow: 0 18px 44px rgba(15, 23, 42, .18);
        }

        .aff-hero::after {
            content: "";
            position: absolute;
            right: -80px;
            top: -80px;
            width: 220px;
            height: 220px;
            border-radius: 999px;
            background: rgba(255, 255, 255, .12);
        }

        .aff-hero-inner {
            position: relative;
            z-index: 1;
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto;
            align-items: center;
            gap: 22px;
        }

        .aff-kicker {
            margin: 0 0 8px;
            font-size: 13px;
            font-weight: 950;
            letter-spacing: .08em;
            text-transform: uppercase;
            color: rgba(255, 255, 255, .78);
        }

        .aff-title {
            margin: 0;
            font-size: 34px;
            line-height: 1.15;
            font-weight: 950;
            letter-spacing: -.03em;
        }

        .aff-desc {
            margin: 12px 0 0;
            max-width: 760px;
            color: rgba(255, 255, 255, .82);
            font-size: 15px;
            line-height: 1.75;
        }

        .aff-status-pill {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-height: 42px;
            padding: 0 16px;
            border-radius: 999px;
            border: 1px solid rgba(255, 255, 255, .28);
            background: rgba(255, 255, 255, .14);
            color: #ffffff;
            font-size: 14px;
            font-weight: 950;
            white-space: nowrap;
        }

        .aff-alert {
            border-radius: 18px;
            padding: 14px 16px;
            font-weight: 850;
            line-height: 1.55;
            border: 1px solid transparent;
        }

        .aff-alert.is-success {
            background: #dcfce7;
            color: #166534;
            border-color: #bbf7d0;
        }

        .aff-alert.is-error {
            background: #fef2f2;
            color: #991b1b;
            border-color: #fecaca;
        }

        .aff-grid-2 {
            display: grid;
            grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
            gap: 18px;
            align-items: start;
        }

        .aff-card {
            background: #ffffff;
            border: 1px solid #e5e7eb;
            border-radius: 22px;
            padding: 22px;
            box-shadow: 0 8px 26px rgba(15, 23, 42, .06);
        }

        .aff-card-head {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 16px;
            margin-bottom: 18px;
        }

        .aff-card-title {
            margin: 0;
            color: #111827;
            font-size: 23px;
            line-height: 1.25;
            font-weight: 950;
            letter-spacing: -.02em;
        }

        .aff-card-subtitle {
            margin: 6px 0 0;
            color: #6b7280;
            font-size: 14px;
            line-height: 1.6;
        }

        .aff-badge {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: fit-content;
            min-height: 30px;
            padding: 0 11px;
            border-radius: 999px;
            font-size: 12px;
            font-weight: 950;
            white-space: nowrap;
        }

        .aff-badge.is-success { background: #dcfce7; color: #15803d; }
        .aff-badge.is-warning { background: #fef3c7; color: #92400e; }
        .aff-badge.is-danger { background: #fee2e2; color: #b91c1c; }
        .aff-badge.is-muted { background: #f3f4f6; color: #4b5563; }
        .aff-badge.is-neutral { background: #eef2ff; color: #4338ca; }

        .aff-checklist {
            display: grid;
            gap: 12px;
        }

        .aff-check-item {
            display: grid;
            grid-template-columns: 34px minmax(0, 1fr);
            gap: 12px;
            align-items: flex-start;
            padding: 14px;
            border: 1px solid #e5e7eb;
            border-radius: 16px;
            background: #f9fafb;
        }

        .aff-check-icon {
            width: 34px;
            height: 34px;
            border-radius: 999px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
            font-weight: 950;
            background: #ffffff;
            border: 1px solid #e5e7eb;
        }

        .aff-check-item.is-ok .aff-check-icon {
            background: #dcfce7;
            color: #15803d;
            border-color: #bbf7d0;
        }

        .aff-check-item.is-missing .aff-check-icon {
            background: #fee2e2;
            color: #b91c1c;
            border-color: #fecaca;
        }

        .aff-check-title {
            margin: 0;
            color: #111827;
            font-weight: 950;
            line-height: 1.35;
        }

        .aff-check-desc {
            margin: 4px 0 0;
            color: #6b7280;
            font-size: 13px;
            line-height: 1.55;
        }

        .aff-actions {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 10px;
            margin-top: 18px;
        }

        .aff-btn {
            min-height: 42px;
            padding: 0 16px;
            border-radius: 13px;
            border: 0;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            color: inherit;
            text-decoration: none;
            font-size: 14px;
            font-weight: 950;
            cursor: pointer;
            transition: .18s ease;
            white-space: nowrap;
        }

        .aff-btn.is-primary { background: #4f46e5; color: #ffffff; }
        .aff-btn.is-primary:hover { background: #4338ca; color: #ffffff; }
        .aff-btn.is-green { background: #16a34a; color: #ffffff; }
        .aff-btn.is-green:hover { background: #15803d; color: #ffffff; }
        .aff-btn.is-soft { background: #f3f4f6; color: #374151; border: 1px solid #e5e7eb; }
        .aff-btn.is-soft:hover { background: #e5e7eb; color: #111827; }
        .aff-btn.is-danger { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
        .aff-btn.is-danger:hover { background: #fecaca; }

        .aff-stat-grid {
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 14px;
        }

        .aff-stat-card {
            border-radius: 18px;
            padding: 16px;
            background: #f9fafb;
            border: 1px solid #e5e7eb;
        }

        .aff-stat-label {
            margin: 0;
            color: #6b7280;
            font-size: 12px;
            font-weight: 900;
        }

        .aff-stat-value {
            margin: 7px 0 0;
            color: #111827;
            font-size: 28px;
            line-height: 1.15;
            font-weight: 950;
        }

        .aff-form {
            display: grid;
            gap: 13px;
        }

        .aff-form-grid {
            display: grid;
            grid-template-columns: minmax(0, 1fr) minmax(160px, .35fr);
            gap: 12px;
        }

        .aff-field label {
            display: block;
            margin: 0 0 6px;
            color: #374151;
            font-size: 13px;
            font-weight: 950;
        }

        .aff-field input,
        .aff-field textarea {
            width: 100%;
            border: 1px solid #d1d5db;
            border-radius: 13px;
            padding: 12px 13px;
            color: #111827;
            background: #ffffff;
            outline: none;
            font-size: 14px;
        }

        .aff-field input[type="file"] {
            padding: 10px;
            background: #f9fafb;
        }

        .aff-field textarea {
            resize: vertical;
            min-height: 74px;
        }

        .aff-field-help {
            margin: 6px 0 0;
            color: #6b7280;
            font-size: 12px;
            line-height: 1.45;
        }

        .aff-field input:focus,
        .aff-field textarea:focus {
            border-color: #818cf8;
            box-shadow: 0 0 0 3px rgba(129, 140, 248, .18);
        }

        .aff-switch {
            display: flex;
            align-items: center;
            gap: 10px;
            color: #374151;
            font-size: 14px;
            font-weight: 850;
        }

        .aff-link-list {
            display: grid;
            gap: 14px;
        }

        .aff-link-card {
            border: 1px solid #e5e7eb;
            border-radius: 20px;
            background: #ffffff;
            overflow: hidden;
        }

        .aff-link-main {
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto;
            gap: 16px;
            align-items: center;
            padding: 16px;
        }

        .aff-link-info {
            display: flex;
            align-items: center;
            gap: 14px;
            min-width: 0;
        }

        .aff-link-thumb {
            width: 72px;
            height: 72px;
            flex-shrink: 0;
            border-radius: 16px;
            object-fit: cover;
            border: 1px solid #e5e7eb;
            background: #f3f4f6;
        }

        .aff-link-title-row {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 8px;
        }

        .aff-link-title {
            color: #111827;
            font-weight: 950;
            line-height: 1.35;
        }

        .aff-link-meta {
            margin-top: 6px;
            color: #6b7280;
            font-size: 13px;
            line-height: 1.55;
            word-break: break-word;
        }

        .aff-link-actions {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 8px;
            flex-wrap: wrap;
        }

        .aff-link-edit {
            border-top: 1px solid #f3f4f6;
            background: #f9fafb;
            padding: 0 16px 16px;
        }

        .aff-link-edit summary {
            padding: 13px 0;
            color: #4f46e5;
            font-weight: 950;
            cursor: pointer;
            list-style: none;
        }

        .aff-link-edit summary::-webkit-details-marker {
            display: none;
        }

        .aff-empty {
            border: 1px dashed #d1d5db;
            border-radius: 18px;
            padding: 26px;
            text-align: center;
            color: #6b7280;
            background: #ffffff;
        }


        .aff-rule-row {
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto;
            gap: 12px;
            align-items: end;
        }

        .aff-story-toolbar {
            margin: 16px 0 12px;
        }

        .aff-story-search {
            width: 100%;
            border: 1px solid #d1d5db;
            border-radius: 13px;
            padding: 12px 13px;
            color: #111827;
            background: #ffffff;
            outline: none;
            font-size: 14px;
        }

        .aff-story-search:focus {
            border-color: #818cf8;
            box-shadow: 0 0 0 3px rgba(129, 140, 248, .18);
        }

        .aff-story-list {
            display: grid;
            gap: 12px;
        }

        .aff-story-item {
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto;
            gap: 14px;
            align-items: center;
            padding: 14px;
            border: 1px solid #e5e7eb;
            border-radius: 18px;
            background: #ffffff;
        }

        .aff-story-info {
            display: flex;
            align-items: center;
            gap: 12px;
            min-width: 0;
        }

        .aff-story-thumb {
            width: 58px;
            height: 76px;
            border-radius: 12px;
            flex-shrink: 0;
            object-fit: cover;
            background: #f3f4f6;
            border: 1px solid #e5e7eb;
        }

        .aff-story-thumb.is-empty {
            display: flex;
            align-items: center;
            justify-content: center;
            color: #9ca3af;
            font-size: 11px;
            font-weight: 900;
        }

        .aff-story-title-row {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 8px;
        }

        .aff-story-title {
            color: #111827;
            font-weight: 950;
            line-height: 1.35;
        }

        .aff-story-meta {
            margin-top: 5px;
            color: #6b7280;
            font-size: 13px;
            line-height: 1.5;
        }

        .aff-story-actions {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 8px;
            flex-wrap: wrap;
        }

        .aff-mini-summary {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 12px;
        }

        @media (max-width: 980px) {
            .aff-hero-inner,
            .aff-grid-2 {
                grid-template-columns: 1fr;
            }

            .aff-stat-grid {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }
        }

        @media (max-width: 640px) {
            .aff-hero {
                padding: 22px;
                border-radius: 20px;
            }

            .aff-title {
                font-size: 28px;
            }

            .aff-card {
                padding: 18px;
                border-radius: 18px;
            }

            .aff-card-head,
            .aff-link-main {
                grid-template-columns: 1fr;
                display: grid;
            }

            .aff-link-info {
                align-items: flex-start;
            }

            .aff-link-thumb {
                width: 58px;
                height: 58px;
                border-radius: 14px;
            }

            .aff-stat-grid,
            .aff-form-grid {
                grid-template-columns: 1fr;
            }

            .aff-actions,
            .aff-link-actions {
                display: grid;
                grid-template-columns: 1fr;
                width: 100%;
            }

            .aff-btn {
                width: 100%;
            }

            .aff-rule-row,
            .aff-story-item {
                grid-template-columns: 1fr;
            }

            .aff-story-actions {
                display: grid;
                grid-template-columns: 1fr;
                width: 100%;
            }
        }

.aff-alert.is-warning {
    background: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
}

.aff-mt-6 {
    margin-top: 6px;
}

.aff-actions-tight {
    margin-top: 4px;
}

.aff-mb-16 {
    margin-bottom: 16px;
}

/* =========================
   AFFILIATE CLICK CHART
   Scoped only for /aff page
========================= */

.aff-chart-panel {
    display: grid;
    gap: 16px;
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid #eef2f7;
}

.aff-chart-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: end;
}

.aff-chart-title {
    margin: 0;
    color: #111827;
    font-size: 20px;
    line-height: 1.25;
    font-weight: 950;
}

.aff-chart-desc {
    margin: 6px 0 0;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.6;
}

.aff-date-filter {
    display: flex;
    align-items: end;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.aff-date-filter .aff-field {
    min-width: 150px;
}

.aff-range-shortcuts {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.aff-range-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid #e0e7ff;
    background: #eef2ff;
    color: #4338ca;
    font-size: 13px;
    font-weight: 950;
    text-decoration: none;
    transition: .18s ease;
}

.aff-range-chip:hover {
    background: #e0e7ff;
    color: #312e81;
    text-decoration: none;
}

.aff-chart-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.aff-chart-summary-card {
    display: grid;
    gap: 6px;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
}

.aff-chart-summary-card span {
    color: #6b7280;
    font-size: 12px;
    font-weight: 900;
}

.aff-chart-summary-card strong {
    color: #111827;
    font-size: 24px;
    line-height: 1;
    font-weight: 950;
}


.aff-line-chart {
    position: relative;
    min-height: 310px;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #18212a;
    overflow: hidden;
}

.aff-line-chart::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 8%, rgba(59, 130, 246, .20), transparent 28%),
        linear-gradient(180deg, rgba(15, 23, 42, .20), transparent 45%);
    pointer-events: none;
}

.aff-line-chart-svg {
    position: relative;
    display: block;
    width: 100%;
    height: 310px;
}

.aff-line-chart-grid {
    stroke: rgba(148, 163, 184, .22);
    stroke-width: 1;
}

.aff-line-chart-axis {
    stroke: rgba(148, 163, 184, .34);
    stroke-width: 1;
}

.aff-line-chart-y-label,
.aff-line-chart-x-label {
    fill: rgba(226, 232, 240, .72);
    font-size: 12px;
    font-weight: 800;
}

.aff-line-chart-y-label {
    text-anchor: end;
}

.aff-line-chart-x-label {
    text-anchor: middle;
}

.aff-line-chart-area {
    fill: url(#affClickAreaGradient);
}

.aff-line-chart-line {
    fill: none;
    stroke: #3b82f6;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 8px 14px rgba(59, 130, 246, .32));
}

.aff-line-chart-point {
    fill: #60a5fa;
    stroke: #2563eb;
    stroke-width: 2;
    cursor: pointer;
    transition: .16s ease;
}

.aff-line-chart-point:hover {
    fill: #ffffff;
    stroke: #3b82f6;
    r: 7;
}

.aff-click-detail {
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #ffffff;
    overflow: hidden;
}

.aff-click-detail summary {
    padding: 14px 16px;
    cursor: pointer;
    color: #4f46e5;
    font-weight: 950;
    list-style: none;
}

.aff-click-detail summary::-webkit-details-marker {
    display: none;
}

.aff-click-table-wrap {
    overflow-x: auto;
    border-top: 1px solid #f3f4f6;
}

.aff-click-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 360px;
}

.aff-click-table th,
.aff-click-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    text-align: left;
    color: #374151;
    font-size: 14px;
}

.aff-click-table th {
    background: #f9fafb;
    color: #6b7280;
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.aff-click-table td:last-child,
.aff-click-table th:last-child {
    text-align: right;
    font-weight: 950;
}

@media (max-width: 980px) {
    .aff-chart-top {
        grid-template-columns: 1fr;
    }

    .aff-date-filter {
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .aff-date-filter {
        display: grid;
        grid-template-columns: 1fr;
    }

    .aff-date-filter .aff-field,
    .aff-date-filter .aff-btn {
        width: 100%;
    }

    .aff-chart-summary-grid {
        grid-template-columns: 1fr;
    }

    .aff-line-chart {
        min-height: 250px;
        padding: 10px;
    }

    .aff-line-chart-svg {
        height: 250px;
    }
}
