/* invoGatto PWA Styles */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #16a34a;
    --danger: #dc2626;
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.screen {
    display: none;
    min-height: 100vh;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

/* Login */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container h1 {
    font-size: 2rem;
    margin-bottom: 8px;
    color: var(--primary);
}

.login-container p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

#login-form {
    width: 100%;
    max-width: 320px;
}

#login-form input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 12px;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary:active {
    background: var(--primary-dark);
}

.btn-secondary {
    padding: 8px 16px;
    background: var(--border);
    color: var(--text);
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

.error {
    color: var(--danger);
    margin-top: 12px;
    text-align: center;
}

.hidden {
    display: none;
}

/* Main Layout */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

header h1 {
    font-size: 1.25rem;
    color: var(--primary);
}

nav {
    display: flex;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.nav-btn {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.nav-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.view {
    display: none;
    padding: 16px;
    flex: 1;
}

.view.active {
    display: block;
}

/* Stock List */
.stock-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stock-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
}

.stock-item h3 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.stock-item .meta {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.stock-item .quantity {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 8px;
}

/* Scan Area */
.scan-area {
    margin-bottom: 16px;
}

.btn-scan {
    width: 100%;
    padding: 16px;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.btn-scan:active {
    background: #15803d;
}

.camera-container {
    margin-top: 12px;
    border-radius: 8px;
    overflow: hidden;
}

/* Forms */
select, input[type="number"], input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 12px;
    background: var(--surface);
}

/* Result */
.result {
    margin-top: 16px;
    padding: 16px;
    border-radius: 8px;
    font-weight: 500;
}

.result.success {
    background: #dcfce7;
    color: var(--success);
    border: 1px solid var(--success);
}

.result.error {
    background: #fef2f2;
    color: var(--danger);
    border: 1px solid var(--danger);
}

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

.empty-state p {
    margin-top: 8px;
}

/* User Management */
.badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    vertical-align: middle;
}

.btn-small {
    margin-top: 8px;
    padding: 6px 12px;
    font-size: 13px;
}

/* Status bar */
.status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 8px 16px;
    display: none;
    justify-content: flex-end;
    align-items: center;
    z-index: 100;
    font-size: 12px;
    color: var(--text-muted);
}

.status-bar.visible {
    display: flex;
}

.status-version {
    padding-right: 5px;
}

/* Hamburger Menu */
.btn-menu {
    padding: 8px 12px;
    background: var(--border);
    border: none;
    border-radius: 6px;
    font-size: 18px;
    cursor: pointer;
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    justify-content: flex-end;
    z-index: 1000;
}

.menu-overlay.hidden {
    display: none !important;
}

.menu {
    background: var(--surface);
    width: 220px;
    height: 100%;
    padding: 16px;
    box-shadow: -2px 0 8px rgba(0,0,0,0.1);
}

.menu-item {
    width: 100%;
    padding: 12px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    margin-bottom: 8px;
}

.menu-item:active {
    background: var(--border);
}

