/* ===== GENERAL STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f6f9;
    color: #333;
    line-height: 1.6;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-wrapper {
    display: flex;
    flex: 1;
}

.content-wrapper {
    flex: 1;
    margin-left: 250px;
    transition: margin-left 0.3s;
}

.container {
    max-width: 100%;
    margin: 0;
    padding: 20px;
}

/* ===== HEADER ===== */
.header {
    background: linear-gradient(135deg, #027499 0%, #0396c8 100%);
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    font-size: 14px;
}

.logout-btn {
    background-color: rgba(255,255,255,0.2);
    color: white;
    padding: 8px 15px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background-color: rgba(255,255,255,0.3);
}

/* ===== SIDEBAR NAVIGATION ===== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 250px;
    height: 100vh;
    background: linear-gradient(180deg, #027499 0%, #0396c8 100%);
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s;
}

.sidebar-header {
    padding: 20px;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
    color: white;
    font-size: 18px;
    margin: 0 0 10px 0;
}

.sidebar-user {
    color: rgba(255,255,255,0.8);
    font-size: 13px;
}

.sidebar-role {
    display: inline-block;
    background: rgba(4, 165, 214, 0.3);
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    margin-top: 5px;
}

.sidebar-menu {
    padding: 10px 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.sidebar-menu a:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left-color: #04a5d6;
}

.sidebar-menu a.active {
    background: rgba(4, 165, 214, 0.2);
    color: white;
    border-left-color: #04a5d6;
}

.sidebar-menu a i {
    margin-right: 10px;
    width: 20px;
}

.sidebar-submenu {
    background: rgba(0,0,0,0.2);
}

.sidebar-submenu a {
    padding-left: 50px;
    font-size: 14px;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 15px 20px;
    background: rgba(0,0,0,0.2);
    border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-footer a {
    display: block;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    padding: 8px;
    text-align: center;
    background: rgba(220, 53, 69, 0.2);
    border-radius: 5px;
    transition: all 0.3s;
}

.sidebar-footer a:hover {
    background: rgba(220, 53, 69, 0.4);
    color: white;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-250px);
    }
    
    .content-wrapper {
        margin-left: 0;
    }
}

/* ===== MESSAGES ===== */
.message {
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 5px;
    font-weight: 500;
}

.success-msg {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error-msg {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ===== CARDS ===== */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 25px;
    margin-bottom: 20px;
}

.card-header {
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.card-header h2 {
    color: #2c3e50;
    font-size: 22px;
    font-weight: 600;
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #027499;
    box-shadow: 0 0 0 3px rgba(2, 116, 153, 0.1);
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background-color: #027499;
    color: white;
}

.btn-primary:hover {
    background-color: #015a77;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(2, 116, 153, 0.3);
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-warning {
    background-color: #ffc107;
    color: #333;
}

.btn-warning:hover {
    background-color: #e0a800;
}

.btn-info {
    background-color: #17a2b8;
    color: white;
}

.btn-info:hover {
    background-color: #138496;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* ===== TABLES ===== */
.table-container {
    overflow-x: auto;
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

table thead {
    background-color: #f8f9fa;
}

table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    font-size: 14px;
}

table td {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
    font-size: 14px;
}

table tbody tr:hover {
    background-color: #f8f9fa;
}

table img {
    max-width: 50px;
    max-height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

/* ===== SEARCH BAR ===== */
.search-box {
    margin-bottom: 20px;
}

.search-box input {
    width: 100%;
    max-width: 400px;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

/* ===== DASHBOARD STATS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-left: 4px solid #027499;
}

.stat-card h3 {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
}

/* ===== LOGIN PAGE ===== */
.login-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #027499 0%, #0396c8 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

/* ===== SERIAL NUMBER INPUT ===== */
.serial-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.serial-input-group input {
    flex: 1;
}

.serial-list {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 10px;
}

.serial-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background: white;
    margin-bottom: 5px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.serial-item button {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 18px;
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-container {
        flex-direction: column;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

/* ===== FOOTER ===== */
.footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 40px;
}

.footer p {
    font-size: 14px;
}

/* ===== INLINE STYLES MOVED TO CSS ===== */

/* Login Page Styles */
.login-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

.login-btn-full {
    width: 100%;
}

.login-credentials {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
    text-align: center;
    color: #666;
    font-size: 12px;
}

.login-warning {
    margin-top: 10px;
    color: #dc3545;
}

.login-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 12px;
    color: #999;
}

/* Dashboard Styles */
.dashboard-welcome {
    font-size: 18px;
    color: #666;
}

.dashboard-date {
    color: #999;
    margin-top: 5px;
}

.status-critical {
    color: #dc3545;
    font-weight: bold;
}

.status-low {
    color: #ffc107;
    font-weight: bold;
}

.action-badge {
    background-color: #f0f0f0;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

/* Items Page Styles */
.image-placeholder {
    width: 50px;
    height: 50px;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.purchase-type-badge {
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.purchase-type-local {
    background-color: #28a745;
}

.purchase-type-china {
    background-color: #17a2b8;
}

.has-serial-yes {
    color: #027499;
    font-weight: bold;
}

.has-serial-no {
    color: #999;
}

.inline-form {
    display: inline;
}

.modal-image-preview {
    max-width: 150px;
    max-height: 150px;
    border-radius: 5px;
}

.no-image-text {
    color: #999;
}

/* Pricing Page Styles */
.profit-result {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    display: none;
}

.profit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.profit-positive {
    color: #28a745;
}

.profit-negative {
    color: #dc3545;
}

.profit-value {
    font-size: 20px;
}

.profit-margin {
    font-weight: bold;
}

/* Users Page Styles */
.role-badge {
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.role-admin {
    background-color: #027499;
}

.role-manager {
    background-color: #28a745;
}

.role-updater {
    background-color: #ffc107;
}

.role-seller {
    background-color: #fd7e14;
}

.role-viewer {
    background-color: #17a2b8;
}

.status-active {
    color: #28a745;
    font-weight: bold;
}

.status-inactive {
    color: #dc3545;
    font-weight: bold;
}

/* Warehouses Page Styles */
.text-center-gray {
    text-align: center;
    color: #999;
    padding: 20px;
}

/* Stock/Inventory Styles */
.serial-warning {
    background-color: #fff3cd;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    border-left: 4px solid #ffc107;
}

.serial-warning strong {
    color: #856404;
}

.serial-warning p {
    margin-top: 5px;
    color: #666;
}

.serial-validation-valid {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.serial-validation-valid strong {
    color: #155724;
}

.serial-validation-invalid {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.serial-validation-invalid strong {
    color: #721c24;
}

.serial-validation-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.serial-validation-warning strong {
    color: #856404;
}

.serial-tag {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    padding: 8px 12px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.serial-remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
}

.quantity-display {
    font-size: 16px;
    font-weight: bold;
}

.quantity-critical {
    color: #dc3545;
}

.quantity-low {
    color: #ffc107;
}

.quantity-good {
    color: #28a745;
}

.quantity-large {
    font-size: 18px;
}

/* Transfer Styles */
.transfer-from {
    background-color: #dc3545;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.transfer-to {
    background-color: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

/* Stock Status Badges */
.stock-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.stock-out {
    background-color: #dc3545;
    color: white;
}

.stock-low {
    background-color: #ffc107;
    color: #333;
}

.stock-in {
    background-color: #28a745;
    color: white;
}

/* Pending Transfer Alert */
.pending-alert {
    border-left: 4px solid #ffc107;
    background-color: #fff3cd;
}

.pending-alert .card-header {
    background-color: #fff3cd;
    border-bottom: 1px solid #ffeaa7;
}

.pending-alert h2 {
    color: #856404;
}

.pending-alert p {
    margin: 5px 0 0 0;
    color: #856404;
}

/* Filter Section */
.filter-section {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-item {
    flex: 1;
    min-width: 300px;
}

.filter-item-small {
    min-width: 200px;
}

/* Details Table */
.details-table {
    width: 100%;
    line-height: 2;
}

.details-table td:first-child {
    width: 150px;
}

.details-value-large {
    font-size: 18px;
    font-weight: bold;
}

.details-value-success {
    color: #28a745;
}

/* Dealer Pricing Styles */
.pricing-info-box {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    display: none;
}

.pricing-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.pricing-info-cost {
    font-size: 18px;
    color: #dc3545;
}

.pricing-info-dealer {
    font-size: 18px;
    color: #027499;
}

.pricing-info-special {
    font-size: 18px;
    color: #28a745;
}

.profit-analysis {
    background-color: #e8f5e9;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    border-left: 4px solid #28a745;
    display: none;
}

.profit-analysis h4 {
    margin-bottom: 10px;
    color: #2e7d32;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-large {
    font-size: 18px;
}

.text-xlarge {
    font-size: 20px;
}

.color-success {
    color: #28a745;
}

.color-danger {
    color: #dc3545;
}

.color-warning {
    color: #ffc107;
}

.color-info {
    color: #17a2b8;
}

.color-primary {
    color: #027499;
}

.color-gray {
    color: #666;
}

.color-light-gray {
    color: #999;
}

.font-bold {
    font-weight: bold;
}

.margin-top-5 {
    margin-top: 5px;
}

.margin-top-10 {
    margin-top: 10px;
}

.margin-top-15 {
    margin-top: 15px;
}

.margin-top-20 {
    margin-top: 20px;
}

.margin-bottom-10 {
    margin-bottom: 10px;
}

.margin-bottom-15 {
    margin-bottom: 15px;
}

.margin-bottom-20 {
    margin-bottom: 20px;
}

.padding-20 {
    padding: 20px;
}

.padding-40 {
    padding: 40px;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.cursor-pointer {
    cursor: pointer;
}

.modal-large {
    max-width: 800px;
}

.modal-xlarge {
    max-width: 900px;
}

.image-full {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.sub-nav {
    background-color: #34495e;
}

.border-left-warning {
    border-left-color: #ffc107;
}

.border-left-success {
    border-left-color: #28a745;
}

.border-left-danger {
    border-left-color: #dc3545;
}

.border-left-info {
    border-left-color: #17a2b8;
}

.border-left-primary {
    border-left-color: #027499;
}

.border-left-purple {
    border-left-color: #764ba2;
}

.small-text {
    font-size: 12px;
}

.description-truncate {
    display: block;
    color: #666;
    font-size: 14px;
}

/* ===== LUCIDE ICONS STYLING ===== */
.sidebar-menu a i[data-lucide],
.sidebar-header h2 i[data-lucide],
.sidebar-footer a i[data-lucide],
.sidebar-submenu a i[data-lucide] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    vertical-align: middle;
    display: inline-block;
}

.card-header h2 i[data-lucide] {
    width: 24px;
    height: 24px;
    margin-right: 10px;
    vertical-align: middle;
    display: inline-block;
}

.btn i[data-lucide] {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    vertical-align: middle;
    display: inline-block;
}

.btn-sm i[data-lucide] {
    width: 14px;
    height: 14px;
    margin-right: 4px;
}

table td i[data-lucide],
table th i[data-lucide] {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    display: inline-block;
}

.login-box h2 i[data-lucide] {
    width: 28px;
    height: 28px;
    margin-right: 8px;
    vertical-align: middle;
    display: inline-block;
}

.login-warning i[data-lucide] {
    width: 16px;
    height: 16px;
    margin-right: 5px;
    vertical-align: middle;
    display: inline-block;
}

.image-placeholder i[data-lucide] {
    width: 24px;
    height: 24px;
    color: #999;
}

.serial-warning i[data-lucide] {
    width: 18px;
    height: 18px;
    margin-right: 5px;
    vertical-align: middle;
    display: inline-block;
}

/* Icon colors */
i[data-lucide].text-success {
    color: #28a745;
}

i[data-lucide].text-danger {
    color: #dc3545;
}

i[data-lucide].text-warning {
    color: #ffc107;
}

i[data-lucide].text-info {
    color: #17a2b8;
}

i[data-lucide].text-primary {
    color: #027499;
}
