* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0a0a0a;
    --surface: #141414;
    --surface2: #1e1e1e;
    --border: #2a2a2a;
    --text: #e0e0e0;
    --text2: #888;
    --accent: #6c5ce7;
    --accent2: #a29bfe;
    --success: #00b894;
    --danger: #ff4757;
    --warning: #ffa502;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Screens */
.screen { display: none; }
.screen.active { display: block; }

/* Login */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.login-container h1 {
    font-size: 32px;
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text2);
    margin-bottom: 32px;
}

.login-container input {
    width: 100%;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 16px;
    margin-bottom: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.login-container input:focus {
    border-color: var(--accent);
}

#login-btn {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

#login-btn:active { opacity: 0.8; }

.error {
    color: var(--danger);
    margin-top: 12px;
    font-size: 14px;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

header h2 {
    font-size: 18px;
    font-weight: 600;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.icon-btn:active {
    background: var(--surface2);
}

/* Navigation */
nav {
    display: flex;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 20px;
}

.nav-btn {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0.5;
}

.nav-btn.active {
    border-bottom-color: var(--accent);
    opacity: 1;
}

/* Tabs */
.tab { display: none; padding: 16px 20px; }
.tab.active { display: block; }

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 12px;
}

.card h3 {
    font-size: 15px;
    color: var(--text2);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    background: var(--surface2);
    border-radius: 12px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent2);
}

.stat-label {
    font-size: 12px;
    color: var(--text2);
    margin-top: 4px;
}

/* Traffic List */
.traffic-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.traffic-item:last-child { border-bottom: none; }

.traffic-name {
    font-weight: 500;
}

.traffic-value {
    color: var(--accent2);
    font-weight: 600;
    font-size: 14px;
}

.traffic-connections {
    color: var(--text2);
    font-size: 12px;
}

/* User Cards */
.user-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.user-card:active {
    border-color: var(--accent);
}

.user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.user-name {
    font-weight: 600;
    font-size: 16px;
}

.user-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text2);
}

.user-status.online {
    background: var(--success);
}

.user-info {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text2);
}

.user-link {
    margin-top: 12px;
    padding: 10px 12px;
    background: var(--surface2);
    border-radius: 8px;
    font-size: 11px;
    word-break: break-all;
    color: var(--text2);
    position: relative;
    cursor: pointer;
}

.user-link:active {
    background: var(--border);
}

.copy-hint {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
}

/* Form */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text2);
    margin-bottom: 6px;
}

input[type="text"],
input[type="number"],
input[type="date"] {
    width: 100%;
    padding: 12px 14px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
    margin-bottom: 12px;
}

input:focus {
    border-color: var(--accent);
}

.primary-btn {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    margin-bottom: 8px;
}

.primary-btn:active { opacity: 0.8; }

.danger-btn {
    width: 100%;
    padding: 14px;
    background: transparent;
    border: 1px solid var(--danger);
    border-radius: 12px;
    color: var(--danger);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.danger-btn:active {
    background: var(--danger);
    color: white;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 100;
    justify-content: center;
    align-items: flex-end;
}

.modal.active {
    display: flex;
}

.modal-content {
    width: 100%;
    max-width: 480px;
    background: var(--surface);
    border-radius: 20px 20px 0 0;
    padding: 24px 20px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 18px;
    color: var(--text);
}

/* Result */
#add-result {
    margin-top: 16px;
}

.result-success {
    padding: 16px;
    background: rgba(0, 184, 148, 0.1);
    border: 1px solid var(--success);
    border-radius: 12px;
}

.result-success .link {
    margin-top: 8px;
    padding: 10px;
    background: var(--surface2);
    border-radius: 8px;
    font-size: 11px;
    word-break: break-all;
    color: var(--accent2);
    cursor: pointer;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 14px;
    z-index: 200;
    animation: fadeInOut 2s ease;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateX(-50%) translateY(20px); }
    15% { opacity: 1; transform: translateX(-50%) translateY(0); }
    85% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
