/* Admin Dashboard Specific Styles - V5 (Vibrant Forest) */

:root {
    --primary-color: #228B22; /* Forest Green */
    --primary-dark: #1A2B1A; /* Very dark green */
    --accent-color: #FFBF00; /* Amber */
    --background-light: #F0FFF0; /* Honeydew */
    --text-primary: #1A2B1A;
    --text-secondary: #4A4A4A;
    --border-color: #D1DCD1;
    --error-color: #DC3545;
    --sidebar-bg: #1A2B1A;
    --sidebar-text: #F0FFF0;
    --sidebar-active-bg: #FFBF00;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--background-light);
    color: var(--text-primary);
}

.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: 250px;
    background-color: var(--sidebar-bg) !important;
    color: var(--sidebar-text);
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

    .sidebar-header h2 {
        color: #ffffff;
        font-size: 22px;
        margin: 0;
    }

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .sidebar-nav ul li {
        margin-bottom: 10px;
    }

        .sidebar-nav ul li a {
            display: block;
            color: var(--sidebar-text);
            text-decoration: none;
            padding: 12px 15px;
            border-radius: 5px;
            transition: background-color 0.3s ease, color 0.3s ease;
        }

            .sidebar-nav ul li a:hover,
            .sidebar-nav ul li a.active {
                background-color: var(--sidebar-active-bg);
                color: var(--text-primary);
            }

/* Main Content Area */
.admin-main-content {
    flex-grow: 1;
    padding: 30px;
    background-color: #ffffff;
    border-radius: 8px;
    margin: 20px;
    box-shadow: 0 0 15px rgba(0,0,0,0.05);
}

/* Header */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

    .admin-header h1 {
        font-size: 32px;
        color: var(--text-primary);
        margin: 0;
    }

.user-profile {
    display: flex;
    align-items: center;
}

    .user-profile span {
        margin-right: 15px;
        font-weight: 500;
        color: var(--text-secondary);
    }

    .user-profile a {
        color: var(--error-color);
        text-decoration: none;
        padding: 8px 12px;
        border: 1px solid var(--error-color);
        border-radius: 5px;
        transition: background-color 0.3s ease, color 0.3s ease;
    }

        .user-profile a:hover {
            background-color: var(--error-color);
            color: #ffffff;
        }

/* Dashboard Stats */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background-color: #ffffff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(26, 43, 26, 0.05);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
}

    .stat-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 5px 15px rgba(26, 43, 26, 0.1);
    }

    .stat-card h3 {
        font-size: 18px;
        color: var(--text-primary);
        margin-top: 0;
        margin-bottom: 10px;
    }

    .stat-card p {
        font-size: 14px;
        font-weight: 700;
        color: var(--text-primary);
        margin: 0;
    }

/* Enhanced Stat Cards */
.stat-card-custom {
    position: relative;
    overflow: hidden;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    transition: all 0.4s ease-in-out;
    border: none;
}

    .stat-card-custom::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        opacity: 0.2;
        transition: opacity 0.4s ease-in-out;
    }

    /* Specific gradients for each card type */
    .stat-card-custom[data-card-type="sales"] {
        background: linear-gradient(45deg, #2E8B57, #228B22);
    }

    .stat-card-custom[data-card-type="orders"] {
        background: linear-gradient(45deg, #3CB371, #2E8B57);
    }

    .stat-card-custom[data-card-type="aov"] {
        background: linear-gradient(45deg, #FFBF00, #E6A700);
    }

    .stat-card-custom[data-card-type="customers"] {
        background: linear-gradient(45deg, #FFD700, #FFBF00);
    }

    .stat-card-custom:hover {
        transform: translateY(-8px);
        box-shadow: 0 15px 30px rgba(26, 43, 26, 0.25);
    }

        .stat-card-custom:hover::before {
            opacity: 0.4;
        }

    .stat-card-custom h3,
    .stat-card-custom p {
        color: #fff;
    }

.stat-card-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 36px;
    opacity: 0.3;
    color: rgba(255,255,255,0.8);
}

    .stat-card-icon i {
        width: 36px;
        height: 36px;
    }

/* General card improvements */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

    .card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 20px rgba(26, 43, 26, 0.15);
    }

/* Chart Canvas Styling */
.dashboard-charts canvas {
    max-height: 300px;
    width: 100% !important;
    height: auto !important;
}

#orderStatusBreakdownChart {
    max-height: 300px;
    width: 100% !important;
    height: auto !important;
}

/* Recent Activity/Orders Table */
.recent-activity {
    background-color: #ffffff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(26, 43, 26, 0.05);
    border: 1px solid var(--border-color);
}

    .recent-activity h2 {
        font-size: 24px;
        color: var(--text-primary);
        margin-top: 0;
        margin-bottom: 20px;
    }

    .recent-activity table {
        width: 100%;
        border-collapse: collapse;
        margin-top: 20px;
    }

        .recent-activity table th,
        .recent-activity table td {
            padding: 12px 15px;
            text-align: left;
            border-bottom: 1px solid var(--border-color);
        }

        .recent-activity table th {
            background-color: #F0FFF0;
            color: var(--text-secondary);
            font-weight: 600;
            text-transform: uppercase;
            font-size: 12px;
        }

        .recent-activity table tbody tr:hover {
            background-color: #F0FFF0;
        }

        .recent-activity table tbody tr:last-child td {
            border-bottom: none;
        }

/* Responsive Adjustments */
@media (max-width: 768px) {
    .admin-wrapper {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        height: auto;
        padding: 15px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }

    .sidebar-nav ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }

        .sidebar-nav ul li {
            margin: 0 10px 10px 0;
        }

    .admin-main-content {
        margin: 15px;
        padding: 20px;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }

        .admin-header h1 {
            margin-bottom: 10px;
        }

    .user-profile {
        margin-top: 10px;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
    }
}

/* Adjustments for consistent sidebar */
.admin-sidebar {
    min-width: 200px;
}

.sidebar-nav ul li a {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

/* Font size adjustments */
.admin-header h1 {
    font-size: 24px;
}

.sidebar-header h2 {
    font-size: 22px;
}

.sidebar-nav ul li a {
    font-size: 16px;
    padding: 10px 15px;
}

.recent-activity h2 {
    font-size: 20px;
}

/* POS Specific Styles */
.pos-interface {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 10px;
    font-size: 14px;
}

.pos-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 10px;
    background-color: #ffffff;
    border-radius: 5px;
}

    .pos-top-bar h5 {
        font-size: 16px;
    }

    .pos-top-bar h3 {
        font-size: 24px;
        color: var(--primary-color);
        font-weight: 700;
    }

.pos-main-area {
    flex-grow: 1;
    display: flex;
    overflow: hidden;
}

.pos-left-panel {
    flex: 2;
    padding-right: 15px;
    display: flex;
    flex-direction: column;
}

.pos-right-panel {
    flex: 3;
    padding-left: 15px;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border-color);
}

    .pos-left-panel .card, .pos-right-panel .card {
        margin-bottom: 10px;
        padding: 15px;
        box-shadow: 0 2px 8px rgba(26, 43, 26, 0.08);
        transition: transform 0.2s ease-in-out;
    }

        .pos-left-panel .card:hover, .pos-right-panel .card:hover {
            transform: translateY(-2px);
        }

        .pos-left-panel .card:last-child, .pos-right-panel .card:last-child {
            margin-bottom: 0;
        }

    .pos-left-panel .card-title, .pos-right-panel .card-title {
        font-size: 18px;
        margin-bottom: 5px;
        color: var(--text-secondary);
    }

.product-search-results, .customer-search-results {
    flex-grow: 1;
    overflow-y: auto;
    max-height: 100px;
    min-height: 70px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 5px;
}

    .product-search-results .d-flex, .customer-search-results .d-flex {
        padding-top: 8px;
        padding-bottom: 8px;
        cursor: pointer;
        transition: background-color 0.2s ease;
    }

        .product-search-results .d-flex:hover, .customer-search-results .d-flex:hover {
            background-color: #F0FFF0;
        }

    .product-search-results small, .customer-search-results small {
        font-size: 12px;
    }

.cart-items-container {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 10px;
    max-height: 250px;
}

.table-sm th, .table-sm td {
    padding: 0.3rem;
    font-size: 13px;
}

.table-striped tbody tr:hover {
    background-color: #F0FFF0 !important;
}

.cart-qty-input {
    width: 50px;
    font-size: 13px;
}

.form-control-sm, .form-select-sm {
    font-size: 13px;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

    .form-control-sm:focus, .form-select-sm:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 0.25rem rgba(34, 139, 34, 0.25);
    }

.form-label {
    font-size: 13px;
    margin-bottom: 0.25rem;
}

.pos-bottom-bar h4 {
    font-size: 16px;
}

.pos-bottom-bar .btn {
    font-size: 14px;
    padding: 0.4rem 0.8rem;
    border-radius: 5px;
    transition: all 0.2s ease, transform 0.1s ease;
}

    .pos-bottom-bar .btn:hover {
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
        transform: translateY(-1px);
    }

.input-group .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 13px;
    border-radius: 4px;
}

#grandTotalAmount {
    font-size: 28px;
    font-weight: 900;
    color: var(--primary-color);
    padding: 5px 10px;
    background-color: #E6F9E6;
    border-radius: 5px;
    display: inline-block;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: #555;
    }
