:root {
    --primary-color: #4facfe;
    --secondary-color: #00f2fe;
    --bg-dark: #0f172a;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-white: #ffffff;
    --text-muted: #94a3b8;
    --error-color: #ef4444;
    --success-color: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background: var(--bg-dark);
    background-image: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-white);
    overflow-x: hidden;
}

.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../images/bg.jpg') center/cover no-repeat;
    opacity: 0.4;
    z-index: -1;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2.5rem;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #4facfe, #00f2fe);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

p.subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(79, 172, 254, 0.2);
}

button {
    width: 100%;
    background: linear-gradient(to right, #4facfe 0%, #00f2fe 100%);
    border: none;
    border-radius: 12px;
    padding: 1rem;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(79, 172, 254, 0.4);
}

button:active {
    transform: translateY(0);
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error-color);
    color: var(--error-color);
    padding: 0.75rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    text-align: center;
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Dashboard UI */
.dashboard-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
    max-width: 1200px;
    width: 100%;
}

.menu-item {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
    border-color: var(--primary-color);
}

.menu-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.menu-title {
    font-weight: 600;
}

/* Tablet / Mobile tweaks */
@media (max-width: 768px) {
    .glass-card {
        padding: 2rem;
        margin: 1rem;
    }
}

/* iframe mode - conserva el fondo oscuro pero resetea el layout redundante */
body.is-iframe {
    padding-top: 0 !important;
    min-height: 100% !important;
    justify-content: flex-start !important;
    align-items: flex-start !important;
}
body.is-iframe .background-overlay {
    display: none !important;
}
body.is-iframe .header {
    padding-top: 1rem !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
    min-height: 0 !important;
    display: flex;
    justify-content: flex-end;
}
body.is-iframe .header > div:first-child,
body.is-iframe .header .logout-btn,
body.is-iframe .back-btn {
    display: none !important;
}
body.is-iframe .table-container {
    margin-top: 0 !important;
}
body.is-iframe .dashboard-container {
    margin-top: 0 !important;
}
/* Items Table for Pedidos/Ventas */
.items-table th {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary-color);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.items-table td {
    padding: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.items-table input {
    background: transparent;
    border: 1px solid transparent;
    padding: 0.4rem;
    border-radius: 4px;
}
.items-table input:hover, .items-table input:focus {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--glass-border);
}
.item-total {
    text-align: right;
    font-weight: bold;
    color: var(--primary-color);
}
