:root {
    --primary-color: #2F855A;
    /* Deep Green */
    --primary-hover: #276749;
    --secondary-color: #F0FFF4;
    /* Light Green Bg */
    --accent-color: #38A169;
    --success-color: #319795;
    /* Teal */
    --warning-color: #D69E2E;
    /* Yellow/Gold */
    --danger-color: #E53E3E;

    --bg-color: #F7FAFC;
    /* Light gray background */
    --card-bg: #FFFFFF;

    --text-primary: #1A202C;
    --text-secondary: #4A5568;
    --text-light: #718096;

    --border-color: #E2E8F0;
    --border-radius: 12px;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* App Layout */
.app-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 240px;
    background-color: var(--card-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 2rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border-color);
}

.logo-icon {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(47, 133, 90, 0.3);
}

.sidebar-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.nav-links li {
    padding: 0.6rem 0.8rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.nav-links li i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.nav-links li:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

.nav-links li.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: var(--box-shadow);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 240px;
    padding: 1.5rem 2rem;
    max-width: 1200px;
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.page-header p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Cards & Forms */
.card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.2rem 1.5rem;
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-color);
    margin-bottom: 1.2rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.form-group label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.form-group input,
.form-group select {
    padding: 0.5rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-primary);
    transition: var(--transition);
    background-color: #F8FAFC;
    outline: none;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary-color);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(47, 133, 90, 0.15);
}

.hint {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-top: 0.3rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(47, 133, 90, 0.25);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #287e7c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(49, 151, 149, 0.25);
}

.btn-warning {
    background-color: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background-color: #b7791f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(214, 158, 46, 0.25);
}

.btn-secondary {
    background-color: #EDF2F7;
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background-color: #E2E8F0;
    transform: translateY(-2px);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 0.5rem 0.8rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
}

th {
    background-color: #F7FAFC;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tbody tr {
    transition: var(--transition);
}

tbody tr:hover {
    background-color: #F8FAFC;
}

.text-right {
    text-align: right;
}

tfoot th {
    font-size: 0.95rem;
    color: var(--text-primary);
    background-color: white;
    border-top: 2px solid var(--border-color);
    padding: 0.5rem 0.8rem;
}

.total-amount {
    color: var(--primary-color);
    font-weight: 800;
    font-size: 1.1rem;
}

/* Status Badges */
.status-badge {
    padding: 0.35rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-registered {
    background-color: #EBF8FF;
    color: #3182CE;
}

.status-ready {
    background-color: #E6FFFA;
    color: #319795;
}

.status-dispatched {
    background-color: #FFFFF0;
    color: #D69E2E;
}

/* Filter Form */
.filter-form {
    display: flex;
    align-items: flex-end;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.filter-form .form-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 200px;
}

.filter-actions {
    display: flex;
    gap: 10px;
}

/* Toast Notification */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 300px;
    padding: 1rem 1.5rem;
    background: white;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-radius: var(--border-radius);
    border-left: 5px solid var(--primary-color);
    z-index: 1000;
    transform: translateX(150%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.show {
    transform: translateX(0);
}

.toast.error {
    border-left-color: var(--danger-color);
}

.toast.error i {
    color: var(--danger-color);
}

.toast.success i {
    color: var(--primary-color);
}

/* Responsive */
@media (max-width: 992px) {
    .sidebar {
        width: 80px;
        padding: 1.5rem 0.5rem;
    }

    .sidebar-header {
        margin-bottom: 2rem;
        justify-content: center;
        padding-bottom: 0.5rem;
        border-bottom: none;
    }

    .sidebar-header h2,
    .nav-links li span {
        display: none;
    }

    .logo-icon {
        width: 35px;
        height: 35px;
        font-size: 1rem;
        border-radius: 8px;
    }

    .main-content {
        margin-left: 80px;
        padding: 1.5rem 2rem;
    }

    .nav-links li {
        justify-content: center;
        padding: 0.8rem;
    }

    .nav-links li i {
        font-size: 1.2rem;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 0.8rem 1rem;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        z-index: 10;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }

    .sidebar-header {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
        gap: 10px;
        justify-content: flex-start;
    }

    .sidebar-header h2 {
        display: block;
        font-size: 1.2rem;
    }

    .nav-links {
        flex-direction: row;
        gap: 0.5rem;
        overflow-x: auto;
        padding-bottom: 5px;
        /* for scrollbar */
    }

    .nav-links li span {
        display: inline;
        font-size: 0.9rem;
    }

    @media (max-width: 600px) {
        .sidebar {
            flex-direction: column;
            align-items: stretch;
        }

        .sidebar-header {
            justify-content: center;
            margin-bottom: 1rem;
        }

        .nav-links {
            justify-content: flex-start;
            width: 100%;
        }

        .nav-links li {
            padding: 0.6rem 0.8rem;
        }

        .nav-links li span {
            display: none;
        }
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .card {
        padding: 1.2rem;
        margin-bottom: 1rem;
        border-radius: 8px;
    }

    .page-header h1 {
        font-size: 1.4rem;
    }

    .page-header p {
        font-size: 0.85rem;
    }

    .filter-form {
        gap: 0.8rem;
        align-items: stretch;
    }

    .filter-form .form-group {
        min-width: 100%;
    }

    .filter-actions {
        width: 100%;
        display: flex;
        gap: 0.5rem;
        margin-top: 0.5rem;
    }

    .filter-actions button {
        flex: 1;
        justify-content: center;
    }

    th,
    td {
        padding: 0.6rem 0.8rem;
        font-size: 0.8rem;
    }

    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    .form-group input,
    .form-group select {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }

    .table-responsive {
        margin-left: -1rem;
        margin-right: -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
        width: calc(100% + 2rem);
    }
}