/*
 * Xila Dashboard CSS
 * File: /wp-content/themes/xila/assets/css/dashboard.css
 *
 * xrs-* = Right Sidebar default view (4 cards, Card 1 tab-based)
 * xtd-* = Today full-page dashboard (unchanged)
 */

/* ------ RIGHT SIDEBAR WRAPPER */

.xrs-dashboard {
    height: 100%;
    overflow-y: auto;
    padding-bottom: 24px;
    scrollbar-width: thin;
    scrollbar-color: #e2e8f0 transparent;
}
.xrs-dashboard::-webkit-scrollbar       { width: 3px; }
.xrs-dashboard::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 3px; }

/* ── Shimmer loading ────────── */
.xrs-loading { padding: 10px; }
.xrs-shim {
    height: 72px;
    background: linear-gradient(90deg, #f1f5f9 25%, #e8edf4 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: xrsShimmer 1.4s infinite;
    border-radius: 10px;
    margin-bottom: 8px;
}
.xrs-shim--tall { height: 180px; }
@keyframes xrsShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Cards container ─────────── */
.xrs-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 10px 0;
}

/* ── Card shell ──────────────── */
.xrs-card {
    background: #fff;
    border: 1px solid #e8edf2;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
    transition: box-shadow .2s;
}
.xrs-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,.08); }

/* ── Card head (gradient bar) ──────────────── */
.xrs-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
}
.xrs-card-icon { font-size: 15px; line-height: 1; flex-shrink: 0; }

/* Title + subtitle stacked */
.xrs-head-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}
.xrs-card-title {
    font-size: 12.5px;
    font-weight: 700;
    color: #fff;
    letter-spacing: .2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.xrs-card-subtitle {
    font-size: 10.5px;
    color: rgba(255,255,255,.65);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* External link icon button */
.xrs-card-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255,255,255,.15);
    color: #fff;
    flex-shrink: 0;
    transition: background .15s;
    text-decoration: none;
}
.xrs-card-link:hover { background: rgba(255,255,255,.28); color: #fff; }

/* ── Card body (simple cards — signals, trending) ────────────── */
.xrs-card-body { padding: 2px 0; }

/* ────────────── TODAY CARD — TAB SYSTEM ────────────── */
/* Tab bar */
.xrs-tabs {
    display: flex;
    background: #f8fafc;
    border-bottom: 1px solid #e8edf2;
    overflow-x: auto;
    scrollbar-width: none;
}
.xrs-tabs::-webkit-scrollbar { display: none; }

.xrs-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 7px 2px;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s;
}
.xrs-tab:hover { color: #2563eb; background: #eff6ff; }
.xrs-tab.is-active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    background: #fff;
    font-weight: 700;
}
.xrs-tab-lbl { font-size: 11px; }

/* Count badge */
.xrs-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 15px;
    height: 15px;
    padding: 0 3px;
    border-radius: 8px;
    background: #2563eb;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
}
.xrs-tab:not(.is-active) .xrs-tab-count {
    background: #e2e8f0;
    color: #64748b;
}

/* Tab panel "see all" footer */
.xrs-panel-foot {
    padding: 5px 12px 7px;
    border-top: 1px solid #f1f5f9;
    text-align: right;
}
.xrs-foot-link {
    font-size: 11px;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
    opacity: .75;
    transition: opacity .1s;
}
.xrs-foot-link:hover { opacity: 1; }

/* ───────────── LISTS (shared by all cards) ───────────── */

.xrs-list { list-style: none; margin: 0; padding: 0; }
.xrs-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 7px 12px;
    border-bottom: 1px solid #f8fafc;
    transition: background .12s;
}
.xrs-item:last-child { border-bottom: none; }
.xrs-item:hover { background: #f8fafc; }

.xrs-item-title {
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.45;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    cursor: pointer;
}
.xrs-item-title:hover { color: #2563eb; }

/* Compact (calendar date detail) */
.xrs-item--compact { flex-direction: row; align-items: center; gap: 6px; }
.xrs-type-icon { font-size: 13px; flex-shrink: 0; }

/* ── Countdown badges ─────────────── */
.xrs-cd {
    display: inline-block;
    align-self: flex-start;
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    white-space: nowrap;
    color: #16a34a;
    background: #dcfce7;
}
.xrs-cd--warn     { color: #d97706; background: #fef3c7; }
.xrs-cd--urgent   { color: #ea580c; background: #ffedd5; }
.xrs-cd--critical { color: #dc2626; background: #fee2e2; animation: xrsPulse 1s infinite; }
.xrs-cd--done     { color: #94a3b8; background: #f1f5f9; }
@keyframes xrsPulse { 0%,100%{ opacity:1; } 50%{ opacity:.5; } }

/* ── Empty state ──────────── */
.xrs-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 14px 12px;
    font-size: 12px;
    color: #94a3b8;
    text-align: center;
}
.xrs-empty-icon { font-size: 22px; opacity: .5; }

/* ── Signals ─────────────────────── */
.xrs-signal-badge {
    display: inline-block;
    align-self: flex-start;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    margin-bottom: 2px;
    background: #eff6ff;
    color: #2563eb;
}
.xrs-signal--critical .xrs-signal-badge { background: #fee2e2; color: #dc2626; }
.xrs-signal--high     .xrs-signal-badge { background: #ffedd5; color: #ea580c; }
.xrs-signal--medium   .xrs-signal-badge { background: #fef3c7; color: #d97706; }
.xrs-signal--info     .xrs-signal-badge { background: #dcfce7; color: #16a34a; }

/* ── Trending ─────────────────────── */
.xrs-trending-item { flex-direction: row; align-items: flex-start; gap: 7px; }
.xrs-trend-rank {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #eff6ff;
    color: #2563eb;
    font-size: 10px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}

/* ───────────── UPCOMING CALENDAR CARD ───────────── */
.xrs-calendar-hint {
    font-size: 11px;
    color: #64748b;
    padding: 5px 12px 4px;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
}
.xrs-calendar-widget { padding: 8px 10px 4px; }

.xrs-cal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
}
.xrs-cal-mname { font-size: 12px; font-weight: 700; color: #1e293b; }

.xrs-cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 1px; }
.xrs-cal-dh   {
    text-align: center;
    font-size: 9px;
    font-weight: 700;
    color: #94a3b8;
    padding: 2px 0 3px;
}
.xrs-cal-day {
    position: relative;
    text-align: center;
    font-size: 11px;
    color: #64748b;
    padding: 3px 0;
    border-radius: 5px;
    line-height: 1.7;
    cursor: default;
}
.xrs-cal-day--today   { background: #eff6ff; color: #2563eb; font-weight: 800; }
.xrs-cal-day--event   {
    color: #1e293b;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid #bfdbfe;
    background: #fff;
}
.xrs-cal-day--event:hover   { background: #eff6ff; }
.xrs-cal-day--selected      { background: #2563eb !important; color: #fff !important; border-color: #2563eb !important; }
.xrs-cal-day--past          { color: #d1d5db; }

.xrs-cal-dot {
    display: block;
    width: 4px; height: 4px;
    background: #2563eb;
    border-radius: 50%;
    margin: 0 auto;
    position: absolute;
    bottom: 2px; left: 50%;
    transform: translateX(-50%);
}
.xrs-cal-day--selected .xrs-cal-dot { background: rgba(255,255,255,.6); }

.xrs-cal-detail-head {
    font-size: 11.5px;
    font-weight: 700;
    color: #2563eb;
    padding: 6px 12px 4px;
    background: #eff6ff;
    border-top: 1px solid #bfdbfe;
}

/* ──────────── RESULT CHECK TAB (inside RC panel) ───────────── */

.xrs-rc-wrap { padding: 8px 12px 4px; }

.xrs-rc-box {
    display: flex;
    align-items: center;
    gap: 7px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
    padding: 7px 12px;
    transition: border-color .15s;
}
.xrs-rc-box:focus-within { border-color: #2563eb; background: #fff; }

.xrs-rc-ico   { color: #94a3b8; flex-shrink: 0; }
.xrs-rc-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 12px;
    color: #1e293b;
    background: transparent;
    min-width: 0;
}
.xrs-rc-input::placeholder { color: #94a3b8; }
.xrs-rc-clear {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 11px;
    color: #94a3b8;
    padding: 0 2px;
    line-height: 1;
}
.xrs-rc-clear:hover { color: #475569; }

.xrs-rc-results { margin-top: 6px; }
.xrs-rc-msg {
    font-size: 11.5px;
    color: #94a3b8;
    padding: 10px 4px;
    text-align: center;
}

.xrs-rc-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 4px;
    border-bottom: 1px solid #f8fafc;
    border-radius: 6px;
    cursor: pointer;
    transition: background .1s;
    user-select: none;
}
.xrs-rc-row:last-child { border-bottom: none; }
.xrs-rc-row:hover      { background: #f8fafc; }

.xrs-rc-row-icon  { font-size: 14px; flex-shrink: 0; }
.xrs-rc-row-title {
    flex: 1;
    font-size: 11.5px;
    font-weight: 600;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.xrs-rc-badge {
    font-size: 9.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    flex-shrink: 0;
    white-space: nowrap;
}
.xrs-rc-badge--yes { background: #dcfce7; color: #16a34a; }
.xrs-rc-badge--no  { background: #fef3c7; color: #d97706; }

/* ───────────── TODAY DASHBOARD FULL PAGE  (xtd-*)  — UNCHANGED ───────────── */

.xtd-page { max-width: 100%; }

.xtd-header {
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    border-radius: 14px;
    padding: 20px 20px 0;
    margin-bottom: 14px;
    overflow: hidden;
}
.xtd-header-inner { display: flex; align-items: center; gap: 14px; padding-bottom: 16px; }
.xtd-header-icon  { font-size: 32px; line-height: 1; }
.xtd-header-title { font-size: 20px; font-weight: 800; color: #fff; margin: 0 0 3px; }
.xtd-header-date  { font-size: 12px; color: rgba(255,255,255,.7); }

.xtd-tabs { display: flex; gap: 3px; overflow-x: auto; scrollbar-width: none; }
.xtd-tabs::-webkit-scrollbar { display: none; }
.xtd-tab {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 8px 14px; font-size: 12.5px; font-weight: 600;
    color: rgba(255,255,255,.7); border-radius: 10px 10px 0 0;
    text-decoration: none; transition: all .15s; white-space: nowrap;
}
.xtd-tab:hover     { color: #fff; background: rgba(255,255,255,.1); }
.xtd-tab.is-active { background: #f8fafc; color: #1e3a5f; }

.xtd-section { background: #fff; border: 1px solid #e8edf2; border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
.xtd-section-title {
    display: flex; align-items: center; gap: 7px;
    padding: 10px 14px; font-size: 13px; font-weight: 700; color: #1e293b;
    background: #f8fafc; border-bottom: 1px solid #e8edf2;
}

.xtd-list { list-style: none; margin: 0; padding: 0; }
.xtd-item {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 14px; border-bottom: 1px solid #f8fafc; transition: background .12s;
}
.xtd-item:last-child { border-bottom: none; }
.xtd-item:hover { background: #f8fafc; }

.xtd-item-num {
    width: 22px; height: 22px; border-radius: 50%;
    background: #eff6ff; color: #2563eb;
    font-size: 11px; font-weight: 800;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.xtd-item-body  { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.xtd-item-title {
    font-size: 13px; font-weight: 600; color: #1e293b;
    text-decoration: none; line-height: 1.4; cursor: pointer;
}
.xtd-item-title:hover { color: #2563eb; }
.xtd-item-cd { display: flex; gap: 6px; }
.xtd-item--compact { align-items: center; padding: 8px 14px; }
.xtd-item-type-icon { font-size: 14px; flex-shrink: 0; }

.xtd-cd {
    font-size: 11px; font-weight: 700; color: #16a34a; background: #dcfce7;
    padding: 2px 8px; border-radius: 20px; white-space: nowrap; display: inline-block;
}
.xtd-cd--urgent   { color: #ea580c; background: #ffedd5; }
.xtd-cd--critical { color: #dc2626; background: #fee2e2; }
.xtd-cd--done     { color: #94a3b8; background: #f1f5f9; }

.xtd-upcoming-list { padding: 8px 0; }
.xtd-date-label {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 14px 5px; background: #f8fafc;
    border-top: 1px solid #f1f5f9; border-bottom: 1px solid #f1f5f9;
}
.xtd-date-str { font-size: 12px; font-weight: 700; color: #1e293b; }
.xtd-days-badge {
    font-size: 10px; font-weight: 700; color: #2563eb; background: #eff6ff;
    padding: 2px 8px; border-radius: 20px;
}

.xtd-signals-list { padding: 6px 0; }
.xtd-signal { padding: 10px 14px; border-bottom: 1px solid #f8fafc; transition: background .12s; }
.xtd-signal:last-child { border-bottom: none; }
.xtd-signal:hover { background: #f8fafc; }
.xtd-signal-row1 { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.xtd-signal-badge {
    font-size: 10.5px; font-weight: 700; padding: 2px 8px;
    border-radius: 20px; background: #eff6ff; color: #2563eb;
}
.xtd-signal--critical .xtd-signal-badge { background: #fee2e2; color: #dc2626; }
.xtd-signal--high     .xtd-signal-badge { background: #ffedd5; color: #ea580c; }
.xtd-signal--medium   .xtd-signal-badge { background: #fef3c7; color: #d97706; }
.xtd-signal--info     .xtd-signal-badge { background: #dcfce7; color: #16a34a; }
.xtd-signal-title {
    font-size: 13px; font-weight: 600; color: #1e293b;
    text-decoration: none; line-height: 1.4; display: block; cursor: pointer;
}
.xtd-signal-title:hover { color: #2563eb; }
.xtd-signal-cd { margin-top: 4px; }

.xtd-empty {
    display: flex; flex-direction: column; align-items: center;
    gap: 8px; padding: 28px 16px; font-size: 13px; color: #94a3b8; text-align: center;
}
.xtd-empty span:first-child { font-size: 28px; opacity: .4; }
.xtd-loading { padding: 40px 16px; text-align: center; }

.xtd-cal-hint {
    display: flex; align-items: flex-start; gap: 8px;
    background: #eff6ff; border: 1px solid #bfdbfe;
    border-radius: 10px; padding: 10px 14px;
    font-size: 12.5px; color: #1e3a5f; margin-bottom: 14px; line-height: 1.5;
}
.xtd-cal-hint-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.xtd-calendar-wrap {
    background: #fff; border: 1px solid #e8edf2;
    border-radius: 12px; padding: 16px; margin-bottom: 14px;
}
.xtd-calendar { max-width: 380px; margin: 0 auto; }
.xtd-cal-month-name {
    text-align: center; font-size: 15px; font-weight: 800; color: #1e293b; margin-bottom: 10px;
}
.xtd-cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 3px; }
.xtd-cal-dh   { text-align: center; font-size: 11px; font-weight: 700; color: #94a3b8; padding: 4px 0; }
.xtd-cal-day  {
    text-align: center; font-size: 13px; color: #64748b;
    padding: 6px 2px; border-radius: 7px;
    position: relative; cursor: default; line-height: 1.4; min-height: 32px;
}
.xtd-cal-day--today     { background: #eff6ff; color: #2563eb; font-weight: 800; }
.xtd-cal-day--has-event { color: #1e293b; font-weight: 700; cursor: pointer; border: 1.5px solid #bfdbfe; background: #fff; }
.xtd-cal-day--has-event:hover { background: #eff6ff; }
.xtd-cal-day--selected  { background: #2563eb !important; color: #fff !important; border-color: #2563eb !important; }
.xtd-cal-day--past      { color: #e2e8f0; }
.xtd-cal-detail {
    background: #fff; border: 1px solid #bfdbfe;
    border-radius: 12px; margin-bottom: 14px; overflow: hidden;
}
.xtd-cal-detail-head {
    padding: 10px 14px; background: #eff6ff;
    font-size: 13px; font-weight: 700; color: #1e3a5f;
    border-bottom: 1px solid #bfdbfe;
}
.xtd-date-items { padding: 4px 0; }

/* ─────────────
   SIDEBAR CARD ITEM — ACTION BUTTONS (काम 2)
   📄 Full Article  +  ⚡ Live Updates
   dashboard.css के END में append करें
   =───────────── */

/* ── xrs-trending-item restructure ────────
   पहले: flex-direction: row (rank + title horizontal)
   अब:   flex-direction: column (rank+title row, फिर buttons)     */
.xrs-trending-item {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0 !important;
}

/* Rank + Title row (trending के लिए) */
.xrs-trending-row1 {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin-bottom: 6px;
}
.xrs-trending-row1 .xrs-trend-rank {
    margin-top: 1px;
    flex-shrink: 0;
}
.xrs-trending-row1 .xrs-item-title {
    flex: 1;
}

/* ── Calendar item row ───────────────── */
.xrs-item--cal {
    flex-direction: column !important;
    gap: 0 !important;
}
.xrs-item-cal-row {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 6px;
}
.xrs-item-cal-row .xrs-type-icon { flex-shrink: 0; margin-top: 2px; }
.xrs-item-cal-row .xrs-item-title { flex: 1; }

/* ── Action Buttons Container ───────────── */
.xrs-item-actions {
    display: flex;
    gap: 5px;
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid #f1f5f9;
}

/* ── Action Button Base ─────────────── */
.xrs-act-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px 9px;
    border-radius: 6px;
    font-size: 10.5px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all .12s;
    white-space: nowrap;
    line-height: 1.3;
    letter-spacing: .1px;
}
.xrs-act-btn:active { transform: scale(.96); }

/* Full Article button */
.xrs-act-btn--article {
    background: #eff6ff;
    color: #2563eb;
    border-color: #bfdbfe;
}
.xrs-act-btn--article:hover {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
    box-shadow: 0 2px 6px rgba(37,99,235,.2);
}

/* Live Updates button */
.xrs-act-btn--updates {
    background: #f0fdf4;
    color: #16a34a;
    border-color: #bbf7d0;
}
.xrs-act-btn--updates:hover {
    background: #16a34a;
    color: #fff;
    border-color: #16a34a;
    box-shadow: 0 2px 6px rgba(22,163,74,.2);
}

/* Count badge inside Live Updates button */
.xrs-act-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    border-radius: 7px;
    background: #16a34a;
    color: #fff;
    font-size: 8.5px;
    font-weight: 800;
    line-height: 1;
}
.xrs-act-btn--updates:hover .xrs-act-count {
    background: rgba(255,255,255,.3);
    color: #fff;
}

/* ── Result Check row actions ─────────────────── */
/* ResultCheck rows के नीचे buttons की wrapper */
.xrs-rc-row-actions {
    padding: 0 4px 6px;
    border-bottom: 1px solid #f8fafc;
    margin-top: -2px;
}
.xrs-rc-row-actions:last-child { border-bottom: none; }
/* इसके अंदर .xrs-item-actions automatically आती है */
.xrs-rc-row-actions .xrs-item-actions {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}