* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
body { background: #f4f6f9; }

/* ===================== LOGIN PAGE ===================== */
.login-container { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); padding: 20px; }
.login-box { background: white; padding: 40px 30px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); width: 100%; max-width: 400px; }
.login-box h2 { text-align: center; margin-bottom: 30px; color: #333; }
.login-box h2 i { margin-right: 10px; }

/* ===================== FORM ===================== */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; color: #555; font-weight: 600; font-size: 14px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 5px; font-size: 14px; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: #667eea; }

/* ===================== BUTTONS ===================== */
.btn { padding: 12px 20px; color: white; border: none; border-radius: 5px; cursor: pointer; font-size: 14px; font-weight: 600; transition: 0.3s; text-decoration: none; display: inline-block; text-align: center; }
.btn:hover { opacity: 0.9; }
.btn-green { background: #28a745; }
.btn-green:hover { background: #218838; }
.btn-red { background: #dc3545; }
.btn-red:hover { background: #c82333; }
.btn-orange { background: #fd7e14; }
.btn-orange:hover { background: #e96e0a; }

/* ===================== DASHBOARD LAYOUT ===================== */
.wrapper { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar { width: 250px; background: #2c3e50; color: white; min-height: 100vh; position: fixed; overflow-y: auto; }
.sidebar .logo { padding: 20px; font-size: 18px; font-weight: bold; background: #1a252f; text-align: center; }
.sidebar ul { list-style: none; }
.sidebar ul li { border-bottom: 1px solid #34495e; }
.sidebar ul li a { display: block; padding: 15px 20px; color: #bdc3c7; text-decoration: none; transition: 0.3s; font-size: 14px; }
.sidebar ul li a:hover, .sidebar ul li a.active { background: #34495e; color: white; border-left: 4px solid #667eea; }
.sidebar .user-info { padding: 20px; background: #1a252f; font-size: 13px; position: absolute; bottom: 0; width: 100%; }

/* Main Content */
.main-content { margin-left: 250px; width: calc(100% - 250px); padding: 20px; }
.header { background: white; padding: 15px 20px; border-radius: 5px; margin-bottom: 20px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); display: flex; justify-content: space-between; align-items: center; }
.header h2 { font-size: 18px; margin-bottom: 0; }
.header p { font-size: 12px; color: #666; margin: 0; }

/* ===================== CARDS ===================== */
.card { background: white; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.08); margin-bottom: 20px; overflow: hidden; }
.card h3 { margin: 0; padding: 15px 20px; background: #f8f9fa; border-bottom: 1px solid #eee; font-size: 16px; display: flex; align-items: center; gap: 10px; }
.card h3 i { color: #667eea; }
.card > *:not(h3) { padding: 15px 20px; }
.card > *:not(h3):last-child { padding-bottom: 20px; }

/* ===================== STATS GRID ===================== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 15px; }
.stat-card { background: white; padding: 20px; border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); text-align: center; }
.stat-card h4 { color: #666; font-size: 12px; margin-bottom: 10px; }
.stat-card .number { font-size: 28px; font-weight: bold; color: #667eea; }

/* ===================== ALERTS ===================== */
.alert { padding: 12px 15px; border-radius: 5px; margin-bottom: 20px; font-size: 13px; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }

/* ===================== MODAL ===================== */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); padding: 20px; }
.modal-content { background: white; margin: 10% auto; padding: 25px; border-radius: 10px; width: 100%; max-width: 500px; position: relative; }
.modal-content h3 { margin-bottom: 20px; padding-bottom: 10px; border-bottom: 1px solid #eee; }
.close { float: right; font-size: 28px; font-weight: bold; cursor: pointer; position: absolute; right: 15px; top: 10px; color: #999; }
.close:hover { color: #333; }

/* ===================== FILTER SECTION ===================== */
.filter-wrap { display: flex; gap: 10px; flex-wrap: wrap; padding: 15px 20px; border-bottom: 1px solid #eee; }
.filter-wrap input, .filter-wrap select { padding: 10px 12px; border: 1px solid #ddd; border-radius: 5px; font-size: 13px; flex: 1; min-width: 120px; }
.filter-wrap input:focus, .filter-wrap select:focus { border-color: #667eea; outline: none; }
.filter-wrap .btn { padding: 10px 20px; min-width: auto; flex: none; }

/* ===================== HORIZONTAL TABLE ===================== */
.table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -20px; padding: 0 20px; }
.table-min-width { min-width: 700px; }

table.data-table { width: 100%; border-collapse: collapse; background: white; }
table.data-table thead { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
table.data-table thead th { padding: 12px 15px; text-align: left; color: white; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; border: none; }
table.data-table tbody tr { border-bottom: 1px solid #f0f0f0; transition: background 0.2s; }
table.data-table tbody tr:hover { background: #f8f9ff; }
table.data-table tbody tr:nth-child(even) { background: #fafafa; }
table.data-table tbody tr:nth-child(even):hover { background: #f8f9ff; }
table.data-table tbody td { padding: 12px 15px; font-size: 13px; color: #333; vertical-align: middle; }

/* ===================== STOCK INDICATORS ===================== */
.stock-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.stock-dot.green { background: #28a745; }
.stock-dot.orange { background: #fd7e14; }
.stock-dot.red { background: #dc3545; }

.stock-badge { padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.stock-badge.green { background: #d4edda; color: #155724; }
.stock-badge.orange { background: #fff3cd; color: #856404; }
.stock-badge.red { background: #f8d7da; color: #721c24; }
.stock-badge.blue { background: #d1ecf1; color: #0c5460; }

.stock-danger { color: #dc3545; font-weight: bold; }
.stock-warning { color: #fd7e14; font-weight: bold; }
.stock-ok { color: #28a745; font-weight: bold; }

/* ===================== PAGINATION ===================== */
.pagination-wrap { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; border-top: 1px solid #eee; flex-wrap: wrap; gap: 10px; }
.pagination-info { font-size: 13px; color: #666; }
.pagination-btns { display: flex; gap: 5px; flex-wrap: wrap; }
.pagination-btns .btn { padding: 8px 12px; font-size: 12px; }

/* ===================== CARD TABLE (WRAPPER) ===================== */
.card-table { background: white; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); margin-bottom: 20px; overflow: hidden; }
.card-table .card-header { padding: 15px 20px; background: #f8f9fa; border-bottom: 1px solid #eee; }
.card-table .card-header h3 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 10px; padding: 0; border: none; background: transparent; }
.card-table .card-header h3 i { color: #667eea; }
.card-table .card-body { padding: 0; }

/* ===================== MOBILE MENU ===================== */
.mobile-menu-btn { display: none; position: fixed; top: 10px; right: 10px; z-index: 1001; background: #667eea; color: white; border: none; padding: 12px 15px; border-radius: 5px; font-size: 18px; cursor: pointer; }
.sidebar-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 999; }
.sidebar-overlay.active { display: block; }

/* ===================== RESPONSIVE HP ===================== */
@media (max-width: 768px) {
    .wrapper { flex-direction: column; }
    
    .sidebar { position: fixed; left: -100%; width: 80%; max-width: 250px; z-index: 1000; transition: 0.3s; }
    .sidebar.active { left: 0; }
    
    .main-content { margin-left: 0; width: 100%; padding: 15px; }
    .header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .header h2 { font-size: 16px; }
    
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-card { padding: 15px; }
    .stat-card .number { font-size: 22px; }
    
    .card, .card-table { border-radius: 0; margin: 0 -15px 20px; }
    .card h3, .card-table .card-header { padding: 12px 15px; font-size: 14px; }
    
    .filter-wrap { flex-direction: column; }
    .filter-wrap input, .filter-wrap select { width: 100%; min-width: auto; }
    
    .table-container { margin: 0 -15px; padding: 0 15px; }
    
    .pagination-wrap { flex-direction: column; text-align: center; }
    
    .mobile-menu-btn { display: block; }
    
    .modal-content { margin: 20% 10px; padding: 15px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .login-box { padding: 25px 20px; }
    .form-group input, .form-group select { font-size: 13px; padding: 10px; }
}

/* ===================== SMOOTH SCROLL ===================== */
html { scroll-behavior: smooth; }
.text-truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loading { opacity: 0.5; pointer-events: none; }