/* ... [KEEP ALL PREVIOUS CSS AS IS] ... */
:root {
    --primary: #00bcd4;
    --primary-dark: #0097a7;
    --bg-body: #ffffff;
    --bg-white: #ffffff;
    --text-dark: #2c3e50;
    --text-light: #95a5a6;
    --sidebar-width: 65px;
    --sidebar-width-open: 240px;
    --header-height: 60px;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-dark);
    display: block; 
    min-height: 100vh;
}

/* ... [PREVIOUS HEADER, SIDEBAR, CARD STYLES REMAIN SAME] ... */

.mobile-header {
    display: none;
    position: fixed; top: 0; left: 0; right: 0; height: var(--header-height);
    background: var(--bg-white); align-items: center; padding: 0 15px;
    box-shadow: var(--shadow); z-index: 100;
}
.menu-btn { background: none; border: none; font-size: 1.5rem; color: var(--text-dark); cursor: pointer; }
.logo-text { margin-left: 15px; font-weight: bold; font-size: 1.2rem; color: var(--primary); }

.sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-width);
    background: #fcfcfc; border-right: 1px solid #eee; z-index: 200;
    transition: width 0.3s ease, transform 0.3s ease; display: flex; flex-direction: column;
    overflow: hidden; white-space: nowrap;
}
@media (min-width: 769px) { .sidebar:hover { width: var(--sidebar-width-open); box-shadow: var(--shadow); } }

.sidebar-header {
    height: var(--header-height); display: flex; align-items: center; justify-content: space-between;
    padding: 0 18px; border-bottom: 1px solid #eee;
}
.logo-area { display: flex; align-items: center; }
.header-logo-img { width: 28px; height: 28px; border-radius: 4px; object-fit: cover; margin-right: 12px; }
.custom-icon { width: 24px; height: 24px; border-radius: 4px; object-fit: cover; display: block; }
.header-text { font-weight: bold; color: #006400; font-size: 1.1rem; }
.menu-hamburger { color: #555; font-size: 1.1rem; margin-right: 8px; }
.close-btn { display: none; background: none; border: none; font-size: 1.2rem; cursor: pointer; }

.nav-links { list-style: none; padding: 0; margin: 20px 0; width: 100%; }
.nav-item { display: flex; align-items: center; height: 50px; text-decoration: none; color: var(--text-dark); transition: background 0.2s; padding-left: 18px; cursor: pointer; }
.nav-item:hover { background-color: #f0fbfd; border-left: 3px solid var(--primary); padding-left: 15px; }
.icon-box { min-width: 30px; display: flex; justify-content: center; align-items: center; margin-right: 15px; }
.nav-icon { font-size: 1.2rem; color: #555; }
.nav-text { opacity: 0; transition: opacity 0.2s; }
.sidebar:hover .nav-text, .sidebar.open .nav-text { opacity: 1; }
.bottom-section { margin-top: auto; border-top: 1px solid #eee; }
.logout-item { color: #e74c3c; }
.logout-item:hover { background-color: #fff5f5; border-left-color: #e74c3c; }

.main-content { margin-left: var(--sidebar-width); padding: 40px; width: calc(100% - var(--sidebar-width)); min-height: 100vh; display: flex; flex-direction: column; align-items: center; transition: margin-left 0.3s ease; }

.card { background: var(--bg-white); padding: 2.5rem; border-radius: 12px; border: 1px solid #eee; width: 100%; max-width: 400px; text-align: center; margin-top: 50px; }
.auth-card h2 { margin-bottom: 5px; color: var(--text-dark); }
.subtitle { color: var(--text-light); margin-bottom: 25px; font-size: 0.9rem; }
.input-group { position: relative; margin-bottom: 15px; }
.input-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #aaa; }
input { width: 100%; padding: 12px 12px 12px 40px; border: 1px solid #ddd; border-radius: 8px; font-size: 1rem; outline: none; transition: border 0.3s; }
input:focus { border-color: var(--primary); }
.primary-btn { width: 100%; padding: 12px; background: var(--primary); color: white; border: none; border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer; margin-top: 10px; }
.primary-btn:hover { background: var(--primary-dark); }
.primary-btn:disabled { background: #ccc; cursor: not-allowed; }
.text-btn { background: none; border: none; color: #777; margin-top: 10px; cursor: pointer; text-decoration: underline; }
.auth-actions { display: flex; justify-content: space-between; margin-top: 20px; font-size: 0.9rem; color: var(--primary); cursor: pointer; }
.message { margin-top: 10px; font-size: 0.9rem; min-height: 20px; }
.message.error { color: #e74c3c; }
.spinner { display: none; width: 18px; height: 18px; border: 3px solid rgba(255,255,255,0.3); border-radius: 50%; border-top-color: #fff; animation: spin 1s infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }

.inventory-wrapper { width: 100%; max-width: 1000px; display: none; }
.page-title { margin-bottom: 20px; color: var(--text-dark); font-size: 2rem; }
.mobile-controls { display: none !important; }
table.dataTable thead th { text-align: left; color: #555; border-bottom: 2px solid #ddd; padding: 15px 10px; background: #fff; }
table.dataTable tbody td { padding: 15px 10px; border-bottom: 1px solid #f0f0f0; color: #444; background: #fff; }
.dataTables_wrapper .dataTables_length, .dataTables_wrapper .dataTables_filter { margin-bottom: 15px; color: #333; }

/* === NEW: JARVIS CHAT STYLES === */
.jarvis-wrapper { width: 100%; max-width: 800px; display: none; flex-direction: column; height: 80vh; }

.chat-container {
    background: #fff; border: 1px solid #eee; border-radius: 12px; box-shadow: var(--shadow);
    flex: 1; display: flex; flex-direction: column; overflow: hidden;
}

.chat-history {
    flex: 1; padding: 20px; overflow-y: auto; background: #f9f9f9;
}

.chat-msg { display: flex; margin-bottom: 15px; align-items: flex-end; }
.chat-avatar { width: 32px; height: 32px; border-radius: 50%; margin-right: 10px; object-fit: cover; }

.bot-msg .msg-content {
    background: #fff; color: #333; padding: 12px 16px; border-radius: 12px 12px 12px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); max-width: 70%;
}

.user-msg { justify-content: flex-end; }
.user-msg .msg-content {
    background: var(--primary); color: #fff; padding: 12px 16px; border-radius: 12px 12px 0 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); max-width: 70%; text-align: left;
}

.chat-controls {
    padding: 15px; border-top: 1px solid #eee; background: #fff; display: flex; align-items: center; gap: 10px;
}
.chat-controls input { margin: 0; flex: 1; border-radius: 20px; padding: 10px 15px; border: 1px solid #ddd; }

.icon-btn {
    width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer;
    display: flex; justify-content: center; align-items: center; font-size: 1.1rem; transition: background 0.2s;
}
.mic-btn { background: #f1f1f1; color: #555; }
.mic-btn.active { background: #e74c3c; color: white; animation: pulse 1.5s infinite; }
.send-btn { background: var(--primary); color: white; }
.send-btn:hover { background: var(--primary-dark); }

@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.1); } 100% { transform: scale(1); } }

@media (max-width: 768px) {
    .mobile-header { display: flex; }
    .main-content { margin-left: 0; padding: 80px 15px 20px 15px; width: 100%; }
    .sidebar { transform: translateX(-100%); width: 250px; transition: transform 0.3s ease; box-shadow: 5px 0 15px rgba(0,0,0,0.1); }
    .sidebar.open { transform: translateX(0); }
    .close-btn { display: block; }
    .nav-text { opacity: 1; }
    .overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 150; display: none; opacity: 0; transition: opacity 0.3s; }
    .overlay.active { display: block; opacity: 1; }
    .mobile-controls { display: flex !important; gap: 10px; margin-bottom: 15px; }
    .dataTables_filter, .dataTables_length { display: none !important; } 
    .mobile-search-box { flex: 2; position: relative; }
    .mobile-search-box i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #aaa; }
    .mobile-search-box input { padding-left: 35px; border-radius: 20px; border: 1px solid #eee; }
    .mobile-sort-box { flex: 1; }
    .mobile-sort-box select { width: 100%; padding: 12px; border-radius: 20px; border: 1px solid #eee; background: white; outline: none; }
    table.dataTable thead { display: none; }
    table.dataTable tbody tr { display: block; background: #fff; margin-bottom: 15px; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); padding: 15px; border: 1px solid #eee; }
    table.dataTable tbody td { display: flex; justify-content: space-between; text-align: right; padding: 10px 0; border-bottom: 1px solid #f9f9f9; font-size: 0.95rem; }
    table.dataTable tbody td:last-child { border-bottom: none; }
    table.dataTable tbody td::before { content: attr(data-label); font-weight: 700; color: #999; font-size: 0.8rem; text-transform: uppercase; }
    .card { max-width: 100%; padding: 2rem 1.5rem; margin-top: 20px; border: none; box-shadow: none; }
}