:root {
    --bg-main: #f2edf3;
    --sidebar-bg: #ffffff;
    --sidebar-text: #3e4b5b;
    --sidebar-text-muted: #b6b6b6;
    --sidebar-hover-bg: #f8f9fa;
    --card-bg: #ffffff;
    --card-border: #ebedf2;
    --primary-color: #b66dff;
    --primary-hover: #9a55ff;
    --primary-gradient: linear-gradient(to right, #da8cff, #9a55ff);
    --primary-gradient-hover: linear-gradient(to right, #9a55ff, #da8cff);
    --text-main: #343a40;
    --text-muted: #9c9fa6;
    --danger: #fe7c96;
}

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

body {
    background: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--card-border);
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 3rem;
    padding-left: 1rem;
    color: var(--primary-color);
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-item {
    display: block;
    padding: 1rem;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
    font-weight: 500;
}

.nav-item:hover, .nav-item.active {
    background: var(--sidebar-hover-bg);
    color: var(--primary-color);
}

/* Sidebar Dropdown Group */
.nav-group {
    margin-bottom: 0.5rem;
}

.nav-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    color: var(--sidebar-text);
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-group-header:hover {
    background: var(--sidebar-hover-bg);
    color: var(--primary-color);
}

.nav-group-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.nav-group.expanded .nav-group-icon {
    transform: rotate(180deg);
}

.nav-group-items {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding-left: 1rem;
}

.nav-group.expanded .nav-group-items {
    max-height: 800px; /* Adjust if more items are added */
}

/* Dashboard Layout */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.card {
    padding: 2.5rem 2rem;
    background: var(--card-bg);
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.05);
    text-align: left;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-gradient);
}

.card h3 {
    font-size: 1.1rem;
    color: var(--text-main);
    margin-bottom: 1rem;
    font-weight: 600;
}

.card p {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Main Content */
.content {
    flex: 1;
    padding: 2rem 3rem;
    overflow-y: auto;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

h1 {
    font-weight: 600;
    font-size: 2rem;
    color: var(--text-main);
}

.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

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

.primary-btn:hover {
    background: var(--primary-gradient-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(182, 109, 255, 0.3);
}

.danger-btn {
    background: white;
    color: var(--danger);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--danger);
    box-shadow: none;
}
.danger-btn:hover {
    background: var(--danger);
    color: white;
}

/* Panels & Tables */
.glass-panel {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.table-container {
    padding: 1rem;
    overflow-x: auto;
}

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

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

th {
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    background: var(--sidebar-hover-bg);
}

tbody tr:hover {
    background: #fdfcff;
}

.hidden-section {
    display: none;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    width: 90%;
    max-width: 800px;
    padding: 2rem;
    position: relative;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    transform: translateY(0);
    transition: transform 0.2s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.modal.hidden .modal-content {
    transform: translateY(-20px);
}

.modal-content h2 {
    color: var(--text-main);
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 0.5rem;
}

.close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: var(--text-main);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

input, select {
    padding: 0.6rem;
    border-radius: 6px;
    border: 1px solid var(--card-border);
    background: #fff;
    color: var(--text-main);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease;
}

input:focus, select:focus {
    border-color: var(--primary-color);
}

.hidden {
    display: none !important;
}

/* Status Colors */
.status-pending { color: #d97706; font-weight: 600; }
.status-received { color: #16a34a; font-weight: 600; }

/* In-table form inputs styling to match corporate theme */
td input, td select {
    background: #fff !important;
    border: 1px solid var(--card-border) !important;
    color: var(--text-main) !important;
    font-size: 0.9rem !important;
    padding: 0.4rem !important;
}

td input:focus {
    border-color: var(--primary-color) !important;
}

/* Print Styles */
@media print {
    body * {
        visibility: hidden;
    }
    #print-area, #print-area *, #print-quotation-area, #print-quotation-area *, #print-area-modern, #print-area-modern * {
        visibility: visible;
    }
    #print-area, #print-quotation-area, #print-area-modern {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        color: #000;
    }
    .print-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 2px solid #000;
        padding-bottom: 1rem;
        margin-bottom: 2rem;
    }
    .print-meta {
        margin-bottom: 2rem;
        display: flex;
        justify-content: space-between;
    }
    .print-table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 2rem;
    }
    .print-table th, .print-table td {
        border: 1px solid #ddd;
        padding: 0.5rem;
    }
    .print-table th {
        background-color: #f4f4f5;
        font-weight: bold;
    }
    .print-total-row td {
        font-weight: bold;
        background-color: #fafafa;
    }
    .print-footer {
        margin-top: 3rem;
        border-top: 1px solid #ddd;
        padding-top: 1rem;
    }
    .print-thanks {
        text-align: center;
        margin-top: 2rem;
        font-style: italic;
    }
}
