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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #0f1117;
    color: #e1e4e8;
    min-height: 100vh;
}

#app { max-width: 1100px; margin: 0 auto; padding: 20px; }

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

/* Auth views */
.auth-view {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; min-height: 80vh;
}
.auth-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 32px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 4px 24px rgba(0,0,0,0.3);
    text-align: center;
}
.auth-card h1 { margin-bottom: 12px; color: #22d3ee; font-size: 22px; }
.auth-card p { margin-bottom: 20px; color: #8b949e; font-size: 14px; }
.auth-card form { display: flex; gap: 16px; justify-content: center; }
.auth-card input {
    padding: 10px 14px; border: 1px solid #30363d; border-radius: 6px;
    background: #0f1117; color: #e1e4e8; font-size: 14px; flex: 1;
}
.auth-card button {
    padding: 10px 20px; background: #22d3ee; color: #0f1117;
    border: none; border-radius: 6px; cursor: pointer; font-size: 14px;
    font-weight: 600;
}
.auth-card button:hover { background: #06b6d4; }
.error { color: #f85149; margin-top: 10px; }
.message { color: #22d3ee; margin-top: 10px; }

/* Header */
header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid #21262d;
}
header h1 { font-size: 20px; color: #22d3ee; }
.header-right { display: flex; align-items: center; gap: 12px; }
#status-indicator { font-size: 13px; color: #8b949e; }

/* Tabs */
.tabs {
    display: flex; gap: 0; margin-bottom: 20px;
    border-bottom: 1px solid #21262d;
}
.tab {
    padding: 10px 20px; background: none; border: none;
    color: #8b949e; cursor: pointer; font-size: 14px;
    border-bottom: 2px solid transparent;
}
.tab:hover { color: #e1e4e8; }
.tab.active { color: #22d3ee; border-bottom-color: #22d3ee; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Forms */
.inline-form {
    display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end;
}
.form-field {
    display: flex; flex-direction: column;
}
.form-field label {
    font-size: 12px; color: #8b949e; margin-bottom: 4px;
}
.form-field input {
    padding: 10px 14px; border: 1px solid #30363d; border-radius: 6px;
    background: #0f1117; color: #e1e4e8; font-size: 13px; width: 100%;
}
#wallet-address { min-width: 0; }
.inline-form .form-field:nth-child(1) { flex: 3; }
.inline-form .form-field:nth-child(2) { flex: 2; }
.inline-form .form-field:nth-child(3),
.inline-form .form-field:nth-child(4) { flex: 1; }
.inline-form > button {
    padding: 10px 16px; background: #22d3ee; color: #0f1117;
    border: none; border-radius: 6px; cursor: pointer; font-weight: 600;
    align-self: flex-end;
}
.inline-form > button:hover { background: #06b6d4; }

.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; color: #8b949e; font-size: 13px; }
.form-group input {
    width: 100%; max-width: 400px; padding: 10px 14px;
    border: 1px solid #30363d; border-radius: 6px;
    background: #0f1117; color: #e1e4e8;
}

/* Focus states */
input:focus, select:focus {
    border-color: #22d3ee;
    box-shadow: 0 0 0 2px rgba(34,211,238,0.2);
    outline: none;
}

/* Settings buttons */
#settings-form button[type="submit"], #change-password-form button[type="submit"] {
    padding: 10px 16px; background: #22d3ee; color: #0f1117;
    border: none; border-radius: 6px; cursor: pointer; margin-right: 8px;
    font-weight: 600;
}
#settings-form button[type="submit"]:hover, #change-password-form button[type="submit"]:hover {
    background: #06b6d4;
}
#test-notification-btn {
    padding: 10px 16px; background: #30363d; color: #e1e4e8;
    border: none; border-radius: 6px; cursor: pointer;
}
#test-notification-btn:hover { background: #3d444d; }
#settings-tab .card { max-width: 500px; }
#change-password-form { display: flex; gap: 12px; margin-top: 12px; }
#change-password-form input {
    padding: 10px 14px; border: 1px solid #30363d; border-radius: 6px;
    background: #0f1117; color: #e1e4e8; font-size: 14px;
}

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 20px; }
th {
    text-align: left; padding: 10px 14px; border-bottom: 1px solid #21262d;
    color: #8b949e; font-weight: 600;
}
td { padding: 10px 14px; border-bottom: 1px solid #161b22; }
tbody tr:nth-child(odd) { background: #1c2129; }
tbody tr:hover { background: #21262d; }
thead tr:hover { background: none; }

/* Monospace addresses in wallets table */
#wallets-table td:nth-child(2) { font-family: "SF Mono", SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; word-break: break-all; font-size: 12px; }

/* Buttons */
.btn-small {
    padding: 4px 10px; font-size: 12px; border: 1px solid #30363d;
    border-radius: 6px; background: #21262d; color: #e1e4e8; cursor: pointer;
}
.btn-small:hover { background: #30363d; }
.btn-danger { color: #f85149; border-color: #f85149; }
.btn-danger:hover { background: #f8514922; }

.toggle {
    cursor: pointer; padding: 4px 12px; border-radius: 12px;
    font-size: 12px; border: none; font-weight: 600;
}
.toggle.active { background: #238636; color: #fff; }
.toggle.inactive { background: #30363d; color: #8b949e; }

/* Events controls */
.events-controls { display: flex; gap: 10px; margin-bottom: 15px; }
.events-controls select {
    padding: 8px 12px; border: 1px solid #30363d; border-radius: 6px;
    background: #0f1117; color: #e1e4e8;
}

/* Edit mode */
.edit-input {
    padding: 4px 8px; border: 1px solid #30363d; border-radius: 6px;
    background: #0f1117; color: #e1e4e8; width: 100px; font-size: 12px;
}

hr { border: none; border-top: 1px solid #21262d; margin: 20px 0; }
h2 { font-size: 16px; margin-bottom: 12px; color: #e1e4e8; }
h3 { font-size: 14px; margin-bottom: 10px; color: #e1e4e8; }

/* Hide number input spinners */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }

/* Token tags */
.token-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.token-tag {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; background: #21262d; border: 1px solid #30363d;
    border-radius: 16px; font-size: 12px; color: #e1e4e8;
}
.token-tag button {
    background: none; border: none; color: #8b949e; cursor: pointer;
    font-size: 14px; padding: 0 2px; line-height: 1;
}
.token-tag button:hover { color: #f85149; }
.ignored-tokens-add { margin-top: 12px; }
#add-ignored-token-form { display: flex; gap: 8px; }
#ignored-token-input {
    flex: 1; padding: 8px 12px; border: 1px solid #30363d; border-radius: 6px;
    background: #0f1117; color: #e1e4e8; font-size: 13px; text-transform: uppercase;
}
#ignored-token-message { font-size: 12px; margin-top: 6px; }

/* Mobile */
@media (max-width: 768px) {
    #app { padding: 12px; }

    /* Stack wallet form vertically */
    .inline-form { flex-direction: column; }
    .form-field { width: 100%; }
    .inline-form .form-field { flex: unset; }
    .inline-form > button { width: 100%; }

    /* Horizontal-scroll tables */
    table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* Stack header */
    header { flex-direction: column; align-items: flex-start; gap: 8px; }
    header h1 { font-size: 18px; }

    /* Auth card padding */
    .auth-card { padding: 24px 16px; }
    .auth-card form { flex-direction: column; }

    /* Settings */
    .form-group input { max-width: 100%; }
    #change-password-form { flex-direction: column; }
    #change-password-form button { width: 100%; }

    /* Events controls */
    .events-controls { flex-wrap: wrap; }
    .events-controls select { flex: 1; min-width: 120px; }
}
