/* Hardware Store Management System - Modern UI */

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

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --light: #f8fafc;
    --dark: #1e293b;
    --border: #e2e8f0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--light);
    color: var(--dark);
    line-height: 1.6;
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 28px;
}

.login-box p {
    text-align: center;
    color: var(--secondary);
    margin-bottom: 30px;
}

/* Layout */
.container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--dark);
    color: white;
    padding: 20px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 20px;
}

.sidebar-header h2 {
    font-size: 20px;
    margin-bottom: 5px;
}

.sidebar-header .user-info {
    font-size: 13px;
    color: var(--secondary);
}

.nav-menu {
    list-style: none;
}

.nav-menu li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s;
}

.nav-menu li a:hover,
.nav-menu li a.active {
    background: rgba(255,255,255,0.1);
    color: white;
}

.nav-menu li a svg {
    margin-right: 10px;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 30px;
}

/* Cards */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

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

.stat-card .stat-info h3 {
    font-size: 14px;
    color: var(--secondary);
    font-weight: 500;
    margin-bottom: 8px;
}

.stat-card .stat-info .stat-value {
    font-size: 32px;
    font-weight: bold;
    color: var(--dark);
}

.stat-card .stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.stat-card.primary .stat-icon { background: var(--primary); color: white; }
.stat-card.success .stat-icon { background: var(--success); color: white; }
.stat-card.warning .stat-icon { background: var(--warning); color: white; }
.stat-card.danger .stat-icon { background: var(--danger); color: white; }

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}

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

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

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

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-block {
    width: 100%;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow-x: auto;
}

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

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

table th {
    background: var(--light);
    font-weight: 600;
    color: var(--dark);
}

table tr:hover {
    background: var(--light);
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

/* Badge */
.badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-primary { background: #dbeafe; color: #1e40af; }

/* POS Interface */
.pos-container {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
}

.product-search {
    position: relative;
    margin-bottom: 20px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    max-height: 500px;
    overflow-y: auto;
}

.product-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid var(--border);
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.product-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.product-item h4 {
    font-size: 14px;
    margin-bottom: 5px;
}

.product-item .price {
    font-size: 16px;
    font-weight: bold;
    color: var(--primary);
}

.cart-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 20px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.cart-total {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--border);
}

.cart-total h3 {
    display: flex;
    justify-content: space-between;
    font-size: 24px;
    color: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .pos-container {
        grid-template-columns: 1fr;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

/* Notifications */
.notification-badge {
    position: absolute;
    top: 5px;
    right: 10px;
    background: #ef4444;
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
    animation: pulse 1s ease-in-out infinite;
}

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

.notification-panel {
    position: fixed;
    right: 20px;
    top: 20px;
    width: 400px;
    max-height: 600px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    z-index: 2000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.notification-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--primary);
    color: white;
}

.notification-header h3 {
    margin: 0;
    font-size: 18px;
}

.notification-list {
    overflow-y: auto;
    max-height: 500px;
}

.notification-item {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
}

.notification-item:hover {
    background: var(--light);
}

.notification-item.unread {
    background: #eff6ff;
    border-left: 4px solid var(--primary);
}

.notification-item .notification-title {
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--dark);
}

.notification-item .notification-message {
    font-size: 14px;
    color: var(--secondary);
    margin-bottom: 5px;
}

.notification-item .notification-time {
    font-size: 12px;
    color: var(--secondary);
}

.notification-item.type-sale .notification-title::before {
    content: "💰 ";
}

.notification-item.type-low_stock .notification-title::before {
    content: "⚠️ ";
}

.notification-item.type-system .notification-title::before {
    content: "ℹ️ ";
}

@media (max-width: 500px) {
    .notification-panel {
        right: 10px;
        left: 10px;
        width: auto;
    }
}
/* Discount Styles */
.discount-section {
    border-top: 1px solid var(--border);
    padding-top: 15px;
    margin-top: 15px;
}

.total-breakdown {
    padding: 15px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
}

.total-row:last-child {
    border-bottom: none;
}

.discount-row {
    color: var(--danger);
    font-weight: 600;
}

.final-total {
    border-top: 2px solid var(--primary);
    margin-top: 10px;
    padding-top: 15px;
    font-size: 18px;
}

.cart-total {
    background: var(--light);
    border-radius: 8px;
    margin: 20px 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .discount-section .form-row {
        flex-direction: column;
    }
    
    .discount-section .form-group {
        width: 100%;
    }
}