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

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #00ffff;
    min-height: 100vh;
}

.admin-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.admin-header {
    background: #0f3460;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 2px solid #00ffff;
}

.admin-header h1 {
    font-size: 24px;
    color: #ff6b9d;
    text-shadow: 0 0 10px #ff6b9d;
}

.admin-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.settings-section,
.info-section {
    background: rgba(15, 52, 96, 0.6);
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #00ffff;
}

.settings-section h2,
.info-section h2 {
    color: #ff6b9d;
    margin-bottom: 20px;
    font-size: 20px;
    border-bottom: 1px solid #00ffff;
    padding-bottom: 10px;
}

.setting-group {
    margin-bottom: 25px;
}

.setting-group label {
    display: block;
    color: #00ffff;
    margin-bottom: 8px;
    font-weight: bold;
}

.setting-group input[type="text"] {
    width: 100%;
    padding: 10px;
    background: #000080;
    border: 1px solid #00ffff;
    border-radius: 4px;
    color: #00ffff;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.setting-group input[type="text"]:focus {
    outline: none;
    border-color: #ff6b9d;
    box-shadow: 0 0 10px rgba(255, 107, 157, 0.3);
}

.setting-group small {
    display: block;
    margin-top: 5px;
    color: #888;
    font-size: 12px;
}

.paddock-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.button-group {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.btn-primary {
    background: #00ffff;
    color: #000;
}

.btn-primary:hover {
    background: #00cccc;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

.btn-secondary {
    background: #555;
    color: #fff;
}

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

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

.btn-danger:hover {
    background: #cc0000;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.5);
}

.status-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
    min-height: 20px;
}

.status-message.success {
    background: rgba(0, 255, 0, 0.2);
    border: 1px solid #00ff00;
    color: #00ff00;
}

.status-message.error {
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid #ff0000;
    color: #ff0000;
}

.info-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #00ffff;
}

.tab-btn {
    padding: 10px 20px;
    background: transparent;
    border: none;
    color: #888;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: #00ffff;
}

.tab-btn.active {
    color: #00ffff;
    border-bottom-color: #ff6b9d;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

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

.names-section {
    margin-bottom: 30px;
}

.names-section h3 {
    color: #ff6b9d;
    margin-bottom: 15px;
    font-size: 16px;
}

.names-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.names-list li {
    background: rgba(0, 0, 128, 0.3);
    padding: 8px 12px;
    border-left: 3px solid #00ffff;
    color: #00ffff;
    font-size: 13px;
}

.stats-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.form-row label {
    flex: 1;
    color: #00ffff;
    font-weight: bold;
}

.form-row input[type="number"] {
    flex: 0 0 150px;
    padding: 8px;
    background: #000080;
    border: 1px solid #00ffff;
    border-radius: 4px;
    color: #00ffff;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.form-row input[type="number"]:focus {
    outline: none;
    border-color: #ff6b9d;
    box-shadow: 0 0 10px rgba(255, 107, 157, 0.3);
}

.island-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.island-input-group label {
    flex: 0 0 100px;
    color: #00ffff;
    font-weight: bold;
}

.island-name-input {
    flex: 1;
    padding: 8px;
    background: #000080;
    border: 1px solid #00ffff;
    border-radius: 4px;
    color: #00ffff;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.island-name-input:focus {
    outline: none;
    border-color: #ff6b9d;
    box-shadow: 0 0 10px rgba(255, 107, 157, 0.3);
}

#node-names-textarea {
    width: 100%;
    padding: 10px;
    background: #000080;
    border: 1px solid #00ffff;
    border-radius: 4px;
    color: #00ffff;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
}

#node-names-textarea:focus {
    outline: none;
    border-color: #ff6b9d;
    box-shadow: 0 0 10px rgba(255, 107, 157, 0.3);
}

.helper-text {
    display: block;
    color: #888;
    font-size: 12px;
    margin-bottom: 10px;
}

.info-item {
    background: rgba(0, 0, 128, 0.3);
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #00ffff;
}

.info-label {
    display: block;
    color: #888;
    font-size: 12px;
    margin-bottom: 5px;
}

.info-value {
    display: block;
    color: #00ffff;
    font-size: 16px;
    font-weight: bold;
}

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

    .info-grid,
    .names-list {
        grid-template-columns: 1fr;
    }

    .button-group {
        flex-direction: column;
    }

    .info-tabs {
        flex-direction: column;
    }

    .tab-btn {
        border-bottom: none;
        border-left: 3px solid transparent;
    }

    .tab-btn.active {
        border-left-color: #ff6b9d;
    }
}

/* Inputs the original styles didn't cover */
.setting-group label + input,
.setting-group label + select,
.setting-group label + textarea {
    margin-bottom: 4px;
}

.setting-group h3 {
    color: #ff6b9d;
    font-size: 16px;
    margin-bottom: 15px;
}

.setting-group select,
.setting-group textarea {
    width: 100%;
    padding: 10px;
    background: #000080;
    border: 1px solid #00ffff;
    border-radius: 4px;
    color: #00ffff;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.setting-group textarea {
    resize: vertical;
}

.setting-group select:focus,
.setting-group textarea:focus {
    outline: none;
    border-color: #ff6b9d;
    box-shadow: 0 0 10px rgba(255, 107, 157, 0.3);
}

.setting-group small + label,
.setting-group select + label {
    margin-top: 14px;
}

.settings-section .setting-group + .setting-group {
    border-top: 1px dashed rgba(0, 255, 255, 0.25);
    padding-top: 20px;
}

.btn:focus-visible {
    outline: 2px solid #ff6b9d;
    outline-offset: 2px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: wait;
}

a.btn {
    display: inline-block;
    text-decoration: none;
}

/* Webhook test buttons */
.test-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.btn-test {
    background: transparent;
    border: 1px solid #00ffff;
    color: #00ffff;
    padding: 6px 14px;
    font-size: 13px;
}

.btn-test:hover {
    background: rgba(0, 255, 255, 0.15);
}

.test-result {
    font-size: 13px;
    color: #888;
    word-break: break-word;
}

.test-result.success { color: #00ff00; }
.test-result.error { color: #ff5555; }
.test-result.pending { color: #ffff00; }

.count-badge {
    font-size: 12px;
    color: #888;
    font-weight: normal;
    margin-left: 8px;
}

/* Sticky save bar so Save is reachable from every section */
.admin-container {
    padding-bottom: 110px;
}

.save-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 12px max(20px, calc((100vw - 1000px) / 2 + 20px));
    background: rgba(10, 20, 45, 0.96);
    border-top: 2px solid #00ffff;
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.5);
}

.save-bar .button-group {
    margin-top: 0;
}

.save-bar .status-message {
    margin-top: 0;
    min-height: 0;
    flex: 1;
    text-align: left;
}

.save-bar .status-message:empty {
    padding: 0;
}

.dirty-indicator {
    color: #ffff00;
    font-size: 14px;
    font-weight: bold;
}

/* Passcode gate */
#auth-gate {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    z-index: 100;
}

#auth-gate.hidden {
    display: none;
}

.auth-window {
    width: min(440px, 100%);
    background: #0f3460;
    border: 2px solid #00ffff;
    border-radius: 8px;
    padding: 28px;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
}

.auth-window h1 {
    font-size: 20px;
    color: #ff6b9d;
    text-shadow: 0 0 10px #ff6b9d;
    margin-bottom: 20px;
}

.auth-window label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
}

.auth-window input {
    width: 100%;
    padding: 10px;
    background: #000080;
    border: 1px solid #00ffff;
    border-radius: 4px;
    color: #00ffff;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    letter-spacing: 2px;
}

.auth-window input:focus {
    outline: none;
    border-color: #ff6b9d;
    box-shadow: 0 0 10px rgba(255, 107, 157, 0.3);
}

.auth-error {
    min-height: 20px;
    margin: 8px 0;
    color: #ff5555;
    font-size: 14px;
}

.auth-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .save-bar {
        gap: 10px;
    }

    .save-bar .button-group {
        flex-direction: row;
    }

    .admin-container {
        padding-bottom: 170px;
    }
}
