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

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: #1a1a2e;
    color: #e0e0e0;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

h1 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #fff;
}

h2 {
    font-size: 1.1rem;
    margin-bottom: 14px;
    color: #ccc;
}

/* ── Cards ── */
.card {
    background: #16213e;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

/* ── Auth layout ── */
#authSection {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 700px) {
    #authSection {
        grid-template-columns: 1fr;
    }
}

/* ── User bar ── */
.user-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ── Fetch bar ── */
.fetch-bar {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.days-input {
    margin-bottom: 0;
    width: 100px;
}

.days-input input {
    width: 100%;
}

/* ── Forms ── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.form-group label {
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
    padding: 8px 12px;
    border: 1px solid #333;
    border-radius: 6px;
    background: #0f0f23;
    color: #e0e0e0;
    font-size: 0.9rem;
}

/* ── Buttons ── */
button {
    padding: 8px 24px;
    background: #0f3460;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

button:hover {
    background: #1a5276;
}

button:active {
    background: #0b2540;
}

.btn-secondary {
    background: #333;
}

.btn-secondary:hover {
    background: #555;
}

/* ── Status ── */
.status {
    margin-top: 8px;
    font-size: 0.85rem;
    color: #888;
    min-height: 20px;
}

.status.error {
    color: #e74c3c;
}

.status.ok {
    color: #2ecc71;
}

/* ── Table ── */
.table-wrap {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #222;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    white-space: nowrap;
}

thead th {
    position: sticky;
    top: 0;
    background: #0f3460;
    color: #fff;
    padding: 10px 12px;
    text-align: left;
    border-bottom: 2px solid #1a5276;
}

tbody td {
    padding: 8px 12px;
    border-bottom: 1px solid #1e1e3a;
}

tbody tr:hover {
    background: #16213e;
}

tbody tr:nth-child(even) {
    background: #12122a;
}

/* ── Accordion Groups ── */
.accordion-group {
    border: 1px solid #222;
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 14px 18px;
    background: #16213e;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    text-align: left;
    transition: background 0.2s;
    border-radius: 0;
}

.accordion-header:hover {
    background: #1a2d50;
}

.accordion-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.accordion-icon {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 6px solid #888;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.accordion-header.open .accordion-icon {
    transform: rotate(90deg);
    border-left-color: #5dade2;
}

.accordion-subtitle {
    color: #aaa;
    font-weight: 400;
}

.accordion-badge {
    background: #0f3460;
    color: #5dade2;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.accordion-body.open {
    max-height: 4000px;
}

.empty-msg {
    padding: 16px 18px;
    color: #888;
    font-size: 0.85rem;
}