/* DesiXXX Standalone - Dark theme matching Vidgrid style */

:root {
    --bg-deep: #0b0e17;
    --bg-card: #12161f;
    --bg-input: #1a1f2b;
    --accent: #7c5cfc;
    --accent-hover: #6a4ae8;
    --text: #e8eaf0;
    --text-muted: #8b93a7;
    --border: #2a3142;
    --success: #22c55e;
    --error: #ef4444;
    --radius: 16px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Bengali", sans-serif;
    background: linear-gradient(160deg, #0b0e17 0%, #151a28 50%, #0d111c 100%);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}

/* ========== LOGIN (PIN) ========== */
.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(ellipse at top, #1a1235 0%, #0b0e17 55%);
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-header .brand {
    font-size: 13px;
    letter-spacing: 2px;
    color: #a78bfa;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.login-header h1 {
    font-size: 26px;
    font-weight: 700;
    background: linear-gradient(90deg, #c4b5fd, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-header p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 6px;
    max-width: 320px;
}

.login-card {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 32px 28px 28px;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.45);
    border: 1px solid rgba(124, 92, 252, 0.15);
}

.login-card h2 {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
}

.login-card .hint {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 22px;
}

.pin-display {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
    min-height: 28px;
}

.pin-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #4b5563;
    background: transparent;
    transition: all 0.15s;
}

.pin-dot.filled {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 8px rgba(124, 92, 252, 0.5);
}

.pin-text {
    text-align: center;
    font-size: 22px;
    letter-spacing: 8px;
    font-family: monospace;
    color: var(--accent);
    min-height: 28px;
    margin-bottom: 8px;
}

.toggle-visibility {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    margin-bottom: 20px;
    user-select: none;
}

.toggle-visibility:hover {
    color: #c4b5fd;
}

.numpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.num-btn {
    aspect-ratio: 1;
    border-radius: 50%;
    border: none;
    background: #1e2433;
    color: #fff;
    font-size: 24px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.12s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.num-btn:hover {
    background: #2a3145;
    transform: scale(1.04);
}

.num-btn:active {
    transform: scale(0.96);
    background: #343b52;
}

.num-btn.action {
    color: #a78bfa;
    font-size: 18px;
}

.num-btn.action.back {
    font-size: 20px;
}

.login-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #7c5cfc, #6d28d9);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.login-btn:hover {
    filter: brightness(1.1);
    box-shadow: 0 6px 20px rgba(124, 92, 252, 0.4);
}

.login-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.error-msg {
    text-align: center;
    color: var(--error);
    font-size: 13px;
    margin-top: 12px;
    min-height: 18px;
}

/* ========== DASHBOARD ========== */
.app-header {
    background: rgba(18, 22, 31, 0.9);
    border-bottom: 1px solid var(--border);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    backdrop-filter: blur(10px);
    z-index: 50;
}

.app-header .logo {
    font-weight: 700;
    font-size: 16px;
    color: #c4b5fd;
}

.app-header .logo span {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 13px;
}

.app-header a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    margin-left: 16px;
}

.app-header a:hover {
    color: #c4b5fd;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 28px 20px 60px;
}

h1.page-title {
    font-size: 24px;
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 28px;
    font-size: 14px;
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 24px;
    margin-bottom: 24px;
}

.card h2 {
    font-size: 18px;
    margin-bottom: 16px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 10px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-danger {
    background: #7f1d1d;
    color: #fecaca;
}

.btn-danger:hover {
    background: #991b1b;
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    border-color: var(--accent);
    color: #c4b5fd;
}

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

table.presets {
    width: 100%;
    border-collapse: collapse;
}

table.presets th,
table.presets td {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

table.presets th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table.presets tr:hover td {
    background: rgba(124, 92, 252, 0.04);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 700px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="url"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 14px;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.2);
}

.form-group textarea {
    min-height: 120px;
    font-family: ui-monospace, monospace;
    font-size: 12px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.msg {
    padding: 8px 0;
    font-size: 14px;
}

.msg.success { color: var(--success); }
.msg.error { color: var(--error); }
.msg.small { font-size: 12px; color: var(--text-muted); }

.btn-download {
    display: inline-block;
    margin-top: 6px;
    padding: 8px 16px;
    background: var(--accent);
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
}

.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-success {
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.alert-error {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.badge-on {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.badge-off {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.actions-cell {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.actions-cell form {
    display: inline;
}

.tabs { display:flex; gap:8px; margin-bottom:20px; flex-wrap:wrap; }
.tabs a {
  padding:8px 14px; border-radius:8px; text-decoration:none;
  color:var(--text-muted); border:1px solid var(--border); font-size:13px;
}
.tabs a.active, .tabs a:hover { color:#c4b5fd; border-color:var(--accent); background:rgba(124,92,252,.08); }
.log-table { width:100%; font-size:12px; border-collapse:collapse; }
.log-table td, .log-table th { padding:8px; border-bottom:1px solid var(--border); text-align:left; }
.level-error { color:#f87171; }
.level-success { color:#4ade80; }
.level-warning { color:#fbbf24; }
.level-info { color:#94a3b8; }
.stats { display:flex; gap:12px; flex-wrap:wrap; margin-bottom:16px; }
.stat { background:var(--bg-input); padding:12px 16px; border-radius:10px; min-width:100px; }
.stat strong { display:block; font-size:20px; }
.stat span { font-size:11px; color:var(--text-muted); }
