/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 0;
}

::-webkit-scrollbar-thumb {
    background: #4a8f47;
    border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
    background: #3b7239;
    border-radius: 0;
}

/* Table hover effects */
.table-row-hover {
    transition: all 0.2s ease-in-out;
}

/* Input focus effects */
input:focus, select:focus, textarea:focus {
    box-shadow: 0 0 0 2px rgba(74, 143, 71, 0.2);
    outline: none;
}

/* Button hover animations */
button {
    transition: all 0.2s ease-in-out;
}

/* Custom animations */
@keyframes slideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.slide-in {
    animation: slideIn 0.3s ease-out forwards;
}

/* Modal animations */
.modal-enter {
    animation: modalEnter 0.3s ease-out forwards;
}

@keyframes modalEnter {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Chat message animations */
.message-enter {
    animation: messageEnter 0.3s ease-out forwards;
}

@keyframes messageEnter {
    from {
        transform: translateY(10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Table row hover effect */
tr:hover td {
    background-color: rgba(74, 143, 71, 0.05);
}

/* Custom focus rings for accessibility */
*:focus {
    outline: 2px solid rgba(74, 143, 71, 0.5);
    outline-offset: 2px;
}

/* Modal improvements */
#plantModal > div,
#addWateringModal > div,
#importModalOverlay > div,
#transferCodeModal > div {
    max-width: 90%;
    max-height: 80vh;
    margin: 2rem auto;
}

/* Mobile modal fixes */
@media (max-width: 640px) {
    #plantModal > div,
    #addWateringModal > div,
    #importModalOverlay > div,
    #transferCodeModal > div {
        max-width: 95%;
        max-height: 75vh;
        margin: 1rem;
        padding: 1.5rem;
        border-radius: 1rem;
    }
    
    #chatbox {
        border-radius: 1rem 1rem 0 0 !important;
        max-width: 100vw !important;
        width: 100vw !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        height: auto !important;
        max-height: calc(100vh - 120px) !important;
        z-index: 40; /* Niżej niż modale */
        margin-bottom: env(safe-area-inset-bottom, 0);
    }
    
    #chatboxContent {
        max-height: calc(100vh - 180px - env(safe-area-inset-bottom, 0)) !important;
    }
    
    /* Ensure input area is always visible on mobile */
    #chatForm {
        padding-bottom: calc(env(safe-area-inset-bottom, 0) + 1rem);
    }
    
    #chatbox {
        padding-bottom: env(safe-area-inset-bottom, 0);
    }
    
    /* Additional mobile fixes for better accessibility */
    @supports (padding-bottom: env(safe-area-inset-bottom)) {
        #chatbox {
            padding-bottom: env(safe-area-inset-bottom);
        }
    }
    
    /* Ensure keyboard doesn't cover input on iOS */
    @media (max-width: 640px) {
        #messageContainer {
            max-height: calc(60vh - 120px) !important;
        }
        
        #chatboxContent {
            max-height: calc(80vh - 120px) !important;
        }
    }
}

/* Ensure modals are above chatbox */
#plantModal,
#addWateringModal,
#importModalOverlay,
#transferCodeModal {
    z-index: 50;
}

/* Better modal positioning */
@media (min-width: 641px) {
    #plantModal > div,
    #addWateringModal > div,
    #importModalOverlay > div,
    #transferCodeModal > div {
        max-width: 600px;
        max-height: 75vh;
        margin: 2rem auto;
    }
}

/* Landscape mobile */
@media (max-width: 640px) and (orientation: landscape) {
    #plantModal > div,
    #addWateringModal > div,
    #importModalOverlay > div,
    #transferCodeModal > div {
        max-height: 70vh;
        margin: 0.5rem;
    }
}

/* Responsive table: horizontal scroll on small screens */
@media (max-width: 900px) {
    table {
        font-size: 0.95rem;
    }
    th, td {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
}

/* Plant cards grid and card styles */
#plantCardsContainer {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 0.5rem;
}
@media (min-width: 640px) {
    #plantCardsContainer {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (min-width: 1024px) {
    #plantCardsContainer {
        grid-template-columns: repeat(3, 1fr);
    }
}
#plantCardsContainer > div {
    background: #fff;
    border: 1.5px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(60, 60, 60, 0.07);
    border-radius: 1.1rem;
    padding: 1.5rem 1.25rem 1.7rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    transition: box-shadow 0.22s, transform 0.22s, border-color 0.22s;
    position: relative;
}

#plantCardsContainer > div[data-pinned="true"] {
    border-color: #4a8f47;
    background: linear-gradient(to bottom right, #fff, #f8fef8);
}

#plantCardsContainer > div[data-pinned="true"]:hover {
    border-color: #3b7239;
}

#plantCardsContainer > div:hover {
    box-shadow: 0 8px 24px rgba(60, 60, 60, 0.13);
    border-color: #b6e2c1;
    transform: translateY(-4px) scale(1.012);
    background: #f8fef8;
}
#plantCardsContainer button {
    min-width: 44px;
    min-height: 44px;
    font-size: 1rem;
}
#plantCardsContainer .text-xl {
    font-size: 1.5rem;
}
#plantCardsContainer .font-bold {
    font-size: 1.15rem;
}
#plantCardsContainer .font-medium {
    font-weight: 500;
}
#plantCardsContainer .text-gray-800 {
    color: #222;
}
#plantCardsContainer .text-gray-500 {
    color: #6b7280;
}
#plantCardsContainer .text-blue-700 {
    color: #2563eb;
}
#plantCardsContainer .bg-blue-50 {
    background: #eff6ff;
}
#plantCardsContainer .border-blue-200 {
    border-color: #bfdbfe;
}
#plantCardsContainer .hover\:bg-blue-100:hover {
    background: #dbeafe;
}
#plantCardsContainer .bg-indigo-50 {
    background: #eef2ff;
}
#plantCardsContainer .hover\:bg-indigo-100:hover {
    background: #e0e7ff;
}
#plantCardsContainer .bg-red-50 {
    background: #fef2f2;
}
#plantCardsContainer .hover\:bg-red-100:hover {
    background: #fee2e2;
}
#plantCardsContainer .rounded-full {
    border-radius: 9999px;
}
#plantCardsContainer .rounded-lg {
    border-radius: 0.75rem;
}
#plantCardsContainer .rounded-xl {
    border-radius: 1rem;
}
#plantCardsContainer .shadow-md {
    box-shadow: 0 2px 8px rgba(60, 60, 60, 0.07);
}
#plantCardsContainer .hover\:shadow-lg:hover {
    box-shadow: 0 6px 20px rgba(60, 60, 60, 0.13);
}
#plantCardsContainer .transition {
    transition: all 0.2s;
}
#plantCardsContainer .flex {
    display: flex;
}
#plantCardsContainer .flex-col {
    flex-direction: column;
}
#plantCardsContainer .gap-3 {
    gap: 0.75rem;
}
#plantCardsContainer .gap-2 {
    gap: 0.5rem;
}
#plantCardsContainer .gap-4 {
    gap: 1rem;
}
#plantCardsContainer .items-center {
    align-items: center;
}
#plantCardsContainer .justify-between {
    justify-content: space-between;
}
#plantCardsContainer .mb-1 {
    margin-bottom: 0.25rem;
}
#plantCardsContainer .mb-2 {
    margin-bottom: 0.5rem;
}
#plantCardsContainer .mt-1 {
    margin-top: 0.25rem;
}
#plantCardsContainer .mt-3 {
    margin-top: 0.75rem;
}
#plantCardsContainer .w-full {
    width: 100%;
}
#plantCardsContainer .w-10 {
    width: 2.5rem;
}
#plantCardsContainer .h-10 {
    height: 2.5rem;
}
#plantCardsContainer .py-2 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}
#plantCardsContainer .p-5 {
    padding: 1.25rem;
}
#plantCardsContainer .text-lg {
    font-size: 1.125rem;
}
#plantCardsContainer .text-sm {
    font-size: 0.95rem;
}
#plantCardsContainer .text-xs {
    font-size: 0.82rem;
}
#plantCardsContainer .space-y-1 > :not([hidden]) ~ :not([hidden]) {
    margin-top: 0.25rem;
}
#plantCardsContainer .relative {
    position: relative;
}

/* Mobile: 1 kolumna, większe odstępy */
@media (max-width: 640px) {
    #plantCardsContainer {
        grid-template-columns: 1fr !important;
        gap: 1.2rem;
    }
    #plantCardsContainer > div {
        padding: 1rem 0.5rem 1.25rem 0.5rem;
        font-size: 1rem;
    }
}

/* Tablet optimization */
@media (min-width: 768px) and (max-width: 1023px) {
    #plantCardsContainer {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        padding: 0.5rem;
    }

    #chatbox {
        max-width: 360px;
        right: 2rem;
        bottom: 2rem;
    }

    .container {
        padding-left: 2rem;
        padding-right: 2rem;
    }

    /* Popraw padding i rozmiar przycisków na tabletach */
    #addPlantBtn,
    #exportImportMenuBtn {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        font-size: 1rem !important;
        min-height: 44px;
    }
    #addPlantBtn svg,
    #exportImportMenuBtn svg {
        width: 1.25rem;
        height: 1.25rem;
    }
}

/* Watering history table styles */
.watering-history-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0.25rem;
    font-size: 0.85em; /* zmniejsz ogólny rozmiar czcionki */
}
.watering-history-table th,
.watering-history-table td {
    border-bottom: 1px solid #f3f4f6;
    padding: 0.10rem 0.30rem; /* zmniejsz padding */
    line-height: 1;         /* zmniejsz wysokość wiersza */
}
.watering-history-table th {
    background: #f9fafb;
    font-weight: 500;
    font-size: 0.92em;
    letter-spacing: 0.01em;
    padding-top: 0.05rem;
    padding-bottom: 0.05rem;
}
.watering-history-table tr:last-child td {
    border-bottom: none;
}
.watering-history-table td {
    background: transparent;
}
.watering-history-table button {
    padding: 0.05rem 0.18rem;
    border-radius: 0.25rem;
    font-size: 1em;
    line-height: 1;
    vertical-align: middle;
}
.watering-history-table td:last-child button {
    opacity: 0;
    transition: opacity 0.2s ease-out;
}

.watering-history-table tr:hover td:last-child button {
    opacity: 1;
}

.watering-history-table td:last-child button svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}
@media (max-width: 640px) {
    .watering-history-table th,
    .watering-history-table td {
        padding: 0.08rem 0.18rem;
        font-size: 0.88em;
    }
    .watering-history-table {
        font-size: 0.88em;
    }
}

/* Watering history scrollable area (max 5 rows visible) */
.watering-history-scroll {
    max-height: 8.5em; /* ok. 5 wierszy przy małej czcionce */
    overflow-y: auto;
    scrollbar-width: thin;
}
.watering-history-scroll::-webkit-scrollbar {
    width: 6px;
    background: #f3f4f6;
}
.watering-history-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
.watering-history-scroll::-webkit-scrollbar-thumb:hover {
    background: #a3a3a3;
}

/* Nowoczesny switch do chatboxa (notatki) */
#chatboxContent label[for="includeNotesCheckbox"] {
    user-select: none;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}
#chatboxContent label[for="includeNotesCheckbox"]:hover {
    background-color: rgba(74, 143, 71, 0.05);
}
#chatboxContent input[type="checkbox"].peer + span {
    cursor: pointer;
    display: block;
    position: relative;
}
#chatboxContent input[type="checkbox"].peer + span + span {
    pointer-events: none;
}
#chatboxContent input[type="checkbox"].peer:checked + span {
    background: linear-gradient(90deg, #4a8f47 60%, #059669 100%);
}
#chatboxContent input[type="checkbox"].peer:checked + span + span {
    border-color: #4a8f47;
}
#chatboxContent input[type="checkbox"].peer:checked + span + span {
    background: #e8f5e9;
}
#chatboxContent input[type="checkbox"].peer:focus + span {
    box-shadow: 0 0 0 2px #4a8f47;
}

/* Better checkbox positioning in modals */
.modal-form-container input[type="checkbox"],
.modal-form-container input[type="radio"] {
    margin-right: 0.5rem;
    margin-left: 0.25rem;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#messageContainer {
    height: 24rem;
    max-height: 24rem;
    overflow-y: auto;
    padding-bottom: 0.5rem;
}

#chatboxContent {
    overflow: visible !important;
    max-height: none !important;
    transition: all 0.3s ease-out;
    transform-origin: bottom right;
}

#chatboxContent.hidden {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

#chatboxContent:not(.hidden) {
    opacity: 1;
    transform: scale(1);
}

#messageContainer ul,
#messageContainer ol {
    margin: 0.2em 0 0.2em 1em;
    padding-left: 0.8em;
}
#messageContainer ul {
    list-style-type: disc;
}
#messageContainer ol {
    list-style-type: decimal;
}
#messageContainer li {
    margin-bottom: 0.1em;
}
#messageContainer pre {
    background: #f3f4f6;
    color: #222;
    border-radius: 0.5em;
    padding: 0.6em 1em;
    font-size: 0.97em;
    overflow-x: auto;
    margin: 0.5em 0;
}
#messageContainer code {
    background: #e8f5e9;
    color: #256029;
    border-radius: 0.3em;
    padding: 0.1em 0.4em;
    font-size: 0.97em;
}
#messageContainer blockquote {
    border-left: 4px solid #4a8f47;
    background: #e8f5e9;
    color: #222;
    margin: 0.5em 0;
    padding: 0.5em 1em;
    border-radius: 0.5em;
    font-style: italic;
}
#messageContainer table {
    border-collapse: collapse;
    width: 100%;
    margin: 0.5em 0;
    font-size: 0.97em;
}
#messageContainer th, #messageContainer td {
    border: 1px solid #cbd5e1;
    padding: 0.3em 0.7em;
    text-align: left;
}
#messageContainer th {
    background: #e8f5e9;
    font-weight: 600;
}
#messageContainer p {
    margin: 0.5em 0;
}
#messageContainer a {
    color: #2563eb;
    text-decoration: underline;
    word-break: break-all;
}

/* Right side modals */
#chatbox,
#plantModal > div,
#addWateringModal > div {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* Animacje dla kart roślin */
@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.plant-card-animate {
    animation: cardAppear 0.5s ease-out forwards;
}

/* Animacje dla modali */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-animate {
    animation: modalSlideIn 0.3s ease-out forwards;
}

/* Style dla ikon statusu */
.status-icons {
    display: flex;
    gap: 0.5rem;
    margin: 0.35rem 0;
    flex-wrap: wrap;
}

.status-icon {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    gap: 0.3rem;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.status-icon svg {
    width: 1rem;
    height: 1rem;
}

.status-water {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #991b1b;
    border-color: #fca5a5;
    box-shadow: 0 1px 3px rgba(252, 165, 165, 0.3);
}

.status-water:hover {
    background: linear-gradient(135deg, #fecaca, #fca5a5);
    transform: translateY(-1px);
}

.status-water-future {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    color: #475569;
    border-color: #cbd5e1;
    box-shadow: 0 1px 3px rgba(203, 213, 225, 0.3);
}

.status-water-future:hover {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    transform: translateY(-1px);
}

/* Progress bar styles */
.progress-container {
    margin: 0.5rem 0;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease-in-out;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-green {
    background: linear-gradient(90deg, #10b981, #059669);
}

.progress-yellow {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.progress-red {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

/* Lepsze ikony dla preferencji */
.preference-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
}

.preference-sun {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    border: 1px solid #fbbf24;
}

.preference-partial {
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
    color: #3730a3;
    border: 1px solid #a5b4fc;
}

.preference-shade {
    background: linear-gradient(135deg, #e5e7eb, #d1d5db);
    color: #374151;
    border: 1px solid #9ca3af;
}

.preference-water {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1e40af;
    border: 1px solid #60a5fa;
}

.preference-rare {
    background: linear-gradient(135deg, #fef7cd, #fef3c7);
    color: #92400e;
    border: 1px solid #fbbf24;
}

.status-temperature {
    background: #ffedd5;
    color: #c2410c;
}

.status-temperature:hover {
    background: #fed7aa;
}

.status-health {
    background: #dcfce7;
    color: #15803d;
}

.status-health:hover {
    background: #bbf7d0;
}

/* Animacje dla chatboxa */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(15px);
    }
}

#chatboxContent {
    overflow: visible !important;
    max-height: none !important;
    transform-origin: bottom;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#chatboxContent.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

#chatboxContent:not(.hidden) {
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    transform: translateY(0);
}

#toggleChat svg {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#chatbox {
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modal form styles */
.modal-form-group {
    margin-bottom: 1.25rem;
}

.modal-form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.modal-form-group input[type="text"],
.modal-form-group input[type="date"],
.modal-form-group input[type="number"],
.modal-form-group select,
.modal-form-group textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s;
    color: #1f2937;
    background-color: #fff;
}

.modal-form-group input[type="text"]:focus,
.modal-form-group input[type="date"]:focus,
.modal-form-group input[type="number"]:focus,
.modal-form-group select:focus,
.modal-form-group textarea:focus {
    border-color: #4a8f47;
    box-shadow: 0 0 0 3px rgba(74, 143, 71, 0.1);
    outline: none;
}

.modal-form-group textarea {
    min-height: 5rem;
    resize: vertical;
}

.modal-form-group .input-hint {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.375rem;
}

.modal-form-section {
    padding: 1.25rem;
    background: #f9fafb;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
}

.modal-form-section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-form-section-title svg {
    width: 1.25rem;
    height: 1.25rem;
    color: #4a8f47;
}

.modal-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (max-width: 640px) {
    .modal-form-grid {
        grid-template-columns: 1fr;
    }
}

.modal-header {
    position: relative;
    padding-bottom: 1.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-submit-btn {
    background: #4a8f47;
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s;
}

.modal-submit-btn:hover {
    background: #3b7239;
}

.modal-cancel-btn {
    color: #6b7280;
    font-weight: 500;
    transition: all 0.2s;
}

.modal-cancel-btn:hover {
    color: #374151;
}

/* Nowe style dla modalu */
.modal-form-container {
    display: grid;
    gap: 1.5rem;
    padding: 1rem;
}

.modal-section {
    background: #f8fafc;
    border-radius: 0.75rem;
    padding: 1.25rem;
    border: 1px solid #e2e8f0;
}

.modal-section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-section-title svg {
    width: 1.25rem;
    height: 1.25rem;
    color: #4a8f47;
}

/* Mobile modal improvements */
@media (max-width: 640px) {
    .modal-form-container {
        padding: 0.5rem;
        gap: 1rem;
    }
    
    .modal-section {
        padding: 1rem;
        margin: 0 -0.5rem;
    }
    
    .modal-section-title {
        font-size: 0.875rem;
        margin-bottom: 0.75rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .modal-form-buttons {
        flex-direction: column;
        gap: 0.5rem;
        margin-top: 1rem;
    }
    
    .modal-form-buttons button {
        width: 100%;
    }
}

/* Modal backdrop improvements */
.modal-backdrop {
    backdrop-filter: blur(4px);
    background: rgba(0, 0, 0, 0.5);
}

/* Smooth modal animations */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes modalSlideOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
}

.modal-animate-in {
    animation: modalSlideIn 0.3s ease-out forwards;
}

.modal-animate-out {
    animation: modalSlideOut 0.2s ease-in forwards;
}

/* Better form inputs on mobile */
@media (max-width: 640px) {
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 0.75rem;
    }
    
    .form-group label {
        font-size: 0.875rem;
        margin-bottom: 0.375rem;
    }
}

/* Scrollbar improvements for modals */
.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #4a8f47;
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #3b7239;
}

/* Filter dropdown styling - matching Export/Import theme */
#sortDropdown {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

#sortDropdown button {
    transition: all 0.2s;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border: none;
    background: none;
    cursor: pointer;
    color: #374151;
}

#sortDropdown button:hover {
    background-color: #f3f4f6;
    color: #111827;
}

#sortDropdown button:first-child {
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

#sortDropdown button:last-child {
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

#sortFilterBtn {
    transition: all 0.2s;
    white-space: nowrap;
}

#sortFilterBtn:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
}


.form-group {
    margin-bottom: 1rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #1f2937;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #4a8f47;
    box-shadow: 0 0 0 3px rgba(74, 143, 71, 0.1);
    outline: none;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.form-hint {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.375rem;
}

.modal-form-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

.modal-form-submit {
    background: #4a8f47;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s;
}

.modal-form-submit:hover {
    background: #3b7239;
}

.modal-form-cancel {
    padding: 0.75rem 1.5rem;
    color: #6b7280;
    font-weight: 500;
    transition: all 0.2s;
}

.modal-form-cancel:hover {
    color: #374151;
}