@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&display=swap');

:root {
    /* Hardware/Industrial Color Palette - Light Mode */
    --primary: #f97316; /* Bright Industrial Orange */
    --primary-hover: #ea580c;
    --secondary: #10b981;
    --bg-color: #f8fafc; /* Very light slate for background */
    --surface: #ffffff; /* White for cards */
    --text-main: #0f172a; /* Slate Dark text */
    --text-light: #64748b;
    --border: #e2e8f0;
    --danger: #ef4444;
    --warning: #f59e0b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}

/* Glassmorphism for light mode */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.05);
}

/* --- Admin Dashboard Layout --- */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--surface);
    border-right: 1px solid var(--border);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.logo {
    font-size: 24px;
    font-weight: 900;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    padding: 12px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-link:hover, .nav-link.active {
    background-color: var(--primary);
    color: white;
    transform: translateX(5px);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    padding: 8px 16px;
    border-radius: 50px;
    border: 1px solid var(--border);
}

.user-profile img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

/* Stat Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    padding: 24px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    overflow: hidden;
    border-top: 4px solid var(--primary);
}

.stat-card h3 {
    color: var(--text-light);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
}

.stat-card .value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-main);
}

.stat-card .trend {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    width: max-content;
}

.trend.positive { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.trend.negative { background: rgba(239, 68, 68, 0.2); color: #f87171; }

/* Table */
.data-table-container {
    background: var(--surface);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--border);
    margin-bottom: 32px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

th, td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    color: var(--text-light);
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-pending { background: var(--warning); color: #000; }
.status-approved { background: var(--secondary); color: #000; }

.action-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
    transition: 0.2s;
}

.btn-approve { background: var(--primary); color: white; }
.btn-approve:hover { background: var(--primary-hover); }

/* Form Inputs */
.input-group {
    margin-bottom: 16px;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-light);
    font-size: 14px;
    font-weight: 600;
}

.input-group input {
    width: 100%;
    padding: 12px;
    background: var(--bg-color);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 16px;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.payment-summary {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
}

.payment-summary.deficit {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

/* File Upload Zone */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 16px;
}

.upload-zone:hover {
    border-color: var(--primary);
    background: rgba(249, 115, 22, 0.05);
}

.upload-zone ion-icon {
    font-size: 48px;
    color: var(--text-light);
    margin-bottom: 12px;
}

.upload-zone p {
    color: var(--text-light);
    margin-bottom: 16px;
}

.upload-zone input[type="file"] {
    display: none;
}

.btn-upload {
    background: var(--surface);
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: 0.2s;
}

.btn-upload:hover {
    background: var(--primary);
    color: white;
}

.upload-progress {
    display: none;
    margin-top: 20px;
}

.progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: var(--secondary);
    width: 0%;
    transition: width 0.3s ease;
}

/* --- Sales Rep App (Mobile view) --- */
.mobile-wrapper {
    display: flex;
    justify-content: center;
    background-color: #000;
    min-height: 100vh;
}

.mobile-app {
    width: 100%;
    max-width: 414px;
    background-color: var(--bg-color);
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 40px rgba(249, 115, 22, 0.1);
    display: flex;
    flex-direction: column;
}

.app-header {
    background: var(--surface);
    color: var(--text-main);
    padding: 24px 20px;
    border-bottom: 2px solid var(--border);
}

.app-header h1 {
    font-size: 20px;
    margin-bottom: 8px;
    font-weight: 900;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.icon-btn:hover {
    color: var(--primary);
}

.attendance-badge {
    display: inline-block;
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
}

.app-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    padding-bottom: 80px;
}

.product-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.product-card {
    background: var(--surface);
    padding: 16px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid var(--border);
    transition: border-color 0.2s;
}

.product-card:hover {
    border-left-color: var(--primary);
}

.product-info h3 { font-size: 16px; margin-bottom: 4px; font-weight: 700; }
.product-info p { color: var(--primary); font-weight: 700; }
.product-info .sku { color: var(--text-light); font-size: 12px; font-weight: 500; }

.add-btn {
    background: var(--surface);
    color: var(--primary);
    border: 2px solid var(--primary);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.add-btn:active {
    background: var(--primary);
    color: white;
}

/* Floating Bottom Bar */
.bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--surface);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
}

.cart-summary {
    font-weight: 600;
}

.checkout-btn {
    background: var(--primary);
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    border: none;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--surface);
    padding: 24px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    border-top: 4px solid var(--secondary);
    animation: slideUp 0.3s ease;
}

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