:root {
    --bg: #0f0f13;
    --bg2: #17171f;
    --bg3: #1e1e2a;
    --accent: #6c63ff;
    --accent2: #4e46e5;
    --text: #e8e8f0;
    --text2: #9090a8;
    --border: #2a2a38;
    --success: #22c55e;
    --danger: #ef4444;
    --radius: 16px;
    --radius-sm: 10px;
}

body.light {
    --bg: #f0f2f8;
    --bg2: #ffffff;
    --bg3: #e8eaf2;
    --text: #1a1a2e;
    --text2: #6b6b80;
    --border: #d0d0e0;
}

body.light .profile-card {
    background: linear-gradient(135deg, #4e46e5, #818cf8);
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Nunito', sans-serif;
    min-height: 100vh;
    padding: 20px 16px;
}

/* HEADER */
.header {
    display: flex; align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.header-logo { display: flex; align-items: center; gap: 10px; }
.header-logo .avatar {
    width: 42px; height: 42px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.header-logo .title { font-size: 18px; font-weight: 800; letter-spacing: -0.5px; }
.header-logo .subtitle { font-size: 12px; color: var(--text2); margin-top: 1px; }
.header-btn {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--bg3); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; cursor: pointer; transition: background 0.2s;
}
.header-btn:hover { background: var(--border); }

/* BACK BUTTON */
.back-btn {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--bg3); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; cursor: pointer; color: var(--text);
}

/* PROFILE CARD */
.profile-card {
    background: linear-gradient(135deg, var(--accent2), var(--accent));
    border-radius: var(--radius); padding: 20px;
    margin-bottom: 20px; position: relative; overflow: hidden;
}
.profile-card::before {
    content: ''; position: absolute;
    top: -30px; right: -30px; width: 120px; height: 120px;
    border-radius: 50%; background: rgba(255,255,255,0.08);
}
.profile-card::after {
    content: ''; position: absolute;
    bottom: -20px; right: 30px; width: 80px; height: 80px;
    border-radius: 50%; background: rgba(255,255,255,0.05);
}
.profile-card .name { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.profile-card .id { font-size: 13px; opacity: 0.8; margin-bottom: 16px; }
.profile-card .stats { display: flex; gap: 12px; }
.profile-card .stat {
    background: rgba(255,255,255,0.15); border-radius: var(--radius-sm);
    padding: 8px 14px; font-size: 13px; font-weight: 700;
}
.profile-card .stat span {
    display: block; font-size: 11px; font-weight: 400; opacity: 0.8; margin-bottom: 2px;
}

/* GURUH CARD */
.guruh-card {
    background: linear-gradient(135deg, #0f4c8a, #1a7fd4);
    border-radius: var(--radius); padding: 20px;
    margin-bottom: 16px; position: relative; overflow: hidden;
}
.guruh-card::before {
    content: ''; position: absolute;
    top: -30px; right: -30px; width: 120px; height: 120px;
    border-radius: 50%; background: rgba(255,255,255,0.08);
}
.guruh-card::after {
    content: ''; position: absolute;
    bottom: -20px; right: 30px; width: 80px; height: 80px;
    border-radius: 50%; background: rgba(255,255,255,0.05);
}
.guruh-card .gname { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.guruh-card .gtype { font-size: 13px; opacity: 0.8; margin-bottom: 16px; }
.guruh-card .stats { display: flex; gap: 12px; }
.guruh-card .stat {
    background: rgba(255,255,255,0.15); border-radius: var(--radius-sm);
    padding: 8px 14px; font-size: 13px; font-weight: 700;
}
.guruh-card .stat span {
    display: block; font-size: 11px; font-weight: 400; opacity: 0.8; margin-bottom: 2px;
}

/* SECTION TITLE */
.section-title {
    font-size: 13px; font-weight: 700; color: var(--text2);
    text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px;
}

/* MENU LIST */
.menu-list {
    background: var(--bg2); border-radius: var(--radius);
    border: 1px solid var(--border); overflow: hidden; margin-bottom: 20px;
}
.menu-item {
    display: flex; align-items: center; gap: 14px;
    padding: 15px 18px; cursor: pointer; transition: background 0.15s;
    border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text);
}
.menu-item:last-child { border-bottom: none; }
.menu-item:hover { background: var(--bg3); }
.menu-item .icon {
    width: 38px; height: 38px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; flex-shrink: 0;
}
.menu-item .icon.purple { background: rgba(108, 99, 255, 0.2); }
.menu-item .icon.green  { background: rgba(34, 197, 94, 0.2); }
.menu-item .icon.blue   { background: rgba(59, 130, 246, 0.2); }
.menu-item .icon.orange { background: rgba(249, 115, 22, 0.2); }
.menu-item .icon.red    { background: rgba(239, 68, 68, 0.2); }
.menu-item .label { flex: 1; }
.menu-item .label .name { font-size: 15px; font-weight: 700; }
.menu-item .label .desc { font-size: 12px; color: var(--text2); margin-top: 2px; }
.menu-item .arrow { color: var(--text2); font-size: 14px; }
.menu-item .badge {
    background: var(--accent); color: white;
    font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px;
}
.menu-item .badge.green { background: var(--success); }

/* TABS */
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tab-btn {
    flex: 1; padding: 10px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--bg2); color: var(--text2);
    font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 700;
    cursor: pointer; transition: all 0.2s; text-align: center;
}
.tab-btn.active { background: var(--accent); border-color: var(--accent); color: white; }
.tab-btn .count {
    display: inline-block; background: rgba(255,255,255,0.2);
    border-radius: 20px; padding: 1px 7px; font-size: 12px; margin-left: 4px;
}
.tab-btn:not(.active) .count { background: var(--bg3); color: var(--text2); }

/* SEARCH */
.search-box { margin-bottom: 12px; }
.search-input {
    width: 100%; background: var(--bg2); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 12px 16px; color: var(--text);
    font-family: 'Nunito', sans-serif; font-size: 15px; outline: none;
    transition: border-color 0.2s;
}
.search-input::placeholder { color: var(--text2); }
.search-input:focus { border-color: var(--accent); }

/* START BUTTON */
.start-btn {
    width: 100%; padding: 16px; border-radius: var(--radius); border: none;
    font-family: 'Nunito', sans-serif; font-size: 16px; font-weight: 800;
    cursor: pointer; transition: all 0.2s; margin-bottom: 16px;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.start-btn.start {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white; box-shadow: 0 4px 20px rgba(34,197,94,0.3);
}
.start-btn.stop {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white; box-shadow: 0 4px 20px rgba(239,68,68,0.3);
}
.start-btn:active { transform: scale(0.97); }
.start-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* MODAL */
.modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.7); z-index: 100; align-items: flex-end;
}
.modal-overlay.show { display: flex; }
.modal {
    background: var(--bg2); border-radius: var(--radius) var(--radius) 0 0;
    padding: 24px 20px; width: 100%; animation: slideUp 0.3s ease;
}
@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
.modal-title {
    font-size: 18px; font-weight: 800; margin-bottom: 20px;
    display: flex; align-items: center; justify-content: space-between;
}
.modal-close {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--bg3); border: none; color: var(--text2);
    font-size: 18px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}

/* FORM */
.form-group { margin-bottom: 16px; }
.form-label { font-size: 13px; font-weight: 700; color: var(--text2); margin-bottom: 8px; display: block; }
.form-input, .form-textarea {
    width: 100%; background: var(--bg3); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 12px 16px; color: var(--text);
    font-family: 'Nunito', sans-serif; font-size: 15px; outline: none;
    transition: border-color 0.2s;
}
.form-textarea { resize: none; height: 100px; }
.form-input:focus, .form-textarea:focus { border-color: var(--accent); }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }
.save-btn {
    width: 100%; padding: 14px; border-radius: var(--radius-sm); border: none;
    background: linear-gradient(135deg, var(--accent2), var(--accent));
    color: white; font-family: 'Nunito', sans-serif;
    font-size: 16px; font-weight: 800; cursor: pointer; margin-top: 8px; transition: opacity 0.2s;
}
.save-btn:active { opacity: 0.8; }

/* MISC */
.guruh-count { font-size: 13px; color: var(--text2); margin-bottom: 10px; }
.empty { text-align: center; color: var(--text2); padding: 40px 0; font-size: 15px; }
.spinner { font-size: 30px; animation: spin 1s linear infinite; display: block; margin-bottom: 10px; text-align: center; }
@keyframes spin { to { transform: rotate(360deg); } }
.faol-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.faol-dot.faol { background: #22c55e; }
.faol-dot.toxtatilgan { background: #ef4444; }
.bottom-space { height: 20px; }