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

:root {
    --primary: #2ECC71; /* Vibrant green for fruits */
    --primary-dark: #27AE60;
    --secondary: #34495E;
    --bg-color: #F4F7F6;
    --text-color: #2C3E50;
    --card-bg: #FFFFFF;
    --border-color: #E0E6ED;
    --sidebar-bg: #1A252F;
    --sidebar-text: #ECF0F1;
    --sidebar-hover: #2C3E50;
    --danger: #E74C3C;
    --warning: #F1C40F;
    --info: #3498DB;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --border-radius: 12px;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.sidebar-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 1px;
}

.sidebar-menu {
    list-style: none;
    padding: 10px 0;
    flex: 1;
    overflow-y: auto;
}

.sidebar-menu li {
    padding: 5px 15px;
}

.sidebar-menu a {
    color: var(--sidebar-text);
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 0.95rem;
    gap: 12px;
}

.sidebar-menu a:hover, .sidebar-menu a.active {
    background-color: var(--sidebar-hover);
    color: var(--primary);
    transform: translateX(5px);
}

.sidebar-menu a i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-wrapper {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    width: calc(100% - 260px);
}

.topbar {
    background-color: var(--card-bg);
    height: 70px;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 99;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.user-profile img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
}

.content {
    padding: 30px;
    flex: 1;
}

.page-title {
    margin-bottom: 25px;
    font-size: 1.5rem;
    color: var(--secondary);
    font-weight: 600;
}

/* Card Style */
.card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

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

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

th {
    background-color: #F8FAFC;
    color: var(--secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

tr:hover {
    background-color: #F8FAFC;
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 15px;
}

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

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.2);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

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

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

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

.btn-danger:hover {
    background-color: #C0392B;
}

.btn-warning {
    background-color: var(--warning);
    color: #fff;
}

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

/* Dashboard Metrics */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--border-radius);
    padding: 25px;
    color: white;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.metric-card::after {
    content: '';
    position: absolute;
    right: -20px;
    top: -20px;
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.metric-title {
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: 10px;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
}

.metric-icon {
    position: absolute;
    right: 20px;
    bottom: 20px;
    font-size: 3rem;
    opacity: 0.2;
}

/* Badge */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-success { background: rgba(46, 204, 113, 0.2); color: var(--primary-dark); }
.badge-danger { background: rgba(231, 76, 60, 0.2); color: var(--danger); }
.badge-warning { background: rgba(241, 196, 15, 0.2); color: #D4AC0D; }

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animated {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    body.sidebar-collapsed .sidebar {
        transform: translateX(0);
    }
    .main-wrapper {
        margin-left: 0;
        width: 100%;
    }
    .pos-wrapper {
        flex-direction: column;
    }
    .pos-form, .pos-summary {
        width: 100%;
    }
    /* Make inline flex rows stack on mobile */
    div[style*="display: flex"] {
        flex-direction: column;
        align-items: stretch !important;
    }
    /* Except for topbar and sidebar header */
    .topbar, .sidebar-header, .user-profile, .detail-row {
        flex-direction: row;
        align-items: center !important;
    }
    /* For detail rows, it might be too cramped, allow wrap */
    .detail-row {
        flex-wrap: wrap;
    }
    .detail-row .form-group {
        flex: 1 1 45% !important;
    }
    /* Header flex fixes */
    div[style*="justify-content: space-between"] {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 15px;
    }
    .page-title {
        margin-bottom: 5px !important;
    }
}
@media (min-width: 769px) {
    #sidebarToggle {
        display: none;
    }
}
