:root {
    --primary: #2d5a27;
    --primary-light: #4a7c44;
    --accent: #8b5e3c;
    --bg: #fdfbf7;
    --text: #2c3e50;
    --text-muted: #7f8c8d;
    --white: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.8);
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    background-image: 
        radial-gradient(at 0% 0%, hsla(110, 40%, 90%, 1) 0, transparent 50%), 
        radial-gradient(at 50% 0%, hsla(40, 40%, 90%, 1) 0, transparent 50%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

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

h1 {
    font-size: 2.5rem;
    color: var(--primary);
    font-weight: 800;
    letter-spacing: -1px;
}

h1 span {
    color: var(--accent);
}

/* Dashboard Grid */
.dashboard {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
}

/* Sections */
section {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.section-title {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Search Bar */
.search-container {
    position: relative;
    margin-bottom: 2rem;
}

.search-input {
    width: 100%;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    border: 1px solid rgba(0,0,0,0.1);
    background: var(--white);
    font-size: 1rem;
    transition: var(--transition);
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(45, 90, 39, 0.1);
}

/* Plant Grid */
.plant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}

.plant-card {
    background: var(--white);
    border-radius: var(--border-radius);
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
}

.plant-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.plant-image-container {
    width: 100%;
    height: 200px;
    position: relative;
    overflow: hidden;
}

.plant-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.plant-info {
    padding: 1.25rem;
}

.plant-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.plant-name {
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.plant-price {
    color: var(--primary);
    font-weight: 600;
}

/* Customer Sidebar */
.customer-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.customer-select {
    width: 100%;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.1);
    margin-bottom: 1rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

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

.btn-primary:hover {
    background: var(--primary-light);
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-ghost:hover {
    background: rgba(45, 90, 39, 0.05);
}

/* List Items */
.list-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.list-item:last-child {
    border-bottom: none;
}

.list-item-info {
    flex: 1;
}

.list-item-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.list-item-qty {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.remove-btn {
    color: #e74c3c;
    cursor: pointer;
    font-size: 1.2rem;
}

.modal, .modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: none; /* Controlled by JS */
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}

.modal-content {
    background: white;
    padding: 2.5rem;
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 600px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    animation: fadeIn 0.3s ease-out;
    position: relative;
}

.form-group {
    margin-bottom: 1.25rem;
}

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

.form-group input, .form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(45, 90, 39, 0.1);
}

.modal-btns {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.modal-btns .btn {
    flex: 1;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 32px;
    height: 32px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-muted);
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: var(--transition);
}

.close-btn:hover {
    color: var(--primary);
    transform: rotate(90deg);
}

/* Admin Table */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.admin-table th, .admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.admin-table th {
    background: rgba(45, 90, 39, 0.05);
    color: var(--primary);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.plant-scientific {
    font-size: 0.8rem;
    font-style: italic;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.plant-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.plant-details span {
    background: rgba(46, 125, 50, 0.1);
    color: var(--primary);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.detail-modal {
    max-width: 800px !important;
    max-height: 70vh;
    padding: 0 !important;
    overflow: hidden;
    border-radius: 24px;
    display: flex;
}

.detail-grid {
    display: grid;
    grid-template-columns: 45% 55%;
    gap: 0;
    width: 100%;
}

.detail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-info {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    max-height: 70vh;
    overflow-y: auto;
    background: white;
}

.detail-info h2 {
    font-size: 2rem;
    color: var(--text-dark);
}

.detail-tags {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    background: var(--bg-soft);
    padding: 1.5rem;
    border-radius: 12px;
}

.detail-tag-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.detail-tag-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.detail-tag-value {
    font-weight: 600;
    color: var(--text-dark);
}

.detail-description {
    line-height: 1.6;
    color: var(--text-muted);
}

.action-btns {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.detail-info::-webkit-scrollbar {
    width: 6px;
}

.detail-info::-webkit-scrollbar-track {
    background: transparent;
}

.detail-info::-webkit-scrollbar-thumb {
    background: #e0e0e0;
    border-radius: 10px;
}

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

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

.animate-fade {
    animation: fadeIn 0.5s ease-out forwards;
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    body > .container > header,
    .dashboard > main,
    .dashboard > aside,
    #adminView,
    .modal {
        display: none !important;
    }
    
    #printTemplate {
        display: block !important;
        width: 100%;
    }
    
    .print-header {
        display: flex;
        align-items: center;
        margin-bottom: 2rem;
        border-bottom: 2px solid var(--primary);
        padding-bottom: 1rem;
    }
    .print-logo img {
        height: 60px;
        margin-right: 1.5rem;
    }
    .print-company-info h2 {
        font-size: 1.2rem;
        color: #000;
        margin: 0;
    }
    .print-company-info p {
        margin: 0;
        font-size: 0.9rem;
        color: #333;
    }
    .print-title {
        text-align: center;
        margin-bottom: 2rem;
        font-size: 1.5rem;
        color: var(--primary);
    }
    
    .print-item {
        page-break-inside: avoid;
        margin-bottom: 2rem;
        display: flex;
        gap: 1rem;
        border-bottom: 1px solid #ccc;
        padding-bottom: 1rem;
    }
    .print-item-img {
        width: 150px;
        height: 150px;
        object-fit: cover;
    }
    .print-item-details {
        flex: 1;
    }
    .print-item-details h3 {
        margin-top: 0;
        margin-bottom: 0.5rem;
        color: var(--primary);
        font-size: 1.1rem;
    }
    .print-item-props {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }
    .print-item-desc {
        font-size: 0.85rem;
        color: #333;
    }
}
