:root {
    --bg: #0f1419;
    --card: #1a2332;
    --text: #e7ecf3;
    --muted: #8b9aad;
    --accent: #3d8bfd;
    --accent2: #2b6cb0;
    --danger: #f56565;
    --border: #2d3a4d;
    font-family: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    width: 100%;
    max-width: 380px;
}

.auth-card h1 { margin: 0 0 0.25rem; font-size: 1.5rem; }
.muted { color: var(--muted); margin: 0 0 1rem; }

.alert {
    background: rgba(245, 101, 101, 0.15);
    border: 1px solid var(--danger);
    color: #feb2b2;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

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

label > span,
.field > .field-title {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 0.35rem;
}

.field { display: block; }

input, select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #121a26;
    color: var(--text);
    font-size: 1rem;
}

.btn {
    display: inline-block;
    padding: 0.65rem 1.2rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    text-align: center;
}

.btn.primary {
    background: var(--accent);
    color: #fff;
    width: 100%;
}
.btn.primary:hover { background: var(--accent2); }

.btn.secondary {
    background: #2d3748;
    color: var(--text);
}
.btn.secondary:hover { background: #3d4a5c; }

.btn.ghost {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
}
.btn.ghost:hover { color: var(--text); }

.top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--card);
}

.brand { font-weight: 600; }

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

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}

.card h2 { margin: 0 0 1rem; font-size: 1.1rem; }

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

@media (min-width: 900px) {
    .grid { grid-template-columns: repeat(4, 1fr); }
}

.span2 { grid-column: span 2; }

.actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

.table-wrap {
    overflow-x: auto;
    max-height: 70vh;
    overflow-y: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

th, td {
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0.6rem;
    text-align: left;
    vertical-align: top;
}

th {
    position: sticky;
    top: 0;
    background: #243044;
    z-index: 1;
}

tr:hover td { background: rgba(61, 139, 253, 0.06); }

.inline { margin: 0; }

.multiselect { position: relative; }

.ms-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #121a26;
    color: var(--text);
    font-size: 1rem;
    cursor: pointer;
    text-align: left;
}
.ms-toggle:hover { border-color: #3d4a5c; }

.ms-toggle .ms-value {
    display: inline;
    margin: 0;
    color: var(--text);
    font-size: 1rem;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ms-caret { color: var(--muted); font-size: 0.8rem; display: inline; margin: 0; }

.ms-menu {
    position: absolute;
    z-index: 20;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    max-height: 280px;
    flex-direction: column;
    overflow: hidden;
    display: none;
}

.ms-menu.ms-open {
    display: flex;
}

.ms-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid var(--border);
    background: #192436;
}

.ms-link {
    background: transparent;
    border: none;
    color: var(--accent);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.2rem 0.3rem;
}
.ms-link:hover { color: #6aa8ff; text-decoration: underline; }

.ms-options {
    overflow-y: auto;
    padding: 0.25rem 0;
}

.ms-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    font-size: 0.92rem;
    user-select: none;
}
.ms-row:hover { background: rgba(61, 139, 253, 0.1); }

.ms-row input[type="checkbox"] {
    width: auto;
    margin: 0;
    accent-color: var(--accent);
    flex: 0 0 auto;
}

.ms-row .ms-row-text {
    display: inline;
    margin: 0;
    color: var(--text);
    font-size: 0.92rem;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.report-type-toggle {
    display: flex;
    gap: 1.5rem;
}

.report-type-toggle label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-size: 0.95rem;
}

.report-type-toggle input[type="radio"] {
    width: auto;
    margin: 0;
    accent-color: var(--accent);
}
