* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.5;
    color: #333;
    background: #f5f5f5;
}

body.sidebar-open {
    overflow: hidden;
}

body.therapy-modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
}

/* Mobile Header */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #2c3e50;
    color: white;
    align-items: center;
    padding: 0 1rem;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.mobile-header .logo {
    font-size: 1.25rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 1001;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 260px;
    background: #2c3e50;
    color: white;
    z-index: 1001;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.sidebar-header-adaptive {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

/* Light background when logo is present */
.sidebar-header-adaptive:has(img) {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.sidebar-header-adaptive:has(img) .sidebar-logo {
    color: #2c3e50;
}

.sidebar-header-adaptive:has(img) .sidebar-tagline {
    color: #7f8c8d;
}

.sidebar-logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
    display: block;
}

.sidebar-logo-img {
    max-width: 100%;
    height: auto;
    max-height: 60px;
    display: block;
    margin: 0 auto;
}

.mobile-logo-img {
    height: 40px;
    display: block;
}

.sidebar-nav {
    padding: 0.5rem 0;
}

.nav-menu {
    list-style: none;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    gap: 0.75rem;
    position: relative;
}

.nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.nav-link.active {
    background: rgba(255,255,255,0.15);
    color: white;
    border-left: 4px solid #3498db;
}

/* Prevent dropdown parent from showing active when just open */
.nav-dropdown > .nav-link {
    border-left: none !important;
    background: transparent !important;
}

.nav-dropdown > .nav-link::before {
    display: none !important;
}

/* Only show active on dropdown parent when actually active */
.nav-dropdown > .nav-link.active {
    background: rgba(255,255,255,0.15) !important;
    border-left: 4px solid #3498db !important;
}

/* Hover state for dropdown */
.nav-dropdown > .nav-link:hover:not(.active) {
    background: rgba(255,255,255,0.1) !important;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #3498db;
}

.nav-icon {
    font-size: 1.25rem;
    width: 24px;
    height: 24px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.nav-text {
    font-size: 1rem;
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Content Wrapper */
.content-wrapper {
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 1.25rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .mobile-header {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }

    .content-wrapper {
        margin-left: 0;
        padding-top: 60px;
    }

    .main-content {
        padding: 1rem;
    }

    .container {
        padding: 15px;
    }
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.page-header h1 {
    color: #2c3e50;
    font-size: clamp(1.5rem, 4vw, 1.75rem);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #ecf0f1;
    color: #2c3e50;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    text-align: center;
    vertical-align: middle;
}

.btn:hover {
    background: #bdc3c7;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #229954;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Table */
.table {
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow-x: auto;
    display: block;
}

.table thead {
    background: #34495e;
    color: white;
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    white-space: nowrap;
}

.table tbody tr {
    border-bottom: 1px solid #ecf0f1;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

/* Data Table - with proper spacing */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
}

.data-table thead {
    background: #34495e;
    color: white;
}

.data-table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.data-table th:last-child {
    border-right: none;
}

.data-table td {
    padding: 0.25rem 1rem;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
    border-right: 1px solid #ecf0f1;
}

.data-table td:last-child {
    border-right: none;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.625rem 0.75rem;
        font-size: 0.875rem;
    }
}

/* Forms */
.form {
    background: white;
    padding: 1.25rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 0.25rem;
}

.form-group {
    margin-bottom: 0.25rem !important;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    color: #2c3e50;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .form {
        padding: 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.stat-card {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-card h3 {
    color: #7f8c8d;
    font-size: 0.75rem;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.stat-number {
    font-size: 1.75rem;
    font-weight: bold;
    color: #2c3e50;
    line-height: 1;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .stat-card {
        padding: 0.875rem;
    }

    .stat-card h3 {
        font-size: 0.65rem;
        margin-bottom: 0.375rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-active {
    background: #d4edda;
    color: #155724;
}

.badge-expired {
    background: #f8d7da;
    color: #721c24;
}

.badge-suspended {
    background: #fff3cd;
    color: #856404;
}

/* Auth Container */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem;
}

.auth-box {
    background: white;
    padding: 3rem;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.auth-box h1 {
    margin-bottom: 2rem;
    color: #2c3e50;
    text-align: center;
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo img {
    max-width: 200px;
    max-height: 80px;
    margin-bottom: 1rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.login-logo h1 {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
    font-size: 1.8rem;
}

.login-logo p {
    margin: 0;
    color: #7f8c8d;
    font-size: 0.95em;
}

.login-tagline {
    color: #667eea;
    font-weight: 500;
    margin-top: 0.25rem;
}

@media (max-width: 768px) {
    .auth-box {
        padding: 2rem 1.5rem;
    }
    
    .login-logo h1 {
        font-size: 1.5rem;
    }
}

/* Alert */
.alert {
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Detail Card */
.detail-card {
    background: white;
    padding: 1.25rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.detail-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    padding: 0.75rem 0;
    border-bottom: 1px solid #ecf0f1;
    gap: 1rem;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row label {
    font-weight: 600;
    color: #7f8c8d;
}

@media (max-width: 768px) {
    .detail-card {
        padding: 1.5rem;
    }

    .detail-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}

/* Error Page */
.error-page {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    text-align: center;
}

.error-page h1 {
    font-size: 8rem;
    color: #e74c3c;
    margin-bottom: 1rem;
}

.error-page h2 {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.error-page p {
    color: #7f8c8d;
    margin-bottom: 2rem;
}

/* Footer */
.footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: auto;
}

@media (max-width: 768px) {
    .footer {
        padding: 1rem;
        font-size: 0.875rem;
    }
}

/* Recent Section */
.recent-section {
    margin-top: 2rem;
}

.recent-section h2 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.section-header h2 {
    margin-bottom: 0;
    color: #2c3e50;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #ecf0f1;
}

.modal-header h2 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.75rem;
    color: #7f8c8d;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #ecf0f1;
    color: #2c3e50;
}

.modal-body {
    padding: 1.25rem;
}

.modal-body p {
    margin-bottom: 0.75rem;
    color: #2c3e50;
    font-size: 0.95rem;
    line-height: 1.5;
}

.modal-body p:last-child {
    margin-bottom: 0;
}

.text-muted {
    color: #7f8c8d;
    font-size: 0.875rem;
}

.text-success {
    color: #27ae60;
    font-weight: 500;
}

.text-warning {
    color: #f39c12;
    font-weight: 500;
}

.text-danger {
    color: #e74c3c;
    font-weight: 500;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid #ecf0f1;
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 1rem;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-header h2 {
        font-size: 1.25rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-footer {
        padding: 1rem;
        flex-direction: column-reverse;
    }

    .modal-footer .btn {
        width: 100%;
    }
}

/* Therapy Report Modal Styles */
.therapy-modal {
    display: none;
    position: fixed;
    z-index: 10001 !important;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    animation: therapyModalFadeIn 0.3s ease;
    backdrop-filter: blur(2px);
}

.therapy-modal.show {
    display: block !important;
}

.therapy-modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border: 1px solid #888;
    width: 90%;
    max-width: 800px;
    border-radius: 8px;
    max-height: 90vh;
    overflow-y: auto;
    animation: therapyModalSlideIn 0.3s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    position: relative;
    z-index: 10002 !important;
}

.therapy-modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.therapy-modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.25rem;
    font-weight: 600;
}

.therapy-modal-header button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.therapy-modal-header button:hover {
    background-color: #e9ecef;
    color: #333;
}

.therapy-modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.therapy-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #ddd;
    text-align: right;
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

@keyframes therapyModalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes therapyModalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive therapy modal */
@media (max-width: 768px) {
    .therapy-modal-content {
        width: 95%;
        margin: 10% auto;
        max-height: 85vh;
    }

    .therapy-modal-header {
        padding: 1rem;
    }

    .therapy-modal-body {
        padding: 1rem;
    }

    .therapy-modal-footer {
        padding: 1rem;
        flex-direction: column-reverse;
    }

    .therapy-modal-footer .btn {
        width: 100%;
        margin: 0.25rem 0;
    }
}



/* Property-specific badges */
.badge-buy {
    background: #d1ecf1;
    color: #0c5460;
}

.badge-sell {
    background: #d4edda;
    color: #155724;
}

.badge-rent {
    background: #fff3cd;
    color: #856404;
}

.badge-available {
    background: #d4edda;
    color: #155724;
}

.badge-pending {
    background: #fff3cd;
    color: #856404;
}

.badge-sold {
    background: #f8d7da;
    color: #721c24;
}

.badge-rented {
    background: #d1ecf1;
    color: #0c5460;
}

/* Filters Section */
.filters-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.filters-form {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 150px;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.filter-group select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
}

.filter-group select:focus {
    outline: none;
    border-color: #3498db;
}

@media (max-width: 768px) {
    .filters-form {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        width: 100%;
    }
}

/* Form Sections */
.form-section {
    margin-bottom: 1.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid #ecf0f1;
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.15rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

/* Detail View Enhancements */
.detail-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #ecf0f1;
}

.detail-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.detail-section h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-item label {
    font-weight: 600;
    color: #7f8c8d;
    font-size: 0.875rem;
    text-transform: uppercase;
}

.detail-item span {
    color: #2c3e50;
    font-size: 1rem;
}

.detail-item .price {
    font-size: 1.5rem;
    font-weight: bold;
    color: #27ae60;
}

@media (max-width: 768px) {
    .detail-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Settings Page Styles */
.logo-preview {
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.logo-preview img {
    display: block;
    margin-bottom: 1rem;
}

.theme-preview {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
    margin-top: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

.sidebar-tagline {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 0.5rem;
    text-align: center;
}

/* Alert Success */
.alert-success {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* File Input Styling */
input[type="file"] {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 100%;
    cursor: pointer;
}

input[type="file"]::-webkit-file-upload-button {
    padding: 0.5rem 1rem;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 1rem;
}

input[type="file"]::-webkit-file-upload-button:hover {
    background: #2980b9;
}


/* FINAL OVERRIDE - Force nav-link to have no background unless active */
.sidebar .nav-menu .nav-link {
    background: transparent !important;
}

.sidebar .nav-menu .nav-link:hover {
    background: rgba(255,255,255,0.1) !important;
}

.sidebar .nav-menu .nav-link.active {
    background: rgba(255,255,255,0.15) !important;
    border-left: 4px solid #3498db !important;
}

/* Specific override for dropdown */
.sidebar .nav-menu .nav-dropdown > .nav-link {
    background: transparent !important;
    border-left: none !important;
}

/* .sidebar .nav-menu .nav-dropdown > .nav-link.active {
    background: rgba(255,255,255,0.15) !important;
    border-left: 4px solid #3498db !important;
} */

/* Ayurvedic Pariksha Accordion Styles */
.pariksha-accordion {
    margin-top: 1.5rem;
}

.accordion-item {
    margin-bottom: 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: white;
    overflow: hidden;
}

.accordion-header {
    width: 100%;
    padding: 0.875rem 1rem;
    background: #f8f9fa;
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #2c3e50;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.accordion-header:hover {
    background: #e9ecef;
}

.accordion-header.active {
    background: #3498db;
    color: white;
}

.accordion-icon {
    transition: transform 0.3s;
    font-size: 0.75rem;
    font-weight: bold;
}

.accordion-header.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    display: none;
    padding: 1rem;
    background: white;
}

.accordion-content.active {
    display: block;
}

.pariksha-section {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
}

.pariksha-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.pariksha-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-size: 0.9rem;
}

.pariksha-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.pariksha-options label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    cursor: pointer;
    font-size: 0.85rem;
    color: #555;
    font-weight: normal;
}

.pariksha-options input[type="checkbox"] {
    cursor: pointer;
    width: 14px;
    height: 14px;
}

@media (max-width: 768px) {
    .pariksha-options {
        gap: 0.5rem;
    }
    
    .accordion-content {
        padding: 0.75rem;
    }
}

/* Prakriti Calculator Styles */
.prakriti-calculator {
    margin-top: 1rem;
}

.prakriti-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    margin-bottom: 1.5rem;
}

.prakriti-table thead {
    background: #34495e;
    color: white;
}

.prakriti-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid #dee2e6;
}

.prakriti-table td {
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    font-size: 0.85rem;
    vertical-align: middle;
}

.prakriti-table tbody tr:hover {
    background: #f8f9fa;
}

.characteristic-label {
    font-weight: 600;
    color: #2c3e50;
    background: #f8f9fa;
}

.radio-cell {
    text-align: center;
    padding: 0.5rem;
}

.radio-cell input[type="radio"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.description-cell {
    color: #555;
    line-height: 1.5;
}

.prakriti-results {
    display: flex;
    gap: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 4px;
    border: 2px solid #3498db;
    justify-content: center;
    flex-wrap: wrap;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.result-item label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1rem;
}

.score-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #3498db;
    min-width: 30px;
    text-align: center;
}

@media (max-width: 768px) {
    .prakriti-table {
        font-size: 0.75rem;
    }
    
    .prakriti-table th,
    .prakriti-table td {
        padding: 0.5rem 0.35rem;
    }
    
    .prakriti-results {
        flex-direction: column;
        gap: 1rem;
    }
    
    .result-item {
        justify-content: space-between;
    }
}

/* Prescription Tab Styles */
.summary-section {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    border-left: 4px solid #3498db;
    margin-bottom: 1rem;
}

.summary-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.summary-item {
    display: flex;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.summary-item strong {
    color: #2c3e50;
    min-width: 150px;
}

.summary-item span {
    color: #555;
}

/* Medicine Grid Styles */
.medicine-row {
    margin-bottom: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0.75rem;
    background: white;
}

.medicine-header-grid {
    display: grid;
    grid-template-columns: 40px 1fr 50px;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.medicine-grid {
    display: grid;
    grid-template-columns: 40px 2fr 1fr 1.2fr 1.2fr 1fr 1.5fr 50px;
    gap: 0.5rem;
    align-items: center;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.medicine-cell {
    display: flex;
    align-items: center;
}

.medicine-sr {
    font-weight: 600;
    color: #2c3e50;
    justify-content: center;
    font-size: 0.9rem;
}

.medicine-action {
    justify-content: center;
}

/* Dosage Chart Styles */
.dosage-chart {
    margin-top: 0.75rem;
    overflow-x: auto;
}

.dosage-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    background: white;
}

.dosage-table th {
    background: #34495e;
    color: white;
    padding: 0.5rem;
    text-align: center;
    border: 1px solid #2c3e50;
    font-weight: 600;
    font-size: 0.75rem;
}

.dosage-table td {
    padding: 0.35rem;
    border: 1px solid #dee2e6;
    text-align: center;
}

.dosage-label {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.dosage-input {
    width: 100%;
    padding: 0.35rem;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-align: center;
    font-size: 0.85rem;
}

.dosage-input:focus {
    outline: none;
    border-color: #3498db;
}

.dosage-select {
    width: 100%;
    padding: 0.35rem;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 0.85rem;
}

.unit-field {
    background: #f8f9fa;
    cursor: not-allowed;
}

.medicine-name-hidden {
    display: none;
}

.btn-add-medicine {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: none;
    background: #27ae60;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.btn-add-medicine:hover {
    background: #229954;
}

.btn-remove-medicine {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: none;
    background: #e74c3c;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.btn-remove-medicine:hover {
    background: #c0392b;
}

/* Investigation Grid Styles */
.investigation-row {
    margin-bottom: 0.5rem;
}

.investigation-grid {
    display: grid;
    grid-template-columns: 40px 2fr 2fr 50px;
    gap: 0.5rem;
    align-items: center;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.investigation-cell {
    display: flex;
    align-items: center;
}

.investigation-sr {
    font-weight: 600;
    color: #2c3e50;
    justify-content: center;
    font-size: 0.9rem;
}

.investigation-action {
    justify-content: center;
}

.btn-add-investigation {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: none;
    background: #27ae60;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.btn-add-investigation:hover {
    background: #229954;
}

.btn-remove-investigation {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: none;
    background: #e74c3c;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.btn-remove-investigation:hover {
    background: #c0392b;
}

@media (max-width: 768px) {
    .medicine-grid {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }
    
    .medicine-sr,
    .investigation-sr {
        justify-content: flex-start;
    }
    
    .investigation-grid {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }
    
    .summary-item {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .summary-item strong {
        min-width: auto;
    }
}

/* Therapy Modal Styles */
.therapy-modal {
    display: none;
    position: fixed;
    z-index: 10001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s ease;
}

.therapy-modal.show {
    display: block;
}

.therapy-modal-content {
    background-color: #fefefe;
    margin: 50px;
    padding: 0;
    border: 1px solid #888;
    width: calc(100vw - 100px);
    height: calc(100vh - 100px);
    border-radius: 8px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

.therapy-modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border-radius: 0;
    position: relative;
}

.therapy-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    flex: 1;
}

.therapy-modal-header button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.therapy-modal-header button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.therapy-modal-body {
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
}

.therapy-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #ddd;
    text-align: right;
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
}

.therapy-modal-footer .btn {
    margin-left: 0.5rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .therapy-modal-content {
        width: calc(100vw - 20px);
        margin: 10px;
        max-height: calc(100vh - 20px);
        height: calc(100vh - 20px);
    }
    
    .therapy-modal-header {
        padding: 0.75rem 1rem;
    }
    
    .therapy-modal-body {
        padding: 1rem;
    }
    
    .therapy-modal-footer {
        padding: 0.75rem 1rem;
        text-align: center;
    }
    
    .therapy-modal-footer .btn {
        width: 100%;
        margin: 0.25rem 0;
    }
}

/* Therapy Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    padding: 0;
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.action-btn.btn-view {
    background: #3498db;
    color: white;
}

.action-btn.btn-view:hover {
    background: #2980b9;
}

.action-btn.btn-edit {
    background: #f39c12;
    color: white;
}

.action-btn.btn-edit:hover {
    background: #e67e22;
}

.action-btn.btn-delete {
    background: #e74c3c;
    color: white;
}

.action-btn.btn-delete:hover {
    background: #c0392b;
}

.action-btn svg {
    width: 16px;
    height: 16px;
}
