/* ══════════════════════════════════════
   goFindMyTickets — Main Stylesheet
   ══════════════════════════════════════ */

/* ── Theme Custom Properties ── */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #111118;
    --bg-tertiary: #08080d;
    --bg-overlay: #0a0a0fee;
    --border-primary: #1e1e2e;
    --border-secondary: #1a1a2a;
    --border-input: #2a2a3a;
    --text-primary: #e0e0e0;
    --text-secondary: #999;
    --text-muted: #666;
    --text-dimmed: #555;
    --text-faint: #444;
    --text-white: #fff;
    --accent-orange: #f97316;
    --accent-green: #22c55e;
    --accent-red: #ef4444;
    --accent-blue: #0ea5e9;
    --card-bg: #111118;
    --input-bg: #111118;
}

:root[data-theme="light"] {
    --bg-primary: #f5f5f7;
    --bg-secondary: #ffffff;
    --bg-tertiary: #eaeaef;
    --bg-overlay: #f5f5f7ee;
    --border-primary: #d1d1d6;
    --border-secondary: #e0e0e5;
    --border-input: #c7c7cc;
    --text-primary: #1c1c1e;
    --text-secondary: #555;
    --text-muted: #777;
    --text-dimmed: #888;
    --text-faint: #aaa;
    --text-white: #000;
    --card-bg: #ffffff;
    --input-bg: #f0f0f5;
}

/* ── Accessibility Focus Styles ── */
*:focus-visible {
    outline: 2px solid var(--accent-orange);
    outline-offset: 2px;
}
*:focus:not(:focus-visible) {
    outline: none;
}

/* ── Base Reset ── */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100dvh;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0.6rem;
    padding-bottom: 4rem; /* space for bottom nav */
}

/* ── Header ── */
header {
    padding: 0.5rem 0 0.3rem;
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

header h1 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-white);
    letter-spacing: -0.02em;
}

header h1 span { color: #f97316; }

.header-actions {
    display: flex;
    gap: 0.3rem;
}

.header-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.header-btn:active { background: var(--border-secondary); color: var(--text-white); }

/* ── User greeting ── */
.user-greeting {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0;
    font-size: 0.75rem;
}

.user-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f97316, #fb923c);
    color: #000;
    font-weight: 700;
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-name {
    color: var(--text-secondary);
    font-weight: 500;
    flex: 1;
}

.user-logout {
    color: var(--text-faint);
    cursor: pointer;
    text-decoration: none;
    font-size: 0.7rem;
    transition: color 0.15s;
}
.user-logout:hover, .user-logout:active { color: var(--accent-red); }

/* ── Monitor Panel (hero) ── */
.monitor-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 0.8rem;
    margin-bottom: 0.8rem;
    overflow: hidden;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.monitor-panel.active {
    border-color: #22c55e33;
    box-shadow: 0 0 40px #22c55e08, inset 0 1px 0 #22c55e15;
}

.monitor-panel.has-alert {
    border-color: #f9731655;
    box-shadow: 0 0 40px #f973160d, inset 0 1px 0 #f9731620;
}

.monitor-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.monitor-badges {
    display: flex;
    gap: 0.3rem;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.monitor-status-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #333;
    flex-shrink: 0;
}

.status-dot.running {
    background: #22c55e;
    animation: pulse 2s infinite;
}

.status-dot.alert {
    background: #f97316;
    animation: pulse 0.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.monitor-status-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex: 1;
}

.monitor-status-text strong {
    color: var(--text-white);
    font-weight: 600;
}

.telegram-badge {
    font-size: 0.7rem;
    color: #0ea5e9;
    background: #0ea5e911;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    white-space: nowrap;
}

/* Big CTA button */
.btn-cta {
    display: block;
    width: 100%;
    padding: 0.65rem;
    border: none;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}

.btn-cta.start {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
}

.btn-cta.start:active { transform: scale(0.98); }

.btn-cta.stop {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
}

.btn-cta.stop:active { transform: scale(0.98); }

.monitor-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-secondary);
    font-size: 0.7rem;
}

.monitor-stat { text-align: center; }
.monitor-stat .val { color: var(--text-white); font-weight: 600; font-size: 0.85rem; }
.monitor-stat .lbl { color: var(--text-dimmed); margin-top: 0.05rem; font-size: 0.6rem; }

/* Alerts */
.alert-item {
    background: #1a0f00;
    border: 1px solid #f9731644;
    border-radius: 10px;
    padding: 0.8rem;
    margin-top: 0.6rem;
    font-size: 0.85rem;
    overflow: hidden;
    word-break: break-word;
}

.alert-item .alert-text { color: #f97316; font-weight: 600; }
.alert-item a { color: #fb923c; display: inline-block; margin-top: 0.3rem; word-break: break-all; }

/* Logs */
.log-container {
    background: var(--bg-tertiary);
    border: 1px solid #141420;
    border-radius: 10px;
    max-height: 150px;
    overflow-y: auto;
    margin-top: 0.6rem;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.72rem;
    line-height: 1.7;
    -webkit-overflow-scrolling: touch;
}

.log-container:empty { display: none; }

.ticket-result {
    background: #0d1a0d;
    border: 1px solid #22c55e44;
    border-radius: 10px;
    padding: 0.8rem;
    margin-top: 0.5rem;
}

.ticket-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.ticket-result .ticket-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #22c55e;
    flex: 1;
    min-width: 0;
}

.ticket-remove-btn {
    background: none;
    border: 1px solid #333;
    color: var(--text-dimmed);
    width: 28px;
    height: 28px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
}
.ticket-remove-btn:active { color: #ef4444; border-color: #ef4444; }

.ticket-result .ticket-detail {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.ticket-result a {
    display: inline-block;
    margin-top: 0.4rem;
    background: #22c55e;
    color: #000;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    text-decoration: none;
}

.ticket-result a:active { transform: scale(0.97); }

.ticket-results-empty {
    text-align: center;
    padding: 0.8rem;
    font-size: 0.8rem;
    color: var(--text-faint);
}

.log-toggle {
    margin-top: 0.6rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-faint);
    cursor: pointer;
    padding: 0.4rem;
}

.log-toggle:active { color: var(--text-muted); }

.log-line {
    padding: 0.15rem 0.6rem;
    border-bottom: 1px solid #0e0e18;
    word-break: break-word;
    overflow-wrap: break-word;
}

.log-line .log-time { color: var(--text-faint); }
.log-line .log-msg { color: #777; }
.log-line.error .log-msg { color: #ef4444; }
.log-line.alert .log-msg { color: #f97316; font-weight: 600; }
.log-line.success .log-msg { color: #22c55e; }

/* ── Section title ── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}

.section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-dimmed);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-cleanup {
    background: none;
    border: 1px solid #333;
    color: var(--text-muted);
    border-radius: 8px;
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    cursor: pointer;
}
.btn-cleanup:active { border-color: #f97316; color: #f97316; }
.btn-cleanup:disabled { opacity: 0.4; }

.btn-add {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 0.45rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s;
    box-shadow: 0 2px 6px #f9731625;
}

.btn-add:active { transform: scale(0.96); box-shadow: none; }

/* ── Event Cards ── */
.events-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.event-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    padding: 0.7rem 0.8rem;
    overflow: hidden;
}

.event-card.inactive { opacity: 0.4; }

.event-top {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.event-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-white);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.badge {
    padding: 0.1rem 0.4rem;
    border-radius: 20px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}

.badge-active { background: #052e16; color: #22c55e; }
.badge-paused { background: #1c1917; color: var(--text-muted); }

.event-info {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem 0.6rem;
    margin-top: 0.25rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    overflow: hidden;
}

.event-info span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.event-info a { color: #f97316; text-decoration: none; word-break: break-all; }

.event-actions-row {
    display: flex;
    gap: 0.3rem;
    margin-top: 0.5rem;
}

.event-actions-row .btn-ticket,
.event-actions-row .btn-edit-sm,
.event-actions-row .btn-del-direct {
    flex: 1;
    border-radius: 8px;
    padding: 0.4rem 0.3rem;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-align: center;
    text-decoration: none;
}

.btn-edit-sm {
    background: var(--bg-primary);
    border: 1px solid var(--border-primary) !important;
    color: var(--text-muted);
}
.btn-edit-sm:active { color: var(--text-white); }

.btn-del-direct {
    background: #1a0a0a;
    border: 1px solid #ef444433 !important;
    color: #ef4444;
}
.btn-del-direct:active { background: #ef4444; color: #fff; }

.empty-state {
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem 0 0.5rem;
    grid-column: 1 / -1;
}

.page-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-input);
    color: #ccc;
    border-radius: 10px;
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.15s;
}

.page-btn:active { background: var(--border-secondary); border-color: #f97316; }
.page-btn:disabled { opacity: 0.3; cursor: default; }

.page-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.pagination-sm {
    padding: 0.5rem 0 0.2rem;
}

.page-btn-sm {
    width: 34px;
    height: 34px;
    font-size: 0.9rem;
}

/* ── Form (modal overlay on mobile) ── */
.form-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 50;
    background: var(--bg-overlay);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.form-overlay.open { display: block; }

.form-inner {
    max-width: 500px;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
}

.form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.2rem;
}

.form-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-white);
}

.btn-close {
    background: none;
    border: 1px solid #333;
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close:active { background: #222; }

.form-stack {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.form-group label {
    font-size: 0.78rem;
    color: #777;
    font-weight: 500;
}

.form-group input {
    background: var(--input-bg);
    border: 1px solid var(--border-input);
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
}

.form-group input:focus { border-color: #f97316; }
.form-group input::placeholder { color: #3a3a4a; }
.form-group .hint { font-size: 0.7rem; color: var(--text-faint); }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem;
}

.btn-submit {
    display: block;
    width: 100%;
    margin-top: 0.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 12px #f9731630;
}

.btn-submit:active { transform: scale(0.98); box-shadow: 0 2px 6px #f9731620; }

/* ── Scheduler toggle link ── */
.sched-toggle-link {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.4rem;
    font-size: 0.7rem;
    color: var(--text-faint);
    cursor: pointer;
    padding: 0.3rem 0;
}
.sched-toggle-link:active { color: var(--accent-orange); }

/* ── Scheduler ── */
.scheduler {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: 8px;
    transition: border-color 0.2s, background 0.2s;
}

.scheduler.scheduled {
    border-color: #f9731644;
    background: #12100a;
}

.sched-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.4rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

.sched-controls {
    display: flex;
    gap: 0.5rem;
}

.sched-input {
    flex: 1;
    min-width: 0;
    background: var(--input-bg);
    border: 1px solid var(--border-input);
    border-radius: 10px;
    padding: 0.65rem 0.7rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    -webkit-appearance: none;
}

.sched-input:focus { border-color: #f97316; }

.sched-btn {
    background: #f97316;
    color: #000;
    border: none;
    border-radius: 10px;
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.sched-btn.active {
    background: #ef4444;
    color: #fff;
}

.sched-btn:active { transform: scale(0.96); }

.sched-countdown {
    margin-top: 0.7rem;
    text-align: center;
    font-size: 1.6rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #f97316;
    letter-spacing: 2px;
}

.sched-countdown .sched-sub {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-dimmed);
    letter-spacing: 0;
    margin-top: 0.15rem;
}

/* ── Bottom Navigation ── */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 45;
    display: flex;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-primary);
    padding-bottom: env(safe-area-inset-bottom);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: color-mix(in srgb, var(--bg-secondary) 85%, transparent);
}
.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.45rem 0 0.35rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-dimmed);
    transition: color 0.2s;
    position: relative;
}
.nav-item.active {
    color: var(--accent-orange, #f97316);
}
.nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 2px;
    background: var(--accent-orange, #f97316);
    border-radius: 0 0 2px 2px;
}
.nav-icon-svg { width: 20px; height: 20px; }
.nav-label { font-size: 0.6rem; font-weight: 600; letter-spacing: 0.3px; }

/* ── Event card: Billets button ── */
.btn-ticket {
    display: block;
    background: #22c55e;
    color: #000;
    text-decoration: none;
    font-weight: 700;
}
.btn-ticket:active { opacity: 0.8; }

/* ── Event card: More button (dropdown) ── */
.btn-more {
    display: none;
}

/* ── Event card: Dropdown menu ── */
.event-menu {
    background: var(--bg-secondary, #111118);
    border: 1px solid var(--border-primary, #1e1e2e);
    border-radius: 12px;
    margin-top: 0.5rem;
    overflow: hidden;
}
.event-menu button {
    display: block;
    width: 100%;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border-secondary, #1a1a2a);
    color: var(--text-primary, #e0e0e0);
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
    text-align: left;
    cursor: pointer;
}
.event-menu button:last-child { border-bottom: none; }
.event-menu button:active { background: var(--bg-tertiary, #08080d); }
.event-menu .btn-del { color: var(--accent-red, #ef4444); }

/* ── Compact monitor (inactive state on mobile only) ── */
@media (max-width: 959px) {
    .monitor-panel.compact .scheduler,
    .monitor-panel.compact .monitor-stats,
    .monitor-panel.compact #ticketResults,
    .monitor-panel.compact .log-toggle,
    .monitor-panel.compact .log-container {
        display: none;
    }
}

/* ── Toast ── */
.toast {
    position: fixed;
    bottom: 5rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 14px;
    padding: 0.75rem 1.4rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: #22c55e;
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 100;
    white-space: nowrap;
    max-width: 90vw;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    backdrop-filter: blur(8px);
}

.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.error { color: #ef4444; border-color: #ef444433; }

/* ── Tabs ── */
.tabs-container {
    margin-bottom: 0.5rem;
}

.tabs {
    display: none;
    gap: 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-primary);
}

.tab {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-dimmed);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.8rem 0.5rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab.active {
    color: #f97316;
    border-bottom-color: #f97316;
}

.tab:active { color: #fb923c; }

.tab-desc {
    font-size: 0.72rem;
    color: var(--text-dimmed);
    margin-bottom: 0.3rem;
}

.tab-content {
    min-height: 150px;
    transition: opacity 0.25s ease;
}

/* ── AI Search ── */
.search-section {
    margin-bottom: 1.2rem;
}

.search-hero {
    text-align: center;
    padding: 0.6rem 0 0.5rem;
}

.search-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-white);
    letter-spacing: -0.02em;
    margin-bottom: 0.15rem;
}

.search-subtitle {
    font-size: 0.72rem;
    color: var(--text-dimmed);
}

.search-bar {
    display: flex;
    gap: 0.5rem;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 0.85rem;
    color: var(--text-faint);
    pointer-events: none;
    transition: color 0.2s;
}

.search-input-wrapper:focus-within .search-icon {
    color: #f97316;
}

.search-input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border-input);
    border-radius: 10px;
    padding: 0.6rem 0.8rem 0.6rem 2.2rem;
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
    -webkit-appearance: none;
    transition: border-color 0.2s;
}

.search-input:focus { border-color: #f97316; }
.search-input::placeholder { color: #3a3a4a; }

.search-btn {
    background: #f97316;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: transform 0.15s;
}

.search-btn:active { transform: scale(0.97); }
.search-btn:disabled { opacity: 0.5; }

.search-btn-icon { display: none; }
.search-btn-text { display: inline; }

@media (max-width: 420px) {
    .search-btn { padding: 0.6rem 0.8rem; }
    .search-btn-icon { display: inline; }
    .search-btn-text { display: none; }
}

.search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.search-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #333;
    border-top-color: #f97316;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.search-result-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 14px;
    padding: 1rem;
    margin-top: 0.7rem;
    transition: border-color 0.2s;
}

.search-result-card .result-artist {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-white);
    line-height: 1.3;
}

.search-result-card .result-venue {
    font-size: 0.82rem;
    color: #f97316;
    margin-top: 0.25rem;
}

.search-result-card .result-dates {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.search-result-card .result-status {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    margin-top: 0.4rem;
}

.result-status.en_vente { background: #052e16; color: #22c55e; }
.result-status.prevente { background: #1a1600; color: #eab308; }
.result-status.bientot { background: var(--bg-secondary); color: var(--text-muted); border: 1px solid #333; }
.result-status.complet { background: #1a0000; color: #ef4444; }

.search-result-card .result-urls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.5rem;
}

.search-result-card .result-urls a {
    font-size: 0.75rem;
    color: #0ea5e9;
    text-decoration: none;
    background: #0a1520;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
}

.search-result-card .btn-add-result {
    display: block;
    width: 100%;
    margin-top: 0.7rem;
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 0.7rem;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 2px 8px #f9731625;
}

.search-result-card .btn-add-result:active { transform: scale(0.97); box-shadow: none; }

.result-competition {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    color: #0ea5e9;
    background: #0a1520;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    margin-top: 0.3rem;
}

.search-message {
    text-align: center;
    padding: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.search-error {
    color: #ef4444;
    background: #1a0a0a;
    border: 1px solid #ef444433;
    border-radius: 10px;
    margin-top: 0.6rem;
}

/* ── Calendar view ── */
.calendar-wrapper {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 14px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.8rem;
}

.calendar-nav-btn {
    background: var(--bg-primary);
    border: 1px solid #222;
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-nav-btn:active { background: var(--border-secondary); color: var(--text-white); }

.calendar-month-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-white);
    text-transform: capitalize;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-day-header {
    text-align: center;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-dimmed);
    text-transform: uppercase;
    padding: 0.3rem 0;
}

.calendar-day {
    text-align: center;
    padding: 0.4rem 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-radius: 8px;
    cursor: default;
    position: relative;
    min-height: 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.calendar-day.today {
    color: var(--text-white);
    font-weight: 700;
}

.calendar-day.has-event {
    cursor: pointer;
}

.calendar-day.has-event:active {
    background: var(--border-secondary);
}

.calendar-day.selected {
    background: var(--border-secondary);
    border: 1px solid #f97316;
}

.calendar-day.empty {
    color: transparent;
    cursor: default;
}

.calendar-dots {
    display: flex;
    gap: 3px;
    margin-top: 2px;
    justify-content: center;
}

.calendar-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
}

.calendar-dot.concert { background: #f97316; }
.calendar-dot.sport { background: #22c55e; }
.calendar-dot.other { background: var(--text-muted); }

.calendar-day-events {
    margin-top: 0.8rem;
}

.calendar-day-events .calendar-event-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    padding: 0.7rem;
    margin-bottom: 0.5rem;
    font-size: 0.82rem;
}

.calendar-event-item .cal-ev-name {
    font-weight: 600;
    color: var(--text-white);
}

.calendar-event-item .cal-ev-venue {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 0.15rem;
}

.calendar-event-item .cal-ev-type {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    margin-top: 0.25rem;
}

.cal-ev-type.concert { background: #f9731622; color: #f97316; }
.cal-ev-type.sport { background: #22c55e22; color: #22c55e; }
.cal-ev-type.other { background: #33333344; color: var(--text-muted); }

/* ── Filter bar ── */
.filter-bar {
    display: flex;
    gap: 0.3rem;
    margin-bottom: 0.4rem;
    flex-wrap: wrap;
}

.filter-bar select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    color: var(--text-secondary);
    border-radius: 10px;
    padding: 0.45rem 0.7rem;
    font-size: 0.75rem;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    flex: 1;
    min-width: 0;
    transition: border-color 0.2s;
}

.filter-bar select:focus { border-color: #f97316; }

/* ── Share & calendar action buttons (now in dropdown menu) ── */

/* ── Swipe to delete ── */
.event-card-swipe-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.swipe-delete-bg {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100px;
    background: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 0 12px 12px 0;
}

.event-card.swiping {
    transition: none;
}

.event-card.snap-back {
    transition: transform 0.25s ease;
}

/* ── Pull to refresh ── */
.pull-to-refresh {
    text-align: center;
    padding: 0;
    overflow: hidden;
    height: 0;
    transition: height 0.2s ease;
    color: var(--text-muted);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.pull-to-refresh.visible {
    height: 50px;
}

.pull-to-refresh .ptr-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #333;
    border-top-color: #f97316;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ── Settings modal ── */
.settings-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 60;
    background: var(--bg-overlay);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.settings-overlay.open { display: flex; align-items: center; justify-content: center; }

.settings-box {
    width: 100%;
    max-width: 400px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    padding: 1.5rem;
    margin: 1rem;
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.2rem;
}

.settings-header h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-white);
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--border-secondary);
}

.settings-row:last-child { border-bottom: none; }

.settings-label {
    font-size: 0.85rem;
    color: #ccc;
}

.settings-sublabel {
    font-size: 0.7rem;
    color: var(--text-dimmed);
    margin-top: 0.1rem;
}

/* Toggle switch */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--border-input);
    border-radius: 24px;
    transition: background 0.25s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: var(--text-muted);
    border-radius: 50%;
    left: 3px;
    bottom: 3px;
    transition: all 0.25s;
}

.toggle-switch input:checked + .toggle-slider {
    background: #22c55e44;
}

.toggle-switch input:checked + .toggle-slider::before {
    background: #22c55e;
    transform: translateX(20px);
}

.settings-time-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--border-secondary);
}

.settings-time-row input[type="time"] {
    background: var(--bg-primary);
    border: 1px solid #222;
    color: #ccc;
    border-radius: 8px;
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
    outline: none;
    -webkit-appearance: none;
}

.settings-time-row input[type="time"]:focus { border-color: #f97316; }

.settings-time-sep {
    color: var(--text-dimmed);
    font-size: 0.8rem;
}

.btn-settings-save {
    display: block;
    width: 100%;
    margin-top: 1rem;
    padding: 0.75rem;
    background: #f97316;
    color: #000;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
}

.btn-settings-save:active { transform: scale(0.97); }

.settings-link {
    color: #f97316;
    cursor: pointer;
    text-decoration: none;
    margin-left: 0.5rem;
}

/* ── Days-until badges ── */
.badge-past { background: #1c1917; color: var(--text-dimmed); }
.badge-today { background: #431407; color: #f97316; animation: pulse 1s infinite; }
.badge-soon { background: #422006; color: #f59e0b; }
.badge-future { background: #0a1520; color: #0ea5e9; }

/* ── Past events ── */
.event-card.past { opacity: 0.4; border-style: dashed; }

/* ── URL health dots ── */
.health-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 3px; vertical-align: middle; }
.health-dot.ok { background: #22c55e; }
.health-dot.err { background: #ef4444; }

/* ── Onboarding overlay ── */
.onboarding-overlay {
    position: fixed; inset: 0; z-index: 300;
    background: var(--bg-overlay); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    display: flex; align-items: center; justify-content: center; padding: 1.5rem;
}
.onboarding-card {
    max-width: 360px; width: 100%; text-align: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 20px;
    overflow: hidden;
}
.onboarding-step { padding: 2.5rem 1.5rem 2rem; }
.onboarding-icon { font-size: 3rem; margin-bottom: 1rem; }
.onboarding-step h3 { color: var(--text-white); font-size: 1.2rem; margin-bottom: 0.5rem; font-weight: 700; }
.onboarding-step p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; line-height: 1.5; }
.onboarding-step .btn-cta { max-width: 240px; margin: 0 auto; border-radius: 14px; }

/* ── Cron health indicator ── */
.cron-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    background: #111;
    border: 1px solid #333;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    white-space: nowrap;
}
.cron-indicator .cron-dot {
    width: 6px; height: 6px; border-radius: 50%; background: var(--text-dimmed);
}
.cron-indicator.active .cron-dot { background: #22c55e; }
.cron-indicator.active { color: #22c55e; border-color: #22c55e44; background: #22c55e11; }
.cron-indicator.inactive .cron-dot { background: #ef4444; }
.cron-indicator.inactive { color: #ef4444; border-color: #ef444444; background: #ef444411; }

/* ── Push badge ── */
.push-badge {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: #111;
    border: 1px solid #333;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    cursor: pointer;
}
.push-badge.on { color: #22c55e; border-color: #22c55e44; background: #22c55e11; }

/* ── Multi-URL form ── */
.url-entry {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
    align-items: flex-start;
}
.url-entry .url-fields {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.url-entry input {
    background: var(--input-bg);
    border: 1px solid var(--border-input);
    border-radius: 10px;
    padding: 0.65rem 0.9rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    width: 100%;
}
.url-entry input:focus { border-color: #f97316; }
.url-entry input::placeholder { color: #3a3a4a; }
.url-entry .label-input {
    font-size: 0.8rem;
    padding: 0.5rem 0.9rem;
}
.btn-remove-url {
    background: none;
    border: 1px solid #333;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 0.4rem;
}
.btn-remove-url:active { color: #ef4444; border-color: #ef4444; }
.btn-add-url {
    background: none;
    border: 1px dashed #333;
    color: var(--text-muted);
    border-radius: 10px;
    padding: 0.5rem;
    font-size: 0.8rem;
    cursor: pointer;
    width: 100%;
    text-align: center;
    margin-top: 0.2rem;
}
.btn-add-url:active { color: #f97316; border-color: #f97316; }

/* ── Date entries ── */
.date-entry {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
    align-items: center;
}
.date-entry input {
    background: var(--input-bg);
    border: 1px solid var(--border-input);
    border-radius: 10px;
    padding: 0.65rem 0.9rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    -webkit-appearance: none;
}
.date-entry .date-input { flex: 1; }
.date-entry .tickets-input {
    width: 4.5rem;
    text-align: center;
    flex-shrink: 0;
}
.date-entry input:focus { border-color: #f97316; }

/* ── Check history ── */
.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.2rem;
    margin-bottom: 0.6rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.history-header .section-title { font-size: 0.75rem; font-weight: 600; color: var(--text-dimmed); text-transform: uppercase; letter-spacing: 1px; }
.history-toggle { color: var(--text-dimmed); font-size: 0.8rem; transition: transform 0.2s; }
.history-toggle.open { transform: rotate(180deg); }

.history-container {
    background: var(--bg-tertiary);
    border: 1px solid #141420;
    border-radius: 12px;
    max-height: 300px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1.2rem;
}
.history-container:empty::after {
    content: 'Aucun historique';
    display: block;
    text-align: center;
    padding: 1.5rem;
    color: var(--text-faint);
    font-size: 0.8rem;
}
.history-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.8rem;
    border-bottom: 1px solid #0e0e18;
    font-size: 0.75rem;
}
.history-item:last-child { border-bottom: none; }
.history-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.history-dot.ok { background: #22c55e; }
.history-dot.alert { background: #f97316; }
.history-dot.error { background: #ef4444; }
.history-dot.closed { background: var(--text-dimmed); }
.history-time { color: var(--text-faint); white-space: nowrap; }
.history-event { color: var(--text-muted); font-weight: 500; }
.history-detail { color: var(--text-dimmed); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Auth screen ── */
.auth-screen {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.auth-screen.hidden { display: none; }

.auth-box {
    width: 100%;
    max-width: 380px;
    text-align: center;
}

.auth-illustration {
    margin-bottom: 1.2rem;
}

.auth-logo-svg {
    width: 72px;
    height: 72px;
    margin: 0 auto;
    display: block;
    animation: authFloat 3s ease-in-out infinite;
}

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

.auth-box h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 0.4rem;
    letter-spacing: -0.02em;
}

.auth-box h1 span { color: #f97316; }

.auth-subtitle {
    color: var(--text-dimmed);
    font-size: 0.85rem;
    margin-bottom: 1.8rem;
    line-height: 1.4;
}

.auth-fields {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin-bottom: 1rem;
    text-align: left;
}

.auth-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-box input {
    display: block;
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border-input);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    text-align: center;
    letter-spacing: 3px;
    font-weight: 600;
    -webkit-appearance: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-box input:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 3px #f9731615;
}
.auth-box input::placeholder { color: #3a3a4a; letter-spacing: 0; font-weight: 400; }

.auth-box .auth-name {
    letter-spacing: 0;
    font-weight: 400;
    text-align: left;
}

.auth-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.3rem;
}

.auth-actions .btn-cta {
    font-size: 1rem;
    padding: 0.9rem;
    border-radius: 14px;
    box-shadow: 0 4px 12px #22c55e30;
}

.auth-hint {
    color: var(--text-faint);
    font-size: 0.72rem;
    margin-top: 1rem;
}

.auth-code-display {
    background: var(--bg-secondary);
    border: 1px solid #f9731644;
    border-radius: 12px;
    padding: 1rem;
    margin: 1rem 0;
}

.auth-code-display .code {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 6px;
    color: #f97316;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.auth-code-display .hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.auth-toggle {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--text-dimmed);
}

.auth-toggle a {
    color: #f97316;
    cursor: pointer;
    text-decoration: none;
}

/* ── Card Appear Animation ── */
@keyframes cardAppear {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.event-card, .search-result-card {
    animation: cardAppear 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    opacity: 0;
}
.event-card:nth-child(1) { animation-delay: 0s; }
.event-card:nth-child(2) { animation-delay: 0.06s; }
.event-card:nth-child(3) { animation-delay: 0.12s; }
.event-card:nth-child(4) { animation-delay: 0.18s; }
.search-result-card:nth-child(1) { animation-delay: 0s; }
.search-result-card:nth-child(2) { animation-delay: 0.08s; }
.search-result-card:nth-child(3) { animation-delay: 0.16s; }

/* ── Shimmer / Skeleton Loading ── */
@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

.skeleton {
    background: var(--bg-secondary);
    background-image: linear-gradient(90deg, var(--bg-secondary) 0px, var(--border-primary) 40px, var(--bg-secondary) 80px);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: 8px;
}
.skeleton-card { height: 120px; margin-bottom: 0.6rem; border-radius: 12px; }

/* FAB removed — replaced by bottom nav */

/* ── Offline Banner ── */
.offline-banner {
    background: var(--accent-orange);
    color: #000;
    text-align: center;
    padding: 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
}
.offline-banner[hidden] { display: none; }

/* ── Small phones ── */
@media (max-width: 380px) {
    .container { padding: 0.4rem; }
    header h1 { font-size: 0.95rem; }
    .search-title { font-size: 0.9rem; }
    .form-row { grid-template-columns: 1fr; gap: 0.5rem; }
    .sched-controls { flex-direction: column; }
    .sched-btn { width: 100%; text-align: center; padding: 0.5rem; }
    .monitor-stat .val { font-size: 0.75rem; }
    .filter-bar select { font-size: 0.65rem; padding: 0.3rem 0.4rem; }
    .calendar-day { font-size: 0.7rem; min-height: 30px; }
    .event-name { font-size: 0.8rem; }
}

/* ── Tablet (640px+) ── */
@media (min-width: 640px) {
    .container { padding: 1.5rem; }
    header { padding: 0.8rem 0 0.5rem; }
    header h1 { font-size: 1.4rem; }
    .user-greeting { font-size: 0.8rem; }
    .search-hero { padding: 0.8rem 0; }
    .search-title { font-size: 1.1rem; }
    .btn-cta { padding: 0.75rem; font-size: 0.9rem; }

    .monitor-panel { padding: 1.5rem; border-radius: 18px; }
    .monitor-status-row { margin-bottom: 1rem; }
    .monitor-status-text { font-size: 1rem; }
    .btn-cta { max-width: 400px; margin: 0 auto; padding: 1.1rem; font-size: 1.05rem; border-radius: 14px; }
    .monitor-stats { font-size: 0.85rem; padding-top: 1rem; margin-top: 1rem; }
    .monitor-stat .val { font-size: 1.2rem; }
    .sched-countdown { font-size: 2.2rem; }
    .log-container { max-height: 200px; font-size: 0.8rem; }

    .events-list { gap: 0.8rem; }
    .event-card { padding: 1.3rem 1.5rem; border-radius: 14px; }
    .event-name { font-size: 1.1rem; }
    .event-info { font-size: 0.85rem; gap: 0.4rem 1.2rem; }
    .event-actions-row button:not(.btn-more) { padding: 0.6rem 0.5rem; font-size: 0.85rem; }

    .form-inner { max-width: 540px; padding: 2rem 1.5rem 3rem; }
    .form-header h2 { font-size: 1.2rem; }

    .auth-box { max-width: 400px; }
    .auth-box h1 { font-size: 2rem; }
    .auth-box input { padding: 1rem; font-size: 1.1rem; }

    .calendar-wrapper { padding: 1.2rem; border-radius: 16px; }
    .calendar-day { font-size: 0.85rem; min-height: 42px; }
    .filter-bar select { font-size: 0.8rem; padding: 0.5rem 0.8rem; }
}

/* ── Desktop (960px+) ── */
@media (min-width: 960px) {
    .tabs { display: flex; }
    .bottom-nav { display: none; }
    .container { max-width: 1100px; padding: 1.5rem 2.5rem; padding-bottom: 2rem; }
    .toast { bottom: 1.5rem; }
    header { padding: 1rem 0 0.3rem; }
    header h1 { font-size: 1.5rem; letter-spacing: -0.02em; }
    .user-greeting { font-size: 0.8rem; justify-content: flex-end; }
    .search-hero { padding: 1rem 0 0.8rem; }
    .search-title { font-size: 1.2rem; }
    .btn-cta { max-width: 320px; margin: 0 auto; padding: 0.7rem; font-size: 0.9rem; }

    /* Full-width stacked layout (no 2-col split) */
    .desktop-layout {
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }

    /* Monitor: full-width hero */
    .monitor-panel { padding: 2rem 2.5rem; border-radius: 20px; margin-bottom: 0; position: relative; top: auto; }
    .monitor-status-row { font-size: 1rem; margin-bottom: 1.2rem; gap: 0.75rem; }
    .monitor-status-text { font-size: 1rem; }
    .telegram-badge { font-size: 0.75rem; padding: 0.25rem 0.65rem; }
    .btn-cta { max-width: 380px; margin: 0 auto; padding: 1rem 2rem; font-size: 1.05rem; border-radius: 14px; }
    .scheduler { margin-top: 1.2rem; padding: 1rem 1.2rem; border-radius: 14px; }
    .sched-countdown { font-size: 2.2rem; letter-spacing: 3px; }

    /* Stats: mini-cards in 3-col grid */
    .monitor-stats {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
        padding-top: 1.2rem;
        margin-top: 1.2rem;
        font-size: 0.85rem;
    }
    .monitor-stat {
        background: #0a0a12;
        border: 1px solid var(--border-secondary);
        border-radius: 12px;
        padding: 0.8rem 1rem;
    }
    .monitor-stat .val { font-size: 1.4rem; }
    .monitor-stat .lbl { font-size: 0.75rem; margin-top: 0.2rem; }

    /* Alerts & Logs: full width, readable */
    .alert-item { padding: 1rem 1.2rem; border-radius: 12px; margin-top: 0.8rem; font-size: 0.9rem; word-break: break-word; }
    .log-container { max-height: 280px; font-size: 0.8rem; line-height: 1.8; border-radius: 12px; margin-top: 1rem; }
    .log-line { padding: 0.25rem 1rem; }
    .log-line .log-msg { word-break: break-word; white-space: normal; }

    /* Events: 2-col grid of cards */
    .events-column { display: flex; flex-direction: column; }
    .section-header { margin-bottom: 1.2rem; }
    .section-title { font-size: 0.8rem; letter-spacing: 1.5px; }
    .btn-add { padding: 0.5rem 1.2rem; font-size: 0.85rem; border-radius: 10px; }
    .events-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
    .event-card { padding: 1.3rem 1.5rem; border-radius: 16px; display: flex; flex-direction: column; }
    .event-name { font-size: 1.05rem; }
    .event-info { font-size: 0.82rem; white-space: normal; word-break: break-word; margin-top: 0.6rem; }
    .event-info span { white-space: normal; }
    .event-actions-row { margin-top: auto; padding-top: 0.8rem; }
    .event-actions-row button:not(.btn-more) { padding: 0.55rem 0.5rem; font-size: 0.82rem; border-radius: 10px; }
    .empty-state { grid-column: 1 / -1; }

    /* History */
    .history-header { margin-top: 2rem; }
    .history-container { border-radius: 14px; max-height: 350px; }

    /* Form */
    .form-inner { max-width: 640px; padding: 2.5rem 2.5rem 3rem; }
    .form-header h2 { font-size: 1.25rem; }
    .form-group input { padding: 0.8rem 1rem; font-size: 1rem; border-radius: 12px; }
    .btn-submit { padding: 1rem; font-size: 1.05rem; max-width: 400px; margin: 0.5rem auto 0; }

    /* Auth */
    .auth-box { max-width: 440px; }
    .auth-box h1 { font-size: 2.2rem; letter-spacing: -0.02em; }
}

/* ── Wide Desktop (1400px+) ── */
@media (min-width: 1400px) {
    .container { max-width: 1300px; padding: 2.5rem 4rem; }
    .monitor-panel { padding: 2.5rem 3rem; }
    .events-list { grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
    .event-card { padding: 1.5rem 1.8rem; }
    .log-container { max-height: 320px; font-size: 0.82rem; }
    .monitor-stat .val { font-size: 1.5rem; }
}


/* ── Share app button ── */
.btn-share-app {
    display: inline-block;
    margin-top: 0.5rem;
    background: none;
    border: 1px solid var(--border-input, #2a2a3a);
    color: var(--text-muted, #666);
    border-radius: 20px;
    padding: 0.35rem 1rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-share-app:active {
    border-color: var(--accent-orange, #f97316);
    color: var(--accent-orange, #f97316);
}
