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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f8f9fc;
    min-height: 100vh;
}

.page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* Login Page */
.login-container {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    text-align: center;
    max-width: 400px;
    border: 1px solid #e5e7eb;
}

.logo-container {
    margin-bottom: 1.5rem;
}

.login-logo {
    max-width: 240px;
    height: auto;
    cursor: pointer;
    transition: opacity 0.3s;
}

.login-logo:hover {
    opacity: 0.8;
}

.login-container h1 {
    color: #1f2937;
    margin-bottom: 1rem;
    font-size: 2rem;
    font-weight: 700;
}

.login-container p {
    color: #6b7280;
    margin-bottom: 2rem;
    font-weight: 400;
}

.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #5e81f4;
    color: white;
    border: 2px solid #5e81f4;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.google-btn:hover {
    background: #4c6fd8;
    border-color: #4c6fd8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(94, 129, 244, 0.3);
}

/* Dashboard */
#dashboard-page {
    display: block;
    min-height: 100vh;
    background: #f8f9fc;
}

.navbar {
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 1rem 2rem;
    border-bottom: 1px solid #e5e7eb;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-logo {
    height: 50px;
    width: auto;
    cursor: pointer;
    transition: opacity 0.3s;
}

.nav-logo:hover {
    opacity: 0.8;
}

.nav-content h2 {
    color: #5e81f4;
    margin: 0;
    font-weight: 700;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #374151;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #5e81f4;
}

.logout-btn {
    background: #5e81f4;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
    font-weight: 600;
}

.logout-btn:hover {
    background: #4c6fd8;
}

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

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

.dashboard-header h1 {
    color: #1f2937;
    font-size: 2rem;
    font-weight: 700;
}

.add-btn {
    background: #5e81f4;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.add-btn:hover {
    background: #4c6fd8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(94, 129, 244, 0.3);
}

.view-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.toggle-container label {
    color: #6b7280;
    font-weight: 600;
    cursor: pointer;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #5e81f4;
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.family-btn {
    background: white;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.family-btn:hover {
    background: #f8f9fc;
    border-color: #5e81f4;
    color: #5e81f4;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(94, 129, 244, 0.2);
}

.insurance-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.insurance-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    min-height: 300px;
    transition: all 0.3s;
}

.insurance-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f3f4f6;
}

.card-header h3 {
    color: #1f2937;
    font-size: 1.3rem;
    font-weight: 700;
}

.count {
    background: #5e81f4;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.875rem;
}

.card-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.insurance-item {
    background: #f8f9fc;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #5e81f4;
    transition: all 0.3s;
}

.insurance-item:hover {
    background: #f3f4f6;
    transform: translateX(4px);
}

.insurance-item.active {
    border-left-color: #10b981;
    background: #f0fdf4;
}

.insurance-item.expired {
    border-left-color: #ef4444;
    background: #fef2f2;
    opacity: 0.8;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.status-badge.active {
    background: #10b981;
    color: white;
}

.status-badge.expired {
    background: #ef4444;
    color: white;
}

.owner-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #5e81f4;
    color: white;
    margin-left: 0.5rem;
}

.insurance-item h4 {
    color: #1f2937;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.insurance-item p {
    color: #6b7280;
    font-size: 0.9rem;
    margin: 0.25rem 0;
}

.delete-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.delete-btn:hover {
    background: #c82333;
}

.empty-state {
    text-align: center;
    color: #9ca3af;
    padding: 2rem;
    font-size: 0.95rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    cursor: pointer;
    color: #9ca3af;
}

.close:hover {
    color: #1f2937;
}

.modal-content h2 {
    margin-bottom: 1.5rem;
    color: #1f2937;
    font-weight: 700;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #374151;
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    color: #1f2937;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #5e81f4;
}

.submit-btn {
    width: 100%;
    background: #5e81f4;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.submit-btn:hover {
    background: #4c6fd8;
}

.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.family-request-item {
    background: #f8f9fc;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid #5e81f4;
}

.family-request-item p {
    margin: 0.5rem 0;
    color: #6b7280;
}

.request-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.approve-btn {
    background: #10b981;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}

.approve-btn:hover {
    background: #059669;
}

.reject-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}

.reject-btn:hover {
    background: #dc2626;
}

#general-type-field {
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .insurance-cards {
        grid-template-columns: 1fr;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}
