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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0d1117;
    color: #c9d1d9;
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* Auth Section */
#auth-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
}

.auth-box {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 40px;
    width: 400px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.auth-box h1 {
    text-align: center;
    margin-bottom: 8px;
    font-size: 24px;
    color: #58a6ff;
}

.auth-box .subtitle {
    text-align: center;
    color: #8b949e;
    margin-bottom: 24px;
    font-size: 14px;
}

.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border: 1px solid #30363d;
    border-radius: 8px;
    overflow: hidden;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    background: #0d1117;
    color: #8b949e;
    font-size: 14px;
    border: none;
    transition: all 0.2s;
}

.auth-tab.active {
    background: #21262d;
    color: #58a6ff;
    font-weight: 600;
}

.auth-form input {
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 12px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #c9d1d9;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.auth-form input:focus {
    border-color: #58a6ff;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #238636;
    color: #fff;
    width: 100%;
}

.btn-primary:hover {
    background: #2ea043;
}

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

.btn-danger:hover {
    background: #f85149;
}

.btn-secondary {
    background: #21262d;
    color: #c9d1d9;
    border: 1px solid #30363d;
}

.btn-secondary:hover {
    background: #30363d;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.auth-error {
    color: #f85149;
    font-size: 13px;
    margin-top: 8px;
    text-align: center;
}

/* Dashboard Layout */
#dashboard {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: #161b22;
    border-right: 1px solid #30363d;
    padding: 20px;
    flex-shrink: 0;
}

.sidebar h2 {
    font-size: 18px;
    color: #58a6ff;
    margin-bottom: 4px;
}

.sidebar .user-info {
    font-size: 13px;
    color: #8b949e;
    margin-bottom: 20px;
    word-break: break-all;
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav li {
    padding: 10px 14px;
    margin-bottom: 4px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #8b949e;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-nav li:hover, .sidebar-nav li.active {
    background: #21262d;
    color: #c9d1d9;
}

.sidebar-nav li .badge {
    margin-left: auto;
    background: #238636;
    color: #fff;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #f0f6fc;
}

/* Status Bar */
.status-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    margin-bottom: 20px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #484f58;
}

.status-dot.online {
    background: #3fb950;
    box-shadow: 0 0 8px rgba(63,185,80,0.5);
}

.status-dot.offline {
    background: #484f58;
}

.status-dot.error {
    background: #da3633;
    box-shadow: 0 0 8px rgba(218,54,51,0.5);
}

.status-text {
    font-size: 14px;
    color: #8b949e;
}

/* Cards */
.card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
}

.card h3 {
    font-size: 16px;
    margin-bottom: 16px;
    color: #f0f6fc;
}

/* Console Log */
.console {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 12px;
    height: 400px;
    overflow-y: auto;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
}

.console .entry {
    padding: 2px 0;
    border-bottom: 1px solid #21262d;
}

.console .timestamp {
    color: #484f58;
    margin-right: 8px;
}

.console .level-info {
    color: #58a6ff;
}

.console .level-success {
    color: #3fb950;
}

.console .level-detect {
    color: #d29922;
}

.console .level-fail {
    color: #f85149;
}

.console .level-warn {
    color: #d29922;
}

.console .level-error {
    color: #f85149;
    font-weight: bold;
}

/* Account List */
.account-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    margin-bottom: 8px;
}

.account-item .info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.account-item .status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #484f58;
}

.account-item .status-indicator.active {
    background: #3fb950;
}

.account-item .actions {
    display: flex;
    gap: 6px;
}

/* Select inputs */
select.form-input {
    width: 100%;
    padding: 10px 14px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #e6edf3;
    font-size: 14px;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238b949e' viewBox='0 0 16 16'%3E%3Cpath d='M4.427 6.427l3.396 3.396a.25.25 0 00.354 0l3.396-3.396A.25.25 0 0011.396 6H4.604a.25.25 0 00-.177.427z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

select.form-input option {
    background-color: #161b22;
    color: #e6edf3;
    padding: 8px;
}

.form-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.form-row-selects > * {
    flex: 1;
}

.form-row-btns {
    margin-top: 8px;
}

.form-row-btns .btn {
    flex: 1;
    max-width: 160px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 24px;
    width: 440px;
    max-width: 90vw;
}

.modal h3 {
    margin-bottom: 16px;
}

.modal input {
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 12px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #c9d1d9;
    font-size: 14px;
    outline: none;
}

.modal input:focus {
    border-color: #58a6ff;
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
}

/* Log claim table */
.log-table {
    width: 100%;
    border-collapse: collapse;
}

.log-table th {
    text-align: left;
    padding: 10px 12px;
    font-size: 12px;
    text-transform: uppercase;
    color: #8b949e;
    border-bottom: 1px solid #30363d;
}

.log-table td {
    padding: 8px 12px;
    font-size: 13px;
    border-bottom: 1px solid #21262d;
}

.log-table .result-success {
    color: #3fb950;
}

.log-table .result-already_used, .log-table .result-fail {
    color: #d29922;
}

.log-table .result-invalid, .log-table .result-error {
    color: #f85149;
}

/* Responsive */
@media (max-width: 768px) {
    #dashboard {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #30363d;
        padding: 12px;
    }
    .sidebar h2 {
        font-size: 16px;
    }
    .sidebar-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }
    .sidebar-nav li {
        flex: 1;
        min-width: 80px;
        justify-content: center;
        padding: 8px 10px;
        font-size: 13px;
    }
    .sidebar-nav li .badge {
        margin-left: 4px;
    }
    .sidebar-nav li:last-child {
        margin-top: 0;
    }
    .main-content {
        padding: 12px;
    }
    .form-row-selects {
        flex-direction: column;
    }
    .form-row-btns {
        flex-direction: column;
    }
    .form-row-btns .btn {
        max-width: none;
    }
    .auth-box {
        width: 100%;
        max-width: 360px;
        padding: 24px 20px;
        margin: 16px;
    }
    .card {
        padding: 14px;
    }
    .account-item {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    .account-item .actions {
        width: 100%;
        justify-content: flex-end;
    }
    .modal {
        width: 100%;
        max-width: 90vw;
        padding: 20px;
    }
    .log-table {
        font-size: 12px;
    }
    .log-table th,
    .log-table td {
        padding: 6px 8px;
    }
    .status-bar {
        flex-wrap: wrap;
    }
    #page-overview .card:first-of-type .form-row {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .sidebar-nav li {
        min-width: 60px;
        font-size: 11px;
        padding: 6px 6px;
    }
    .sidebar-nav li span:first-child {
        font-size: 14px;
    }
    .page h2 {
        font-size: 17px;
    }
    select.form-input {
        font-size: 13px;
        padding: 8px 30px 8px 10px;
    }
    .btn {
        font-size: 13px;
        padding: 8px 14px;
    }
    #page-overview div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}
