/* === JOURNAL.CSS === */
/* assets/css/journal.css */
/* НАЗНАЧЕНИЕ: Стилi для повноекранної табличної вкладки "Журнал" */
/* РАЗМЕР: ~220 строк */

.jr-wrap {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 16px 20px;
    box-sizing: border-box;
    overflow: hidden;
}

.jr-head {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--zk-border, #2a2a33);
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.jr-head-left { min-width: 280px; }

.jr-title {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.jr-stats {
    font-size: 12px;
    color: var(--zk-text-muted, #8a8a95);
}

.jr-stats b { color: var(--zk-text, #e8e8ee); font-weight: 600; }
.jr-stat-active { color: #3bd16f !important; }
.jr-stat-overdue { color: #f5a623 !important; }
.jr-stat-expired { color: #e8564b !important; }
.jr-stat-today { color: #4a9eff !important; }

.jr-toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.jr-toolbar .zk-input,
.jr-toolbar .zk-select {
    height: 32px;
    font-size: 13px;
}

.jr-search { min-width: 220px; }

.jr-body {
    flex: 1;
    overflow: auto;
    border: 1px solid var(--zk-border, #2a2a33);
    border-radius: 6px;
    background: var(--zk-bg-panel, #17171e);
}

.jr-loading,
.jr-empty,
.jr-error {
    padding: 40px;
    text-align: center;
    color: var(--zk-text-muted, #8a8a95);
    font-size: 14px;
}
.jr-error { color: #e8564b; }

.jr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
}

.jr-table thead {
    position: sticky;
    top: 0;
    background: var(--zk-bg-panel, #17171e);
    z-index: 10;
}

.jr-table th {
    text-align: left;
    padding: 8px 10px;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--zk-text-muted, #8a8a95);
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--zk-border, #2a2a33);
    white-space: nowrap;
}

.jr-table td {
    padding: 7px 10px;
    border-bottom: 1px solid var(--zk-border-soft, #22222a);
    vertical-align: middle;
    line-height: 1.4;
}

.jr-row {
    cursor: pointer;
    transition: background 0.12s;
}

.jr-row:hover {
    background: var(--zk-bg-hover, rgba(100, 150, 255, 0.06));
}

.jr-group-row {
    background: var(--zk-bg-secondary, #1d1d25);
}

.jr-group-row td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--zk-border, #2a2a33);
}

.jr-group-label {
    font-weight: 700;
    font-size: 12px;
    color: var(--zk-accent, #4a9eff);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.jr-group-count {
    font-size: 11px;
    color: var(--zk-text-muted, #8a8a95);
    margin-left: 6px;
    background: var(--zk-bg-panel, #17171e);
    padding: 1px 6px;
    border-radius: 3px;
}

.jr-date {
    color: var(--zk-text-muted, #8a8a95);
    white-space: nowrap;
    font-size: 11px;
}

.jr-name { font-weight: 500; }

.jr-email {
    color: var(--zk-text-secondary, #b8b8c0);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 220px;
}

.jr-tg {
    color: var(--zk-accent, #4a9eff);
    text-decoration: none;
}
.jr-tg:hover { text-decoration: underline; }

.jr-muted { color: var(--zk-text-muted, #8a8a95); }

.jr-expires { color: var(--zk-text-secondary, #b8b8c0); }

.jr-payments {
    text-align: center;
    color: var(--zk-text-muted, #8a8a95);
    font-size: 11px;
}

.jr-plan-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.jr-plan-base {
    background: rgba(74, 158, 255, 0.12);
    color: #4a9eff;
}

.jr-plan-premium {
    background: rgba(255, 180, 50, 0.12);
    color: #ffb432;
}

.jr-plan-free {
    background: rgba(155, 155, 160, 0.12);
    color: #9e9ea8;
}

.jr-status-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.jr-st-active {
    background: rgba(59, 209, 111, 0.12);
    color: #3bd16f;
}

.jr-st-overdue {
    background: rgba(245, 166, 35, 0.15);
    color: #f5a623;
}

.jr-st-expired {
    background: rgba(232, 86, 75, 0.12);
    color: #e8564b;
}

.jr-st-cancelled {
    background: rgba(155, 155, 160, 0.12);
    color: #9e9ea8;
}

.jr-st-never_paid {
    background: rgba(155, 155, 160, 0.08);
    color: #8a8a95;
}

/* Light theme overrides */
[data-theme="light"] .jr-body { background: #fff; border-color: #e5e7eb; }
[data-theme="light"] .jr-table thead { background: #fff; }
[data-theme="light"] .jr-table th { color: #6b7280; border-color: #e5e7eb; }
[data-theme="light"] .jr-table td { border-color: #f1f2f6; }
[data-theme="light"] .jr-row:hover { background: #f8fafc; }
[data-theme="light"] .jr-group-row { background: #f4f5f9; }
[data-theme="light"] .jr-group-count { background: #fff; }

/* Responsive - на малих екранах ховаємо зайве */
@media (max-width: 900px) {
    .jr-table { font-size: 11px; }
    .jr-table th, .jr-table td { padding: 6px 7px; }
    .jr-payments { display: none; }
    .jr-table th:nth-child(8), .jr-table td:nth-child(8) { display: none; }
}

@media (max-width: 700px) {
    .jr-table th:nth-child(7), .jr-table td:nth-child(7) { display: none; } /* expires */
    .jr-table th:nth-child(5), .jr-table td:nth-child(5) { display: none; } /* plan */
}

/* === Модалка карточки подписчика === */
.jr-modal-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(0,0,0,0.7);
    display: flex; align-items: flex-start; justify-content: center;
    padding: 30px 20px; overflow-y: auto;
    backdrop-filter: blur(4px);
}
.jr-modal {
    position: relative;
    width: 100%; max-width: 1100px;
    background: var(--bg-secondary, #1a1d24);
    border: 1px solid var(--border-color, #2d3139);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.jr-modal-close {
    position: absolute; top: 14px; right: 14px;
    width: 32px; height: 32px;
    border: none; background: transparent;
    color: var(--text-secondary, #9ca3af);
    font-size: 24px; line-height: 1;
    cursor: pointer; border-radius: 6px;
}
.jr-modal-close:hover {
    background: var(--bg-tertiary, #2d3139);
    color: var(--text-primary, #fff);
}
[data-theme="light"] .jr-modal {
    background: #fff; border-color: #e5e7eb;
}
[data-theme="light"] .jr-modal-close { color: #6b7280; }
[data-theme="light"] .jr-modal-close:hover { background: #f1f2f6; color: #111; }
