body {
    background-color: #111111;
    color: #eeeeee;
    margin: 0;
    font-family: Arial, sans-serif;
}

a {
    color: #7eb8ff;
}

.admin-hidden {
    display: none !important;
}

/* Gate screen */
.gate-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gate-card {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 32px;
    width: 360px;
    max-width: 90vw;
}

.gate-card h1 {
    margin-top: 0;
    font-size: 22px;
    text-align: center;
}

.gate-card input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
    margin: 12px 0;
    background: #111;
    border: 1px solid #444;
    color: #eee;
    border-radius: 3px;
}

.gate-error {
    color: #ff6b6b;
    font-size: 13px;
    margin-bottom: 8px;
}

/* Layout */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 200px;
    background: #1a1a1a;
    border-right: 1px solid #333;
    padding: 16px 0;
    flex-shrink: 0;
}

.admin-sidebar h2 {
    font-size: 14px;
    padding: 0 16px;
    margin: 0 0 16px 0;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.admin-nav-item {
    display: block;
    padding: 10px 16px;
    color: #ccc;
    text-decoration: none;
    cursor: pointer;
    border-left: 3px solid transparent;
}

.admin-nav-item:hover,
.admin-nav-item.active {
    background: #252525;
    color: #fff;
    border-left-color: #00c462;
}

.admin-sidebar-footer {
    margin-top: 32px;
    padding: 0 16px;
    font-size: 12px;
}

.admin-main {
    flex: 1;
    padding: 20px 24px;
    overflow-x: auto;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.admin-header h1 {
    margin: 0;
    font-size: 22px;
}

.admin-banner {
    background: #3a2020;
    border: 1px solid #dd0909;
    color: #ffcccc;
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 16px;
}

.admin-note {
    background: #1e2a3a;
    border: 1px solid #3e59e1;
    color: #c8d8f0;
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 13px;
}

.admin-toolbar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    align-items: center;
}

.admin-toolbar input,
.admin-toolbar select {
    padding: 8px 10px;
    background: #1a1a1a;
    border: 1px solid #444;
    color: #eee;
    border-radius: 3px;
}

.filter-group {
    display: flex;
    gap: 4px;
}

.filter-btn {
    padding: 6px 12px;
    background: #252525;
    border: 1px solid #444;
    color: #ccc;
    cursor: pointer;
    border-radius: 3px;
    font-size: 13px;
}

.filter-btn.active {
    background: #00c462;
    border-color: #00c462;
    color: #111;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.admin-table th,
.admin-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #333;
}

.admin-table th {
    color: #aaa;
    font-weight: normal;
    font-size: 12px;
    text-transform: uppercase;
}

.admin-table tr:hover td {
    background: #1a1a1a;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

.badge-active {
    background: #00c462;
    color: #111;
}

.badge-inactive {
    background: #444;
    color: #ccc;
}

.badge-inherit {
    background: #333;
    color: #999;
    font-style: italic;
}

.btn {
    padding: 8px 14px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
}

.btn-primary {
    background: #00c462;
    color: #111;
    font-weight: bold;
}

.btn-secondary {
    background: #333;
    color: #eee;
}

.btn-danger {
    background: #dd0909;
    color: #fff;
}

.btn-link {
    background: none;
    border: none;
    color: #7eb8ff;
    cursor: pointer;
    padding: 2px 6px;
    font-size: 13px;
}

.btn-link:hover {
    text-decoration: underline;
}

.btn-link.danger {
    color: #ff8989;
}

/* Drawer */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
}

.drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    max-width: 95vw;
    height: 100vh;
    background: #1a1a1a;
    border-left: 1px solid #333;
    z-index: 101;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.4);
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #333;
}

.drawer-header h2 {
    margin: 0;
    font-size: 18px;
}

.drawer-close {
    background: none;
    border: none;
    color: #aaa;
    font-size: 22px;
    cursor: pointer;
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.drawer-footer {
    padding: 16px 20px;
    border-top: 1px solid #333;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.drawer-footer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.drawer-error {
    background: #3a1515;
    border: 1px solid #dd0909;
    color: #fff;
    padding: 10px 12px;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.4;
    word-break: break-word;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #aaa;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    background: #111;
    border: 1px solid #444;
    color: #eee;
    border-radius: 3px;
    font-size: 14px;
}

.form-group textarea.mono {
    font-family: monospace;
    font-size: 12px;
}

.form-group input:read-only {
    color: #888;
}

.form-hint {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

.form-error {
    font-size: 12px;
    color: #ff6b6b;
    margin-top: 4px;
}

.form-success {
    font-size: 12px;
    color: #00c462;
    margin-top: 4px;
}

.radio-group label {
    display: inline-block;
    margin-right: 16px;
    color: #eee;
}

.char-counter {
    font-size: 11px;
    color: #888;
    text-align: right;
    margin-top: 2px;
}

.char-counter.over {
    color: #ff6b6b;
}

details.example-snippet {
    margin-top: 8px;
    font-size: 12px;
}

details.example-snippet pre {
    background: #111;
    padding: 8px;
    border-radius: 3px;
    overflow-x: auto;
}

.send-status-form {
    max-width: 480px;
    margin-top: 16px;
}

.send-status-form .form-group input,
.send-status-form .form-group select {
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
    background: #111;
    border: 1px solid #444;
    color: #eee;
    border-radius: 3px;
}

.send-status-form code {
    font-size: 12px;
    color: #ccc;
}

#view-run-evaluation .btn {
    margin-top: 16px;
}

/* Toasts */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: min(420px, calc(100vw - 40px));
    pointer-events: none;
}

.toast {
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.4;
    min-width: 240px;
    max-width: 100%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    word-break: break-word;
    pointer-events: auto;
}

.toast-success {
    background: #00c462;
    color: #111;
}

.toast-error {
    background: #8b0000;
    border: 1px solid #ff6b6b;
    color: #fff;
}

.truncate {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: bottom;
}

@media (max-width: 768px) {
    .admin-layout {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #333;
        display: flex;
        flex-wrap: wrap;
        gap: 0;
        padding: 8px 0;
    }

    .admin-sidebar h2 {
        width: 100%;
    }

    .admin-nav-item {
        flex: 1;
        text-align: center;
        border-left: none;
        border-bottom: 3px solid transparent;
    }

    .admin-nav-item.active {
        border-left: none;
        border-bottom-color: #00c462;
    }
}
