/* ================================================
   Vylia Dashboard – Editorial Light Theme
   Inter · Yellow-green #6366F1
================================================ */

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

:root {
    --bg:         #F8F6F2;
    --bg-card:    #FFFFFF;
    --bg-surface: #F4F2EE;
    --border:     #E8E6E2;
    --border-soft:#EFEDE9;

    --text-primary:   #1A1A1A;
    --text-secondary: #6B6B6B;
    --text-muted:     #ABABAB;

    --accent:       #6366F1;
    --accent-hover: #4F46E5;
    --accent-pale:  rgba(99, 102, 241, 0.10);

    --red:    #DC2626;
    --red-bg: rgba(220, 38, 38, 0.07);

    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md:   0 8px 24px rgba(0, 0, 0, 0.10);
    --shadow-lg:   0 24px 60px rgba(0, 0, 0, 0.14);

    --radius-card: 16px;
    --radius:      10px;
    --radius-sm:   6px;
    --radius-pill: 99px;

    --font: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --top-bar-h: 60px;
}

html { font-size: 14px; scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background:  var(--bg);
    color:       var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing:  antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a      { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: var(--font); }
img    { max-width: 100%; display: block; }

.logo-v    { color: var(--accent); }
.logo-rest { color: var(--text-primary); }
.logo-dot  { color: var(--accent); }

/* ================================================
   LOGIN
================================================ */
.login-body {
    min-height:  100vh;
    display:     flex;
    align-items: center;
    justify-content: center;
    background:  var(--bg);
}

.login-wrapper {
    width:          100%;
    max-width:      400px;
    padding:        24px;
    display:        flex;
    flex-direction: column;
    align-items:    center;
    gap:            16px;
}

.login-card {
    width:         100%;
    background:    var(--bg-card);
    border-radius: var(--radius-card);
    box-shadow:    var(--shadow-md);
    padding:       44px 40px 40px;
}

.login-logo        { text-align: center; margin-bottom: 28px; font-size: 32px; font-weight: 800; letter-spacing: -1px; user-select: none; }
.login-title       { font-size: 19px; font-weight: 700; text-align: center; margin-bottom: 5px; }
.login-subtitle    { font-size: 13px; color: var(--text-muted); text-align: center; margin-bottom: 28px; }
.login-form        { display: flex; flex-direction: column; gap: 14px; }
.form-group        { display: flex; flex-direction: column; gap: 5px; }

.form-group label {
    font-size:      11px;
    font-weight:    600;
    color:          var(--text-muted);
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.form-group input {
    background:    var(--bg-surface);
    border:        1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color:         var(--text-primary);
    font-family:   var(--font);
    font-size:     14px;
    padding:       10px 13px;
    outline:       none;
    transition:    border-color .15s, box-shadow .15s;
    width:         100%;
}
.form-group input::placeholder { color: var(--text-muted); }
.form-group input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }

.btn-login {
    background:    var(--accent);
    border:        none;
    border-radius: var(--radius-sm);
    color:         #fff;
    font-size:     14px;
    font-weight:   700;
    margin-top:    6px;
    padding:       12px;
    transition:    background .15s, box-shadow .15s, transform .1s;
    width:         100%;
}
.btn-login:hover  { background: var(--accent-hover); box-shadow: 0 4px 16px rgba(99,102,241,0.30); }
.btn-login:active { transform: translateY(1px); }

.login-footer { font-size: 12px; color: var(--text-muted); }

/* ================================================
   ALERTS
================================================ */
.alert {
    border-radius: var(--radius-sm);
    font-size:     13px;
    margin-bottom: 14px;
    padding:       10px 14px;
    display:       flex;
    align-items:   center;
    gap:           8px;
}
.alert-error { background: var(--red-bg); border: 1px solid rgba(220,38,38,0.2); color: var(--red); }

/* ================================================
   TOP BAR
================================================ */
.top-bar {
    background:    var(--bg-card);
    border-bottom: 1px solid var(--border);
    height:        var(--top-bar-h);
    display:       flex;
    align-items:   center;
    padding:       0 32px;
    position:      sticky;
    top:           0;
    z-index:       200;
    gap:           40px;
}

.top-bar-logo {
    font-size:      22px;
    font-weight:    800;
    letter-spacing: -0.6px;
    user-select:    none;
    flex-shrink:    0;
}

.top-bar-nav {
    display:  flex;
    align-items: center;
    gap:      4px;
    flex:     1;
}

.nav-link {
    border-radius: var(--radius-pill);
    color:         var(--text-muted);
    font-size:     13.5px;
    font-weight:   500;
    padding:       6px 14px;
    transition:    color .14s, background .14s;
}
.nav-link:hover  { color: var(--text-primary); background: var(--bg-surface); }
.nav-link.active { color: var(--accent); font-weight: 600; }

.top-bar-right {
    display:     flex;
    align-items: center;
    gap:         16px;
    flex-shrink: 0;
    margin-left: auto;
}

.top-bar-user {
    display:     flex;
    align-items: center;
    gap:         8px;
    font-size:   13px;
    font-weight: 500;
    color:       var(--text-secondary);
}

.user-avatar-sm {
    align-items:     center;
    background:      var(--accent);
    border-radius:   50%;
    color:           #fff;
    display:         flex;
    font-size:       11px;
    font-weight:     700;
    height:          30px;
    justify-content: center;
    width:           30px;
}

.logout-link { font-size: 12px; color: var(--text-muted); transition: color .14s; }
.logout-link:hover { color: var(--red); }

/* ================================================
   PAGE CONTENT
================================================ */
.page-content {
    max-width: 1700px;
    margin:    0 auto;
    padding:   28px 32px 72px;
}

/* ================================================
   STATS STRIP
================================================ */
.stats-strip {
    background:    #FFFFFF;
    border-bottom: 1px solid #E8E8E3;
    display:       flex;
    padding:       0 32px;
    width:         100%;
}

.stat-item {
    align-items:    flex-start;
    display:        flex;
    flex:           1;
    flex-direction: column;
    gap:            2px;
    padding:        10px 20px;
}

.stat-item + .stat-item { border-left: 1px solid #E8E8E3; }
.stat-item:first-child   { padding-left: 0; }
.stat-item:last-child    { padding-right: 0; }

.stat-dot { display: none; }

.stat-label {
    color:          var(--text-muted);
    font-size:      11px;
    font-weight:    600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.stat-num {
    color:          var(--text-primary);
    font-size:      32px;
    font-weight:    700;
    letter-spacing: -1px;
    line-height:    1.1;
}

/* ================================================
   PAGE TOOLBAR & FILTER BAR
================================================ */
.page-toolbar {
    align-items:     center;
    display:         flex;
    justify-content: space-between;
    margin-bottom:   20px;
}

.page-title {
    font-size:      21px;
    font-weight:    700;
    letter-spacing: -0.4px;
    color:          var(--text-primary);
}

.btn-new-post {
    align-items:   center;
    background:    var(--accent);
    border:        none;
    border-radius: var(--radius-pill);
    color:         #fff;
    display:       inline-flex;
    font-size:     13px;
    font-weight:   600;
    gap:           5px;
    padding:       9px 18px;
    transition:    background .14s, box-shadow .14s;
}
.btn-new-post:hover { background: var(--accent-hover); box-shadow: 0 4px 14px rgba(99,102,241,0.30); }

.filter-bar {
    align-items:   center;
    display:       flex;
    flex-wrap:     wrap;
    gap:           8px;
    margin-bottom: 28px;
}

.filter-pills {
    align-items: center;
    display:     flex;
    flex:        1;
    flex-wrap:   wrap;
    gap:         2px;
}

.filter-tab {
    background:    transparent;
    border:        none;
    border-radius: var(--radius-pill);
    color:         var(--text-muted);
    cursor:        pointer;
    font-size:     13px;
    font-weight:   500;
    padding:       6px 14px;
    transition:    background .14s, color .14s;
    white-space:   nowrap;
}

.tab-count { font-size: 11.5px; margin-left: 2px; }

.filter-tab.active            { background: var(--accent); color: #fff; font-weight: 600; }
.filter-tab.active .tab-count { color: rgba(255,255,255,0.75); }
.filter-tab:not(.active):hover { background: var(--accent-pale); color: var(--accent); }

.month-select,
.search-input {
    background:    var(--bg-card);
    border:        1.5px solid var(--border);
    border-radius: var(--radius-pill);
    color:         var(--text-secondary);
    font-family:   var(--font);
    font-size:     12.5px;
    height:        34px;
    outline:       none;
    padding:       0 14px;
    transition:    border-color .14s;
}
.search-input { min-width: 200px; }
.month-select:focus,
.search-input:focus { border-color: var(--accent); }

/* ================================================
   AI SETTINGS
================================================ */
.ai-settings-bar {
    align-items:   center;
    color:         var(--text-muted);
    cursor:        pointer;
    display:       inline-flex;
    font-size:     12px;
    gap:           5px;
    margin-bottom: 20px;
    transition:    color .14s;
}
.ai-settings-bar:hover { color: var(--accent); }

/* ================================================
   POSTS GRID
================================================ */
.posts-grid {
    display:               grid;
    grid-template-columns: repeat(3, 1fr);
    gap:                   20px;
    align-items:           stretch;
}

/* ================================================
   POST CARD
================================================ */
.post-card {
    background:     var(--bg-card);
    border:         none;
    border-radius:  var(--radius-card);
    box-shadow:     var(--shadow-card);
    cursor:         pointer;
    display:        flex;
    flex-direction: column;
    overflow:       hidden;
    transition:     transform .2s ease, box-shadow .2s ease;
}

.post-card:hover {
    transform:  translateY(-4px);
    box-shadow: var(--shadow-md);
}

/* Image */
.post-card-image {
    background:  #F0EEE9;
    flex-shrink: 0;
    height:      160px;
    min-height:  160px;
    max-height:  160px;
    overflow:    hidden;
    position:    relative;
}

.post-card-image img {
    display:    block;
    height:     100%;
    object-fit: cover;
    object-position: center;
    transition: transform .35s ease;
    width:      100%;
}
.post-card:hover .post-card-image img { transform: scale(1.04); }

.post-image-placeholder {
    align-items:     center;
    color:           #C8C4BC;
    display:         flex;
    flex-direction:  column;
    gap:             6px;
    height:          100%;
    justify-content: center;
}
.post-image-placeholder svg { height: 32px; width: 32px; }

/* Status badge */
.status-badge {
    border-radius:  var(--radius-pill);
    font-size:      10px;
    font-weight:    700;
    letter-spacing: 0.4px;
    padding:        3px 9px;
    position:       absolute;
    right:          10px;
    text-transform: uppercase;
    top:            10px;
    z-index:        2;
}

.badge-yellow { background: #6366F1; color: #000; }
.badge-green  { background: #6366F1; color: #000; }
.badge-blue   { background: rgba(59,130,246,0.90); color: #fff; }
.badge-red    { background: rgba(220,38,38,0.90);  color: #fff; }
.badge-gray   { background: rgba(107,114,128,0.90);color: #fff; }

/* Hover action overlay */
.card-hover-actions {
    align-items:  flex-end;
    background:   linear-gradient(to top, rgba(0,0,0,0.50) 0%, transparent 100%);
    bottom:       0;
    display:      flex;
    gap:          6px;
    left:         0;
    opacity:      0;
    padding:      12px 10px;
    position:     absolute;
    right:        0;
    top:          0;
    transition:   opacity .2s ease;
}
.post-card:hover .card-hover-actions { opacity: 1; }

.card-hover-btn {
    background:    rgba(255,255,255,0.95);
    border:        none;
    border-radius: var(--radius-pill);
    color:         #1A1A1A;
    font-size:     11.5px;
    font-weight:   600;
    padding:       5px 12px;
    transition:    background .14s, transform .1s;
}
.card-hover-btn:hover  { background: #fff; }
.card-hover-btn:active { transform: scale(0.97); }

.card-hover-btn.approve {
    background: var(--accent);
    color:      #000;
}
.card-hover-btn.approve:hover { background: var(--accent-hover); }

/* Card body */
.post-card-body { flex: 1; padding: 14px 16px 10px; }

.post-card-title {
    color:              var(--text-primary);
    display:            -webkit-box;
    font-size:          13px;
    font-weight:        700;
    letter-spacing:     -0.1px;
    line-height:        1.45;
    margin-bottom:      6px;
    overflow:           hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.post-card-text {
    color:              var(--text-secondary);
    display:            -webkit-box;
    font-size:          12px;
    line-height:        1.6;
    overflow:           hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

/* Card footer */
.post-card-footer {
    align-items:     center;
    border-top:      1px solid var(--border-soft);
    display:         flex;
    justify-content: space-between;
    margin-top:      auto;
    padding:         9px 16px;
}

.post-card-tokens { color: var(--text-muted); font-size: 11px; }
.post-card-date   { color: var(--text-muted); font-size: 11px; }

/* Card action buttons */
.post-actions {
    border-top:            1px solid var(--border-soft);
    display:               grid;
    grid-template-columns: repeat(4, 1fr);
    gap:                   5px;
    padding:               10px 12px;
}

.post-actions button {
    background:    var(--bg-card);
    border:        1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color:         var(--text-secondary);
    font-family:   var(--font);
    font-size:     11.5px;
    font-weight:   500;
    overflow:      hidden;
    padding:       7px 4px;
    text-overflow: ellipsis;
    transition:    background .14s, color .14s, border-color .14s;
    white-space:   nowrap;
    width:         100%;
}

.post-actions button:hover {
    background:    var(--bg-surface);
    border-color:  #C8C8C0;
    color:         var(--text-primary);
}

.post-actions .btn-card-approve {
    background:   var(--accent);
    border-color: var(--accent);
    color:        #fff;
    font-weight:  700;
}
.post-actions .btn-card-approve:hover {
    background:   var(--accent-hover);
    border-color: var(--accent-hover);
}

/* ================================================
   EMPTY STATE
================================================ */
.empty-state {
    grid-column:    1 / -1;
    align-items:    center;
    background:     var(--bg-card);
    border-radius:  var(--radius-card);
    box-shadow:     var(--shadow-card);
    display:        flex;
    flex-direction: column;
    gap:            8px;
    padding:        80px 24px;
    text-align:     center;
}
.empty-state h3 { font-size: 16px; font-weight: 600; }
.empty-state p  { color: var(--text-muted); font-size: 13px; }

/* ================================================
   DETAIL MODAL
================================================ */
.detail-overlay {
    align-items:            center;
    backdrop-filter:        blur(8px);
    -webkit-backdrop-filter:blur(8px);
    background:             rgba(30, 28, 24, 0.55);
    inset:                  0;
    justify-content:        center;
    padding:                32px;
    position:               fixed;
    z-index:                500;
}

.detail-modal {
    background:     var(--bg-card);
    border:         none;
    border-radius:  var(--radius-card);
    box-shadow:     var(--shadow-lg);
    display:        flex;
    flex-direction: column;
    max-height:     90vh;
    max-width:      940px;
    overflow:       hidden;
    width:          100%;
}

.detail-header {
    align-items:     center;
    border-bottom:   1px solid var(--border-soft);
    display:         flex;
    flex-shrink:     0;
    gap:             12px;
    justify-content: space-between;
    padding:         20px 28px;
}

.detail-header h2 {
    color:         var(--text-primary);
    font-size:     16px;
    font-weight:   700;
    letter-spacing:-0.2px;
    line-height:   1.3;
    overflow:      hidden;
    text-overflow: ellipsis;
    white-space:   nowrap;
}

.detail-close {
    align-items:     center;
    background:      none;
    border:          none;
    border-radius:   var(--radius-sm);
    color:           var(--text-muted);
    display:         flex;
    flex-shrink:     0;
    font-size:       22px;
    height:          32px;
    justify-content: center;
    line-height:     1;
    padding:         0;
    transition:      color .14s, background .14s;
    width:           32px;
}
.detail-close:hover { background: var(--bg-surface); color: var(--text-primary); }

.detail-body {
    display:    flex;
    flex:       1;
    min-height: 0;
    overflow-y: auto;
}

.detail-left {
    border-right:   1px solid var(--border-soft);
    display:        flex;
    flex:           1;
    flex-direction: column;
    gap:            16px;
    min-width:      0;
    overflow-y:     auto;
    padding:        24px 28px;
}

.detail-right {
    display:        flex;
    flex-direction: column;
    flex-shrink:    0;
    gap:            10px;
    padding:        24px 22px;
    width:          236px;
}

.detail-textarea {
    background:    var(--bg-surface);
    border:        1.5px solid var(--border);
    border-radius: var(--radius);
    color:         var(--text-primary);
    font-family:   var(--font);
    font-size:     13.5px;
    line-height:   1.75;
    min-height:    210px;
    outline:       none;
    padding:       14px 16px;
    resize:        vertical;
    transition:    border-color .15s;
    width:         100%;
}
.detail-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,0.10); }

.detail-hashtags { display: flex; flex-wrap: wrap; gap: 6px; }

.hashtag-pill {
    background:    var(--accent-pale);
    border:        1px solid rgba(99,102,241,0.20);
    border-radius: var(--radius-pill);
    color:         var(--accent-hover);
    font-size:     12px;
    font-weight:   500;
    padding:       3px 12px;
}

.detail-token-bar { display: flex; flex-direction: column; gap: 5px; }

#detail-token-label { color: var(--text-muted); font-size: 12px; }

.token-track {
    background:    var(--border);
    border-radius: 99px;
    height:        5px;
    overflow:      hidden;
    width:         100%;
}

.token-fill {
    background:    var(--accent);
    border-radius: 99px;
    height:        100%;
    transition:    width .2s, background .2s;
    width:         0%;
}

.detail-meta-row {
    align-items: flex-start;
    border-top:  1px solid var(--border-soft);
    display:     flex;
    flex-wrap:   wrap;
    gap:         20px;
    padding-top: 16px;
}

.detail-meta-label {
    align-items:    center;
    color:          var(--text-muted);
    display:        flex;
    font-size:      10.5px;
    font-weight:    600;
    gap:            5px;
    letter-spacing: 0.5px;
    margin-bottom:  6px;
    text-transform: uppercase;
}

.detail-select {
    background:    var(--bg-surface);
    border:        1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color:         var(--text-primary);
    font-family:   var(--font);
    font-size:     13px;
    outline:       none;
    padding:       7px 10px;
    transition:    border-color .15s;
    width:         100%;
}
.detail-select:focus { border-color: var(--accent); }

.detail-schedule { width: 100%; margin-top: 4px; }
.detail-created  { color: var(--text-muted); font-size: 11.5px; margin-top: auto; padding-top: 20px; }

.detail-section-title {
    align-items:   center;
    color:         var(--text-primary);
    display:       flex;
    font-size:     13px;
    font-weight:   700;
    gap:           7px;
    margin-bottom: 10px;
}

.comment-input-row { display: flex; gap: 8px; }

.comment-textarea {
    background:    var(--bg-surface);
    border:        1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color:         var(--text-primary);
    flex:          1;
    font-family:   var(--font);
    font-size:     13px;
    min-height:    64px;
    outline:       none;
    padding:       9px 12px;
    resize:        none;
    transition:    border-color .15s;
}
.comment-textarea::placeholder { color: var(--text-muted); }
.comment-textarea:focus        { border-color: var(--accent); }

.btn-comment-post {
    align-self:    flex-end;
    background:    var(--accent);
    border:        none;
    border-radius: var(--radius-sm);
    color:         #fff;
    font-size:     13px;
    font-weight:   700;
    padding:       9px 18px;
    transition:    background .14s;
    white-space:   nowrap;
}
.btn-comment-post:hover { background: var(--accent-hover); }

.no-comments { color: var(--text-muted); font-size: 12.5px; padding: 4px 0; }

.comment-item {
    align-items:           baseline;
    border-top:            1px solid var(--border-soft);
    display:               grid;
    font-size:             12.5px;
    gap:                   6px;
    grid-template-columns: auto 1fr auto;
    padding:               8px 0;
}
.comment-author { color: var(--text-primary); font-weight: 600; white-space: nowrap; }
.comment-text   { color: var(--text-secondary); }
.comment-time   { color: var(--text-muted); font-size: 11px; white-space: nowrap; }

.activity-section { border-top: 1px solid var(--border-soft); margin-top: 12px; padding-top: 12px; }

.activity-label {
    color:          var(--text-muted);
    font-size:      10.5px;
    font-weight:    700;
    letter-spacing: 0.6px;
    margin-bottom:  8px;
    text-transform: uppercase;
}

.activity-item {
    align-items: baseline;
    color:       var(--text-secondary);
    display:     flex;
    font-size:   12px;
    gap:         7px;
    padding:     4px 0;
}
.activity-dot  { background: var(--accent); border-radius: 50%; display: inline-block; flex-shrink: 0; height: 6px; margin-top: 4px; width: 6px; }
.activity-by   { color: var(--text-muted); }
.activity-time { color: var(--text-muted); margin-left: auto; white-space: nowrap; }

.detail-image-box {
    background:    var(--bg-surface);
    border:        1.5px solid var(--border);
    border-radius: var(--radius);
    height:        180px;
    overflow:      hidden;
    position:      relative;
    width:         100%;
}

.detail-image-box img {
    cursor:     zoom-in;
    height:     100%;
    object-fit: cover;
    transition: transform .3s;
    width:      100%;
}
.detail-image-box img:hover { transform: scale(1.03); }

.detail-image-placeholder {
    align-items:     center;
    color:           #C8C4BC;
    display:         flex;
    flex-direction:  column;
    font-size:       12px;
    gap:             6px;
    height:          100%;
    justify-content: center;
}
.detail-image-placeholder svg { height: 32px; width: 32px; }

.btn-upload-img,
.btn-delete-img {
    align-items:     center;
    border-radius:   var(--radius-sm);
    display:         flex;
    font-size:       12.5px;
    font-weight:     500;
    gap:             6px;
    justify-content: center;
    padding:         8px 12px;
    transition:      background .14s, border-color .14s;
    width:           100%;
}

.btn-upload-img { background: var(--bg-surface); border: 1.5px solid var(--border); color: var(--text-secondary); }
.btn-upload-img:hover { border-color: var(--accent); color: var(--accent); }

.btn-delete-img { background: var(--red-bg); border: 1.5px solid rgba(220,38,38,0.18); color: var(--red); }
.btn-delete-img:hover { background: rgba(220,38,38,0.12); }

/* Detail action buttons */
.detail-actions {
    border-top:  1px solid var(--border-soft);
    display:     flex;
    flex-shrink: 0;
    flex-wrap:   wrap;
    gap:         6px;
    padding:     14px 22px;
    background:  var(--bg-surface);
}

.modal-btn {
    align-items:   center;
    border:        1.5px solid transparent;
    border-radius: var(--radius-pill);
    display:       inline-flex;
    font-size:     12px;
    font-weight:   500;
    gap:           5px;
    height:        30px;
    padding:       0 13px;
    transition:    background .14s, border-color .14s, box-shadow .14s;
    white-space:   nowrap;
}

.btn-green         { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.btn-green:hover   { background: var(--accent-hover); box-shadow: 0 0 14px rgba(99,102,241,0.30); }

.btn-outline-green       { background: transparent; border-color: var(--accent); color: var(--accent); }
.btn-outline-green:hover { background: var(--accent-pale); }

.btn-outline       { background: var(--bg-card); border-color: var(--border); color: var(--text-secondary); }
.btn-outline:hover { border-color: #999; color: var(--text-primary); }

.btn-red           { background: var(--red-bg); border-color: rgba(220,38,38,0.2); color: var(--red); }
.btn-red:hover     { background: rgba(220,38,38,0.12); }


.btn-spinner {
    display:       inline-block;
    width:         11px;
    height:        11px;
    border:        2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation:     btn-spin .65s linear infinite;
    flex-shrink:   0;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

.modal-btn:disabled,
.post-actions button:disabled {
    opacity: .65;
    cursor:  not-allowed;
    pointer-events: none;
}

/* ================================================
   LIGHTBOX
================================================ */
#lightbox {
    align-items:            center;
    backdrop-filter:        blur(10px);
    -webkit-backdrop-filter:blur(10px);
    background:             rgba(0, 0, 0, 0.88);
    cursor:                 zoom-out;
    display:                none;
    inset:                  0;
    justify-content:        center;
    padding:                32px;
    position:               fixed;
    z-index:                9998;
}
#lightbox.open { display: flex; }

#lightbox img {
    border-radius: 12px;
    box-shadow:    0 32px 80px rgba(0,0,0,0.6);
    cursor:        default;
    max-height:    88vh;
    max-width:     90vw;
    object-fit:    contain;
}

.lightbox-close {
    align-items:     center;
    background:      rgba(255,255,255,0.12);
    border:          none;
    border-radius:   50%;
    color:           #fff;
    cursor:          pointer;
    display:         flex;
    font-size:       20px;
    height:          40px;
    justify-content: center;
    position:        absolute;
    right:           28px;
    top:             24px;
    transition:      background .15s;
    width:           40px;
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); }

/* ================================================
   TOAST
================================================ */
.toast {
    background:     var(--bg-card);
    border:         1px solid var(--border);
    border-radius:  var(--radius);
    bottom:         28px;
    box-shadow:     var(--shadow-md);
    color:          var(--text-primary);
    font-size:      13px;
    font-weight:    500;
    max-width:      340px;
    opacity:        0;
    padding:        11px 18px;
    pointer-events: none;
    position:       fixed;
    right:          28px;
    transform:      translateY(10px);
    transition:     opacity .22s, transform .22s;
    z-index:        9999;
}
.toast.toast-show    { opacity: 1; transform: translateY(0); }
.toast.toast-success { border-color: rgba(99,102,241,0.45); color: var(--accent-hover); }
.toast.toast-error   { border-color: rgba(220,38,38,0.3); color: var(--red); max-width: 460px; }
.toast-detail {
    font-size:   11px;
    font-weight: 400;
    margin-top:  5px;
    max-height:  80px;
    opacity:     0.8;
    overflow-y:  auto;
    white-space: pre-wrap;
    word-break:  break-all;
}

/* ================================================
   RESPONSIVE
================================================ */
@media (max-width: 900px) {
    .posts-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-strip { flex-wrap: wrap; }
}
@media (max-width: 768px) {
    .posts-grid   { grid-template-columns: 1fr; }
    .page-content { padding: 20px 16px 60px; }
    .detail-body  { flex-direction: column; }
    .detail-right { width: 100%; border-top: 1px solid var(--border-soft); }
    .top-bar-nav  { display: none; }
}
