:root {
    --bg: #f8fafc;
    --card: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --border: #e2e8f0;
    --error: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
}

[data-theme="dark"] {
    --bg: #0f172a;
    --card: #1e293b;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --border: #334155;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', system-ui, sans-serif; transition: background 0.3s, color 0.3s; }

body { background: var(--bg); color: var(--text); line-height: 1.5; }

.screen { display: none; min-height: 100vh; padding: 20px; }
.screen.active { display: block; }

/* 🔐 LOGIN */
.login-card { max-width: 400px; margin: 10vh auto; padding: 40px; background: var(--card); border-radius: 16px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); border: 1px solid var(--border); }
.login-header { text-align: center; margin-bottom: 30px; }
.login-header h1 { font-size: 2rem; font-weight: 800; color: var(--accent); }
.login-header span { color: var(--text); }

/* 🚛 LAYOUT */
.appbar { display: flex; justify-content: space-between; align-items: center; padding: 15px 30px; background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.brand { font-size: 1.2rem; font-weight: 700; }
.brand strong { color: var(--accent); }

.tabnav { display: flex; gap: 10px; padding: 20px 30px; overflow-x: auto; }
.tnav { padding: 10px 20px; border: none; background: transparent; color: var(--text-muted); font-weight: 600; cursor: pointer; border-radius: 8px; white-space: nowrap; }
.tnav.active { background: var(--accent); color: white; }

.card { background: var(--card); border-radius: 12px; border: 1px solid var(--border); margin-bottom: 20px; overflow: hidden; }

/* 📝 FORMULARIOS */
.fld { margin-bottom: 15px; }
.fld label { display: block; font-size: 0.85rem; margin-bottom: 5px; color: var(--text-muted); font-weight: 600; }
input, select, textarea { width: 100%; padding: 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); outline: none; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

.btn-main { width: 100%; padding: 14px; border: none; border-radius: 8px; background: var(--accent); color: white; font-weight: 700; cursor: pointer; transition: 0.2s; }
.btn-main:hover { background: var(--accent-hover); transform: translateY(-1px); }

/* 📊 TABLAS */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 15px; background: var(--bg); font-size: 0.85rem; color: var(--text-muted); border-bottom: 1px solid var(--border); }
td { padding: 15px; border-bottom: 1px solid var(--border); font-size: 0.9rem; }

/* 🖨️ PRINTING */
@media print {
    body * { visibility: hidden; }
    #pz-ticket, #pz-ticket * { visibility: visible; }
    #pz-ticket { position: absolute; left: 0; top: 0; width: 100%; color: black !important; }
}

/* 📱 MOBILE */
@media (max-width: 600px) {
    .login-card { margin: 20px; padding: 25px; }
    .appbar { padding: 15px; }
}
