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

:root {
    --primary: #1C592D;
    --primary-glow: rgba(28, 89, 45, 0.4);
    --primary-light: #2d8245;
    --bg-dark: #070d09;
    --bg-panel: #0d1610;
    --bg-card: #121e16;
    --border-color: rgba(28, 89, 45, 0.2);
    --border-hover: rgba(28, 89, 45, 0.5);
    --text-main: #f3fcf6;
    --text-muted: #8ca394;
    --text-dark: #0d1610;

    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Outfit', sans-serif;

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.7);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

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

/* Login/Signup Layout */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: radial-gradient(circle at center, #112818 0%, var(--bg-dark) 70%);
}

.auth-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 440px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo {
    max-width: 160px;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 8px rgba(45, 130, 69, 0.4));
}

.auth-title {
    font-size: 24px;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 14px;
}

/* Inputs & Form Controls */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 15px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%238ca394'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 40px;
}

select option {
    background-color: var(--bg-panel) !important;
    color: var(--text-main) !important;
    font-family: var(--font-body);
    font-size: 14px;
    padding: 10px 16px;
}

select option:checked {
    background-color: var(--primary) !important;
    color: #ffffff !important;
}


/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 75%, #b4dcb9 100%);
    color: white;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-hover);
}

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

.btn-danger:hover {
    background: #d32f2f;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-block {
    width: 100%;
}

.btn:active {
    transform: translateY(0);
}

/* Alert Boxes */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    margin-bottom: 20px;
    border-left: 4px solid;
    animation: slideDown 0.3s ease;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border-color: var(--danger);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #a7f3d0;
    border-color: var(--success);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #fde68a;
    border-color: var(--warning);
}

/* Sidebar Dashboard Navigation */
.sidebar {
    width: 260px;
    background: var(--bg-panel);
    border-right: 1px solid var(--border-color);
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    max-height: 40px;
}

.sidebar-title {
    font-size: 18px;
    color: var(--text-main);
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: var(--transition);
    font-family: var(--font-heading);
    font-size: 14px;
}

.nav-link svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.nav-link:hover,
.nav-item.active .nav-link {
    color: var(--text-main);
    background: rgba(28, 89, 45, 0.15);
    border: 1px solid var(--border-color);
}

.nav-item.active .nav-link {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 75%, #b4dcb9 100%);
    border-color: var(--primary-light);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
}

.user-info {
    font-size: 13px;
}

.user-name {
    font-weight: 600;
    color: var(--text-main);
}

.user-role {
    color: var(--text-muted);
    font-size: 11px;
}

/* Main Dashboard Body */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
}

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

.page-title {
    font-size: 24px;
    letter-spacing: -0.5px;
}

.content-body {
    padding: 40px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Stats Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    transition: var(--transition);
}

.stat-card.stat-processing::after {
    background: var(--warning);
}

.stat-card.stat-shipped::after {
    background: var(--info);
}

.stat-card.stat-delivered::after {
    background: var(--success);
}

.stat-card.stat-total::after {
    background: var(--primary);
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    font-family: var(--font-heading);
    margin-top: 4px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-light);
}

/* Data Table Component */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.table-header-tools {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.search-box {
    position: relative;
    max-width: 320px;
    width: 100%;
}

.search-input {
    padding-left: 40px;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 16px;
    height: 16px;
    pointer-events: none;
}

.filter-tools {
    display: flex;
    gap: 12px;
    align-items: center;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th,
.data-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.data-table th {
    background: rgba(255, 255, 255, 0.02);
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: rgba(28, 89, 45, 0.03);
}

.data-table tbody tr.row-selected {
    background: rgba(28, 89, 45, 0.08);
}

/* Custom Checkbox */
.checkbox-cell {
    width: 50px;
    text-align: center;
}

.custom-checkbox {
    position: relative;
    display: inline-block;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.custom-checkbox input {
    opacity: 0;
    width: 0;
    height: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.custom-checkbox:hover input~.checkmark {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.08);
}

.custom-checkbox input:checked~.checkmark {
    background: var(--primary);
    border-color: var(--primary-light);
    box-shadow: 0 0 8px var(--primary-glow);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.custom-checkbox input:checked~.checkmark:after {
    display: block;
}

.custom-checkbox .checkmark:after {
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-processing {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge-on-hold {
    background: rgba(243, 156, 18, 0.1);
    color: #e67e22;
}

.badge-partially-paid {
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

.badge-shipped {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.badge-delivered {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge-pending {
    background: rgba(255, 255, 255, 0.08);
    color: #e5e7eb;
}

.badge-cancelled {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.badge-out-for-delivery {
    background: rgba(139, 92, 246, 0.1);
    color: #a78bfa;
}

/* Live Selector */
.status-select-container {
    position: relative;
    display: inline-block;
}

.status-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%238ca394'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 10px;
    border: 1px solid transparent;
    color: inherit;
    font-weight: inherit;
    padding: 4px 22px 4px 10px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 12px;
    transition: var(--transition);
}

.status-select:focus,
.status-select:hover {
    outline: none;
    border-color: var(--border-hover);
    background-color: rgba(255, 255, 255, 0.05);
}


/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(7, 13, 9, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid var(--primary-light);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Bulk Action Drawer */
.bulk-action-bar {
    position: fixed;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 14px 30px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 24px;
    z-index: 90;
    transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(10px);
}

.bulk-action-bar.active {
    bottom: 30px;
}

.bulk-count {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.bulk-count-badge {
    background: var(--primary);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.bulk-actions {
    display: flex;
    gap: 12px;
}

/* Keyframes */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive Styles */
@media (max-width: 992px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 16px 20px;
    }

    .sidebar-header {
        margin-bottom: 20px;
        padding-bottom: 10px;
    }

    .nav-list {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 8px;
    }

    .nav-link {
        white-space: nowrap;
    }

    .sidebar-footer {
        display: none;
    }

    .header-bar {
        padding: 16px 20px;
    }

    .content-body {
        padding: 20px;
    }
}

@media (max-width: 600px) {
    .table-header-tools {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        max-width: 100%;
    }

    .filter-tools {
        justify-content: space-between;
    }

    .bulk-action-bar {
        width: 90%;
        border-radius: 16px;
        flex-direction: column;
        gap: 14px;
        padding: 16px;
        bottom: -150px;
    }

    .bulk-action-bar.active {
        bottom: 20px;
    }
}

/* Modal Dialog Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 650px;
    margin: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(-20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-card {
    transform: translateY(0);
}

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

.modal-title {
    font-size: 18px;
    font-weight: 700;
    font-family: var(--font-heading);
    color: var(--text-main);
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--danger);
}

.modal-body {
    padding: 24px;
    max-height: 70vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: rgba(28, 89, 45, 0.05);
}