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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.screen {
    min-height: 100vh;
    padding: 20px;
}

.hidden {
    display: none !important;
}

/* Login Screen */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
}

.login-container h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #4285f4;
}

.login-container p {
    font-size: 1.1rem;
    margin-bottom: 40px;
    color: #666;
}

/* Main App */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 {
    color: #4285f4;
    font-size: 1.5rem;
}

.header-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

#logout-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

/* Quick Feed Button */
.quick-feed {
    text-align: center;
    margin-bottom: 30px;
}

.primary-btn {
    background: #4285f4;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: background-color 0.2s;
}

.primary-btn:hover {
    background: #3367d6;
}

.primary-btn.large {
    padding: 20px 40px;
    font-size: 1.3rem;
    width: 100%;
    max-width: 300px;
}

.secondary-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
}

.secondary-btn:hover {
    background: #5a6268;
}

/* Feed Form */
.feed-form {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.feed-form h2 {
    margin-bottom: 20px;
    color: #333;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: #4285f4;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.form-actions button {
    flex: 1;
}

/* Today's Summary */
.today-summary {
    margin-bottom: 30px;
}

.summary-card {
    background: linear-gradient(135deg, #4285f4, #34a853);
    color: white;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(66, 133, 244, 0.3);
}

.total-amount {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.feed-count {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 5px;
}

.day-period {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Feeds List */
.recent-feeds,
.historical-data {
    margin-bottom: 30px;
}

.recent-feeds h2,
.historical-data h2 {
    margin-bottom: 15px;
    color: #333;
}

.feeds-list {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.feed-item {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.feed-time {
    font-weight: 600;
    color: #4285f4;
}

.feed-amount {
    font-size: 1.1rem;
    font-weight: bold;
    color: #34a853;
}

.feed-item .delete-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

/* Historical Data */
.historical-list {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.historical-item {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.historical-item:hover {
    background-color: #f8f9fa;
}

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

.historical-date {
    font-weight: 600;
    color: #333;
}

.historical-total {
    color: #34a853;
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 768px) {
    .screen {
        padding: 15px;
    }
    
    header {
        padding: 12px 15px;
    }
    
    .total-amount {
        font-size: 2rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions button {
        width: 100%;
        margin-bottom: 10px;
    }
}

/* Settings Screen */
.household-info,
.invite-section,
.pending-invitations {
    margin-bottom: 30px;
}

.household-info h2,
.invite-section h2,
.pending-invitations h2 {
    margin-bottom: 15px;
    color: #333;
}

.members-list,
.invitations-list {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.member-item,
.invitation-item {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.member-item:last-child,
.invitation-item:last-child {
    border-bottom: none;
}

.member-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.member-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.member-name {
    font-weight: 600;
    color: #333;
}

.member-email {
    color: #666;
    font-size: 0.9rem;
}

.member-role {
    color: #4285f4;
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 600;
}

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

.invite-form {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    gap: 15px;
    align-items: center;
}

.invite-input {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

.invite-input:focus {
    outline: none;
    border-color: #4285f4;
}

.invitation-email {
    font-weight: 600;
    color: #333;
}

.invitation-date {
    color: #666;
    font-size: 0.9rem;
}

.feed-user {
    color: #666;
    font-size: 0.8rem;
}

/* Nurse Contacts */
.nurse-contacts,
.sms-logs {
    margin-bottom: 30px;
}

.nurse-contacts h2,
.sms-logs h2 {
    margin-bottom: 15px;
    color: #333;
}

.nurse-description {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.nurse-form {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.nurse-form h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.1rem;
}

.form-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.nurse-input {
    flex: 1;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
}

.nurse-input:focus {
    outline: none;
    border-color: #4285f4;
}

.nurse-contacts-list,
.sms-logs-list {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.nurse-contact-item,
.sms-log-item {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nurse-contact-item:last-child,
.sms-log-item:last-child {
    border-bottom: none;
}

.nurse-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nurse-name {
    font-weight: 600;
    color: #333;
}

.nurse-email {
    color: #666;
    font-size: 0.9rem;
}

.nurse-status {
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    font-weight: 600;
}

.nurse-status.active {
    background: #d4edda;
    color: #155724;
}

.nurse-status.inactive {
    background: #f8d7da;
    color: #721c24;
}

.nurse-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.test-btn {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

.toggle-btn {
    background: #ffc107;
    color: #212529;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

.sms-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sms-nurse {
    font-weight: 600;
    color: #333;
}

.sms-time {
    color: #666;
    font-size: 0.8rem;
}

.sms-message {
    color: #555;
    font-size: 0.9rem;
    margin-top: 5px;
    font-style: italic;
}

.sms-status {
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    font-weight: 600;
}

.sms-status.sent {
    background: #d4edda;
    color: #155724;
}

.sms-status.delivered {
    background: #cce5ff;
    color: #004085;
}

.sms-status.failed {
    background: #f8d7da;
    color: #721c24;
}

.sms-status.pending {
    background: #fff3cd;
    color: #856404;
}

/* PWA Styles */
@media (display-mode: standalone) {
    body {
        user-select: none;
        -webkit-user-select: none;
    }
}