@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg-color: #f8fafc; --card-bg: #ffffff; --text-main: #1e293b; --text-sub: #64748b;
    --input-bg: #f8fafc; --input-border: #e2e8f0; --btn-primary: #6366f1; --btn-dark: #334155;
    --modal-overlay: rgba(0,0,0,0.5);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #0f172a; --card-bg: #1e293b; --text-main: #f1f5f9; --text-sub: #94a3b8;
        --input-bg: #0f172a; --input-border: #334155; --btn-primary: #818cf8; --btn-dark: #475569;
        --modal-overlay: rgba(0,0,0,0.8);
    }
}

body { font-family: 'Inter', sans-serif; background-color: var(--bg-color); margin: 0; display: flex; justify-content: center; align-items: center; min-height: 100dvh; color: var(--text-main); transition: 0.3s; touch-action: manipulation; }
.main-wrapper { width: 100%; max-width: 420px; padding: 15px; box-sizing: border-box; }
.hidden { display: none !important; }

/* TOAST */
.toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); background: var(--btn-dark); color: white; padding: 12px 25px; border-radius: 50px; font-size: 14px; font-weight: 600; z-index: 1000; box-shadow: 0 10px 25px rgba(0,0,0,0.2); text-align: center; min-width: 220px; }
.toast.success { background: #10b981; } .toast.error { background: #ef4444; }

/* EXIT */
.btn-exit-top { position: absolute; top: 15px; right: 15px; background: #fee2e2; color: #ef4444; border: none; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 100; }

/* CARDS */
.card { background: var(--card-bg); padding: 35px 30px; border-radius: 24px; box-shadow: 0 10px 40px rgba(0,0,0,0.05); text-align: center; width: 100%; box-sizing: border-box; }
.my-logo { width: 85px; height: 85px; border-radius: 50%; margin-bottom: 15px; border: 2px solid var(--input-border); }
h1 { font-size: 20px; color: var(--text-main); line-height: 1.3; margin: 10px 0; }
.logo-area p { color: var(--text-sub); font-size: 14px; margin-bottom: 30px; }

/* INPUTS */
.input-box { position: relative; margin-bottom: 15px; }
.input-box i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--text-sub); }
.input-box input { width: 100%; padding: 14px 14px 14px 45px; border: 1px solid var(--input-border); border-radius: 12px; background: var(--input-bg); color: var(--text-main); font-size: 15px; outline: none; box-sizing: border-box; }
#userName, #editName { text-transform: uppercase; }

.btn-primary, .btn-dark { width: 100%; padding: 15px; color: white; border: none; border-radius: 12px; font-weight: 600; font-size: 16px; cursor: pointer; transition: 0.2s; }
.btn-primary { background: var(--btn-primary); }
.btn-dark { background: var(--btn-dark); }
.switch-link { margin-top: 20px; font-size: 13px; color: var(--text-sub); cursor: pointer; text-decoration: underline; display: block; }

/* SCREENS */
.app-screen { background: var(--card-bg); border-radius: 20px; padding: 25px; box-shadow: 0 10px 30px rgba(0,0,0,0.05); width: 100%; box-sizing: border-box; position: relative; }
.content-card-user { background: var(--btn-primary); border-radius: 20px; padding: 30px 20px; text-align: center; color: white; }
.btn-mega-action { background: #10b981; color: white; border: none; padding: 20px; border-radius: 15px; font-weight: 700; font-size: 18px; width: 100%; cursor: pointer; margin-top: 15px; box-shadow: 0 8px 20px rgba(0,0,0,0.1); }
.status-success-user { background: rgba(255,255,255,0.2); padding: 15px; border-radius: 12px; margin-top: 15px; font-weight: bold; width: 100%; box-sizing: border-box; }

/* ADMIN UI */
.admin-master-box { background: var(--input-bg); padding: 15px; border-radius: 15px; margin-bottom: 15px; border: 1px solid var(--input-border); }
.admin-master-box label { font-size: 11px; font-weight: 700; color: var(--text-sub); text-transform: uppercase; display: block; margin-bottom: 8px; }
.admin-row { display: flex; gap: 8px; }
.admin-row select, .admin-row input { flex: 1; padding: 10px; border-radius: 10px; border: 1px solid var(--input-border); background: var(--card-bg); color: var(--text-main); font-size: 14px; outline: none; }
.btn-save-code { background: var(--btn-primary); color: white; border: none; padding: 0 15px; border-radius: 10px; cursor: pointer; }

.tab-buttons { display: flex; gap: 8px; margin-bottom: 15px; background: var(--input-bg); padding: 5px; border-radius: 12px; }
.tab-buttons button { flex: 1; border: none; background: none; padding: 12px; color: var(--text-sub); font-weight: 600; cursor: pointer; border-radius: 8px; font-size: 13px; }
.tab-buttons button.active { background: var(--card-bg); color: var(--btn-primary); box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.tab-buttons b { background: var(--btn-primary); color: white; padding: 2px 6px; border-radius: 5px; margin-left: 5px; font-size: 11px; }

/* LISTS */
.user-item { display: flex; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--input-border); cursor: pointer; }
.user-index { font-weight: 700; color: var(--btn-primary); min-width: 25px; margin-right: 10px; font-size: 14px; margin-top: 2px; }
.user-info { display: flex; flex-direction: column; }
.user-info strong { font-size: 15px; color: var(--text-main); font-weight: 700; }
.user-info small { font-size: 13px; color: var(--text-sub); margin-top: 2px; }

/* MODALS */
.modal { position: fixed; inset: 0; background: var(--modal-overlay); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 20px; }
.modal-card { background: var(--card-bg); width: 100%; max-width: 380px; border-radius: 20px; padding: 20px; box-sizing: border-box; max-height: 85vh; overflow-y: auto; }
.btn-close-modal { background: var(--input-bg); border: none; width: 32px; height: 32px; border-radius: 50%; color: var(--text-sub); cursor: pointer; float: right; }
.btn-sub-action { width: 100%; padding: 12px; border-radius: 12px; border: 1px solid var(--input-border); background: var(--input-bg); color: var(--text-main); margin-top: 10px; font-weight: 600; cursor: pointer; }
.btn-danger-text { color: #ef4444; border-color: #fee2e2; }

/* SUPER ADMIN */
.super-box { border-top: 2px dashed var(--input-border); margin-top: 20px; padding-top: 15px; }
.danger-zone { margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--input-border); display: flex; flex-direction: column; gap: 8px; }
.btn-danger-soft { background: #fee2e2; color: #dc2626; border: 1px solid #fecaca; padding: 10px; border-radius: 8px; font-size: 12px; font-weight: 700; cursor: pointer; }
.super-confirm-box { background: #450a0a; color: white; padding: 15px; border-radius: 12px; margin-top: 15px; border: 2px solid #ef4444; }
.super-confirm-box input { width: 100%; padding: 10px; border-radius: 8px; margin-bottom: 5px; background: rgba(255,255,255,0.1); color: white; border: none; outline: none; box-sizing: border-box; }
.btn-warning-small, .btn-danger-small { width: 100%; padding: 10px; color: white; border: none; border-radius: 8px; margin-bottom: 8px; cursor: pointer; font-weight: 600; }
.btn-warning-small { background: #f59e0b; }
.btn-danger-small { background: #ef4444; }