/* Neuhoff Inventory System - Premium Executive Design */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

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

:root {
    /* Premium Color Palette - Deep Blues & Teals */
    --primary: #0ea5e9;
    --primary-dark: #0284c7;
    --primary-light: #38bdf8;
    --secondary: #06b6d4;
    --accent: #14b8a6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    /* Dark Palette */
    --navy-900: #0f172a;
    --navy-800: #1e293b;
    --navy-700: #334155;
    --navy-600: #475569;
    
    /* Light Palette */
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #14b8a6 100%);
    --gradient-dark: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-glow: 0 0 50px rgba(14, 165, 233, 0.3);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--navy-900);
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
}

/* Responsive utilities */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.responsive-grid-2 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.responsive-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 1024px) {
    .responsive-grid-2 {
        grid-template-columns: 1fr;
    }
    
    .responsive-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .responsive-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* Login Page */
.login-page {
    background: var(--navy-900);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.15) 0%, transparent 70%);
    top: -250px;
    right: -250px;
    animation: pulse 8s ease-in-out infinite;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.1) 0%, transparent 70%);
    bottom: -200px;
    left: -200px;
    animation: pulse 10s ease-in-out infinite 2s;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.login-container {
    width: 100%;
    max-width: 500px;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.login-box {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(40px);
    border-radius: 2rem;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4), 0 0 100px rgba(14, 165, 233, 0.1);
    padding: 4rem 3rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 3rem;
}

.login-logo {
    margin-bottom: 2.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-logo img {
    max-width: 180px;
    max-height: 90px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.15));
}

.login-header h1 {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--navy-900);
    margin-bottom: 0.75rem;
    letter-spacing: -0.04em;
}

.login-header p {
    color: var(--navy-600);
    font-size: 1.0625rem;
    font-weight: 400;
}

.login-form {
    margin-bottom: 2rem;
}

.login-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--slate-200);
    text-align: center;
    color: var(--navy-600);
    font-size: 0.875rem;
}

/* Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 75px;
}

.nav-brand a {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    letter-spacing: -0.03em;
    transition: all 0.3s ease;
}

.nav-brand a:hover {
    transform: scale(1.02);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.25rem;
    align-items: center;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    color: var(--navy-700);
    text-decoration: none;
    padding: 0.75rem 1.25rem;
    display: block;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

.nav-menu a:hover {
    color: var(--primary);
    background: var(--slate-100);
}

/* Hamburger Menu Toggle - Hidden on Desktop */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.nav-toggle span {
    width: 100%;
    height: 3px;
    background: var(--navy-900);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
    transform: translateY(10.5px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: translateY(-10.5px) rotate(-45deg);
}

/* Prevent body scroll when menu is open */
body.menu-open {
    overflow: hidden;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    box-shadow: var(--shadow-xl);
    border-radius: 1rem;
    min-width: 240px;
    padding: 0.75rem;
    list-style: none;
    border: 1px solid var(--slate-200);
    animation: slideDown 0.2s ease;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    margin-top: -2px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown:hover .dropdown-menu,
.dropdown-menu:hover {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu a {
    padding: 0.875rem 1.25rem;
    display: block;
    color: var(--navy-700);
    border-radius: 0.625rem;
    font-weight: 500;
}

.dropdown-menu a:hover {
    background: var(--slate-100);
    color: var(--primary);
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 3rem 2rem;
}

/* Page Headers */
.page-header {
    margin-bottom: 3rem;
    background: white;
    padding: 2.5rem;
    border-radius: 1.5rem;
    box-shadow: var(--shadow-md);
}

.page-header h1 {
    font-size: 2.75rem;
    font-weight: 900;
    color: var(--navy-900);
    margin-bottom: 0.75rem;
    letter-spacing: -0.04em;
    line-height: 1.1;
}

.page-header p {
    color: var(--navy-600);
    font-size: 1.125rem;
    font-weight: 400;
}

/* Forms */
.form-group {
    margin-bottom: 1.75rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.625rem;
    font-weight: 700;
    color: var(--navy-900);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-control {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid var(--slate-300);
    border-radius: 0.875rem;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: white;
    color: var(--navy-900);
    font-weight: 500;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

/* Buttons */
.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 0.875rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    text-align: center;
    white-space: nowrap;
    letter-spacing: 0.025em;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 10px 25px rgba(14, 165, 233, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(14, 165, 233, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--navy-700);
    color: white;
}

.btn-secondary:hover {
    background: var(--navy-800);
    transform: translateY(-2px);
}

.btn-success {
    background: var(--gradient-success);
    color: white;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-block {
    width: 100%;
    display: flex;
}

.btn-sm {
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
}

/* Alerts */
.alert {
    padding: 1.25rem 1.5rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
    border-left: 4px solid;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.alert-success {
    background: #d1fae5;
    border-color: var(--success);
    color: #065f46;
}

.alert-danger {
    background: #fee2e2;
    border-color: var(--danger);
    color: #991b1b;
}

.alert-warning {
    background: #fef3c7;
    border-color: var(--warning);
    color: #92400e;
}

.alert-info {
    background: #cffafe;
    border-color: var(--secondary);
    color: #155e75;
}

/* Cards */
.card {
    background: white;
    border-radius: 1.5rem;
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    border: 1px solid var(--slate-200);
}

.card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
}

.card-header {
    font-size: 1.375rem;
    font-weight: 800;
    color: var(--navy-900);
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 3px solid var(--slate-100);
    letter-spacing: -0.03em;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--gradient-primary);
    padding: 2.5rem;
    border-radius: 1.5rem;
    box-shadow: 0 20px 40px rgba(14, 165, 233, 0.25);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    color: white;
}

.stat-card::before {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
    top: -100px;
    right: -100px;
    transition: all 0.5s ease;
}

.stat-card:hover::before {
    top: -80px;
    right: -80px;
    width: 240px;
    height: 240px;
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 30px 60px rgba(14, 165, 233, 0.35), var(--shadow-glow);
}

.stat-card h3 {
    font-size: 0.875rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    position: relative;
    z-index: 1;
}

.stat-card .stat-value {
    font-size: 3.5rem;
    font-weight: 900;
    color: white;
    letter-spacing: -0.04em;
    position: relative;
    z-index: 1;
    line-height: 1;
}

/* Tables */
.table-container {
    overflow-x: auto;
    background: white;
    border-radius: 1.5rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--slate-200);
}

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

thead {
    background: var(--gradient-dark);
}

th {
    padding: 1.25rem 1.75rem;
    text-align: left;
    font-weight: 800;
    color: white;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: none;
}

th a {
    color: white;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

th a:hover {
    opacity: 0.8;
}

td {
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid var(--slate-200);
    color: var(--navy-900);
    font-weight: 500;
}

tbody tr {
    transition: all 0.2s ease;
}

tbody tr:hover {
    background: var(--slate-50);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.badge-primary {
    background: rgba(14, 165, 233, 0.1);
    color: var(--primary-dark);
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: #065f46;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #991b1b;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #92400e;
}

.badge-secondary {
    background: var(--slate-100);
    color: var(--navy-700);
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 3rem 2rem;
    margin-top: auto;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
    color: var(--navy-600);
    font-size: 0.9375rem;
    font-weight: 500;
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.flex { display: flex; }

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-gap {
    gap: 1rem;
}

/* Responsive */
/* ==========================================
   RESPONSIVE DESIGN - TABLET & MOBILE
   ========================================== */

/* Tablet Landscape & Small Desktop (max-width: 1024px) */
@media (max-width: 1024px) {
    /* Two-column grids become single column */
    [style*="grid-template-columns: 2fr 1fr"],
    [style*="grid-template-columns: 1fr 2fr"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Three-column grids become two columns */
    [style*="grid-template-columns: 1fr 1fr 1fr"] {
        grid-template-columns: 1fr 1fr !important;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Tables scroll horizontally */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 600px;
    }
    
    /* Touch-friendly buttons */
    .btn, button, a.btn {
        min-height: 44px;
        padding: 0.75rem 1.5rem;
    }
    
    /* Reduce padding on cards */
    .card {
        padding: 1.5rem;
    }
    
    .page-header {
        padding: 1.5rem;
    }
}

/* Tablet Portrait & Mobile Landscape (max-width: 768px) */
@media (max-width: 768px) {
    /* Show hamburger menu */
    .nav-toggle {
        display: flex;
    }
    
    /* Navigation becomes vertical */
    .nav-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        height: auto;
        padding: 1rem;
    }
    
    .nav-brand {
        z-index: 1001;
    }
    
    /* Hide menu by default, show when active */
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: white;
        flex-direction: column;
        padding: 5rem 1.5rem 2rem 1.5rem;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        overflow-y: auto;
        z-index: 1000;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-menu li {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .nav-menu a {
        font-size: 1rem;
        padding: 1rem;
        width: 100%;
    }
    
    /* Dropdown adjustments for mobile */
    .dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        background: var(--slate-50);
        margin-top: 0.5rem;
        border-radius: 0.75rem;
    }
    
    .dropdown-menu li a {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Show dropdown on click (handled by existing JS) */
    .dropdown:hover .dropdown-menu,
    .dropdown-menu:hover {
        display: block;
        opacity: 1;
        pointer-events: all;
    }
    
    /* All grids become single column */
    .stats-grid,
    .card-grid,
    [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Main content padding */
    .main-content {
        padding: 2rem 1rem;
    }
    
    /* Page headers */
    .page-header {
        padding: 1.5rem 1rem;
    }
    
    .page-header h1 {
        font-size: 1.75rem;
    }
    
    .flex-between {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }
    
    .flex-between > div:last-child {
        width: 100%;
    }
    
    .flex-between a.btn,
    .flex-between button {
        width: 100%;
    }
    
    /* Cards */
    .card {
        padding: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .card-header {
        font-size: 1.125rem;
        padding: 1rem;
        margin: -1.25rem -1.25rem 1.25rem -1.25rem;
    }
    
    /* Login page */
    .login-container {
        padding: 1rem;
        max-width: 100%;
    }
    
    .login-box {
        padding: 2rem 1.5rem;
    }
    
    /* Stat cards */
    .stat-card .stat-value {
        font-size: 2.5rem;
    }
    
    .stat-card .stat-label {
        font-size: 0.875rem;
    }
    
    /* Tables - full scroll */
    .table-container {
        margin: 0 -1.25rem;
        padding: 0 1.25rem;
    }
    
    table {
        font-size: 0.875rem;
    }
    
    th, td {
        padding: 0.75rem 0.5rem;
    }
    
    /* Forms */
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Buttons in forms */
    .flex.flex-gap {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .flex.flex-gap .btn {
        width: 100%;
    }
    
    /* Photo preview grids */
    [id="photoPreview"],
    [style*="grid-template-columns: repeat(auto-fill, minmax(120px"] {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.5rem;
    }
    
    /* Asset cards grid */
    [style*="grid-template-columns: repeat(auto-fill, minmax(280px"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Camera interface */
    #cameraVideo {
        max-height: 60vh;
        object-fit: cover;
    }
    
    /* Action buttons in cards - keep vertical but smaller */
    [style*="flex-direction: column"] .btn {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }
    
    /* Dropdown menus */
    .dropdown-menu {
        position: fixed !important;
        top: auto !important;
        left: 1rem !important;
        right: 1rem !important;
        max-width: none;
        width: auto;
    }
    
    /* Alerts */
    .alert {
        margin: 1rem;
        padding: 1rem;
        font-size: 0.875rem;
    }
    
    /* Dashboard specific */
    .dashboard-header {
        flex-direction: column;
        text-align: center;
    }
    
    /* Badge adjustments */
    .badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Mobile Portrait (max-width: 480px) */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    .page-header p {
        font-size: 0.875rem;
    }
    
    /* Extra small cards */
    .card {
        padding: 1rem;
    }
    
    .card-header {
        font-size: 1rem;
        padding: 0.75rem;
        margin: -1rem -1rem 1rem -1rem;
    }
    
    /* Stat cards even smaller */
    .stat-card .stat-value {
        font-size: 2rem;
    }
    
    .stat-card .stat-label {
        font-size: 0.8rem;
    }
    
    /* Buttons */
    .btn {
        font-size: 0.875rem;
        padding: 0.625rem 1.25rem;
    }
    
    /* Photo grid - 2 columns on very small screens */
    [id="photoPreview"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    /* Navigation */
    .nav-brand {
        font-size: 1.125rem;
    }
    
    .nav-menu a {
        font-size: 0.875rem;
        padding: 0.5rem;
    }
    
    /* Tables even more compact */
    table {
        font-size: 0.8rem;
    }
    
    th, td {
        padding: 0.5rem 0.25rem;
    }
    
    /* Login box */
    .login-box {
        padding: 1.5rem 1rem;
    }
    
    .login-logo {
        font-size: 2rem;
    }
    
    /* Form inputs larger for mobile */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="date"],
    select,
    textarea {
        font-size: 16px !important; /* Prevents iOS zoom */
        padding: 0.75rem !important;
    }
}

/* Landscape orientation adjustments */
@media (max-height: 600px) and (orientation: landscape) {
    #cameraVideo {
        max-height: 80vh;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .card {
        margin-bottom: 0.5rem;
    }
}

/* Print styles */
@media print {
    .nav-container,
    .btn,
    button,
    [onclick*="delete"],
    [onclick*="remove"] {
        display: none !important;
    }
    
    .main-content {
        padding: 0;
    }
    
    .card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
