:root {
    --primary-color: #006064;
    --secondary-color: #00bcd4;
    --accent-color: #c0392b;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #c0392b;
    --light-color: #e0f7fa;
    --dark-color: #006064;
    --food-color: #e67e22;
    --family-color: #8e44ad;
    --medicine-color: #5dade2;
    --fees-color: #3498db;
    --elders-color: #16a085;
    --insurance-color: #9b59b6;
    --servant-color: #e84393;
    --salary-color: #2ecc71;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    background: linear-gradient(135deg, #e0f7fa 0%, #b2ebf2 100%);
    min-height: 100vh;
    color: #006064;
    transition: all 0.3s ease;
    overflow-x: hidden;
}

body.fast-mode {
    background: linear-gradient(135deg, #e0f7fa 0%, #80deea 100%);
}

.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px;
}

.content-area {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 188, 212, 0.08);
    padding: 15px;
    margin-bottom: 15px;
}

.section-title {
    color: #006064;
    text-align: center;
    margin-bottom: 20px;
    font-weight: 700;
    font-size: 1.5rem;
}

.section-title:after {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    background: linear-gradient(to right, #00bcd4, #4dd0e1);
    margin: 10px auto;
    border-radius: 2px;
}

.separators {
    display: flex;
    justify-content: center;
    margin: 15px 0;
    flex-wrap: wrap;
}

.separator {
    height: 4px;
    width: 25px;
    margin: 0 4px;
    border-radius: 2px;
}

.separator-1 { background-color: #e67e22; }
.separator-2 { background-color: #8e44ad; }
.separator-3 { background-color: #5dade2; }
.separator-4 { background-color: #3498db; }
.separator-5 { background-color: #16a085; }
.separator-6 { background-color: #9b59b6; }
.separator-7 { background-color: #27ae60; }

.system-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 5px 15px rgba(0, 188, 212, 0.06);
    transition: all 0.3s ease;
    border-top: 4px solid #00bcd4;
    height: 100%;
    text-align: center;
}

.system-card.food { border-top-color: #e67e22; }
.system-card.food .system-icon { color: #e67e22; }
.system-card.family { border-top-color: #8e44ad; }
.system-card.family .system-icon { color: #8e44ad; }
.system-card.medicines { border-top-color: #5dade2; }
.system-card.medicines .system-icon { color: #5dade2; }
.system-card.fees { border-top-color: #3498db; }
.system-card.fees .system-icon { color: #3498db; }
.system-card.elders { border-top-color: #16a085; }
.system-card.elders .system-icon { color: #16a085; }
.system-card.servant { border-top-color: #e84393; }
.system-card.servant .system-icon { color: #e84393; }
.system-card.salary { border-top-color: #2ecc71; }
.system-card.salary .system-icon { color: #2ecc71; }

.system-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 188, 212, 0.1);
}

.system-icon {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #00bcd4;
}

.system-title {
    color: #006064;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.btn-system {
    background: linear-gradient(to right, #00bcd4, #4dd0e1);
    color: #ffffff;
    border: none;
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    font-size: 0.8rem;
}

.header-info {
    background: linear-gradient(135deg, #00bcd4, #4dd0e1);
    color: #ffffff;
    border-radius: 12px;
    padding: 12px 10px;
    margin-bottom: 15px;
    box-shadow: 0 5px 15px rgba(0, 188, 212, 0.1);
}

.stats-box {
    text-align: center;
    padding: 8px 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.stats-box:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.02);
}

.stats-number {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 3px;
}

.stats-label {
    font-size: 0.7rem;
    opacity: 0.9;
}

.controls {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 15px 0;
    padding: 12px;
    background: linear-gradient(135deg, #e0f7fa 0%, #b2ebf2 100%);
    border-radius: 12px;
}

.controls .btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid #b2ebf2;
    background-color: #ffffff;
    color: #006064;
    font-size: 0.75rem;
}

.controls .btn i {
    font-size: 0.8rem;
}

.controls .btn-primary {
    background: linear-gradient(to right, #00bcd4, #4dd0e1);
    color: #ffffff;
    border: none;
}

.controls .btn.warning-active {
    background: linear-gradient(to right, #f39c12, #e67e22);
    color: #ffffff;
    border: none;
}

.search-container {
    background: #ffffff;
    border-radius: 12px;
    padding: 15px;
    margin: 15px 0;
    box-shadow: 0 5px 15px rgba(0, 188, 212, 0.06);
    border-top: 4px solid #c0392b;
}

.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
}

.search-title {
    color: #006064;
    font-weight: 700;
    font-size: 1.1rem;
}

.search-stats {
    color: #00bcd4;
    font-weight: 500;
    font-size: 0.75rem;
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 10px 15px;
    border: 2px solid #e0f7fa;
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    font-size: 0.85rem;
}

.search-input:focus {
    border-color: #00bcd4;
    outline: none;
}

.search-btn {
    background: linear-gradient(to right, #00bcd4, #4dd0e1);
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
}

.search-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.filter-btn {
    padding: 6px 12px;
    border: 2px solid #e0f7fa;
    background-color: #ffffff;
    border-radius: 50px;
    font-weight: 500;
    transition: all 0.3s ease;
    color: #006064;
    font-size: 0.7rem;
}

.filter-btn:hover, .filter-btn.active {
    background: linear-gradient(to right, #00bcd4, #4dd0e1);
    color: #ffffff;
    border-color: #00bcd4;
}

.modal-custom {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 96, 100, 0.3);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1050;
}

.modal-custom.show {
    display: flex;
}

.modal-form {
    background: #ffffff;
    border-radius: 12px;
    width: 95%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 188, 212, 0.12);
}

.modal-header {
    background: linear-gradient(135deg, #00bcd4, #4dd0e1);
    color: #ffffff;
    padding: 12px 15px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.close-modal {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.2rem;
    cursor: pointer;
}

.modal-body {
    padding: 15px;
}

.modal-footer {
    padding: 12px 15px;
    border-top: 1px solid #e0f7fa;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.form-group {
    margin-bottom: 12px;
}

.form-label {
    font-weight: 600;
    color: #006064;
    margin-bottom: 5px;
    display: block;
    font-size: 0.8rem;
}

.form-control, .form-select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0f7fa;
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    font-size: 0.85rem;
}

.form-control:focus, .form-select:focus {
    border-color: #00bcd4;
    outline: none;
}

.form-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.form-col {
    flex: 1;
    min-width: 100%;
}

.services-group {
    border: 1px solid #e0f7fa;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
}

.service-item {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
    align-items: center;
}

.service-item input {
    flex: 1;
}

.btn-remove-service {
    background: #c0392b;
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 0.7rem;
}

.btn-add-service {
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.7rem;
    margin-top: 5px;
}

.weekly-meals-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
}

.weekly-meals-table th,
.weekly-meals-table td {
    padding: 10px 8px;
    text-align: center;
    border: 1px solid #e0f7fa;
    vertical-align: top;
}

.weekly-meals-table th {
    background: linear-gradient(135deg, #00bcd4, #4dd0e1);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.8rem;
}

.weekly-meals-table td {
    font-size: 0.75rem;
    background-color: #ffffff;
}

.meal-time {
    font-weight: 600;
    color: #006064;
    margin-bottom: 5px;
    font-size: 0.7rem;
}

.meal-content {
    color: #78909c;
    font-size: 0.7rem;
    word-break: break-word;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 550px;
}

.data-table th,
.data-table td {
    padding: 10px 8px;
    text-align: right;
    border-bottom: 1px solid #e0f7fa;
    font-size: 0.75rem;
}

.data-table th {
    background-color: #e0f7fa;
    font-weight: 600;
    color: #006064;
    position: sticky;
    top: 0;
    font-size: 0.7rem;
}

.filter-select {
    max-width: 250px;
    margin: 0 auto 15px auto;
    padding: 8px 12px;
    border-radius: 8px;
    border: 2px solid #e0f7fa;
    font-family: 'Cairo', sans-serif;
}

.badge-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 500;
}

.badge-paid { background-color: #27ae60; color: white; }
.badge-unpaid { background-color: #c0392b; color: white; }
.badge-low { background-color: #f39c12; color: white; }
.badge-pending { background-color: #e67e22; color: white; }
.badge-insured { background-color: #9b59b6; color: white; }
.badge-son { background-color: #5dade2; color: white; }
.badge-daughter { background-color: #e91e63; color: white; }
.badge-guardian { background-color: #8e44ad; color: white; }
.badge-servant { background-color: #e84393; color: white; }
.badge-active { background-color: #27ae60; color: white; }
.badge-ended { background-color: #c0392b; color: white; }

.btn-sm {
    padding: 4px 8px;
    font-size: 0.65rem;
}

.notification {
    position: fixed;
    top: 10px;
    left: 10px;
    right: 10px;
    max-width: 90%;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 188, 212, 0.15);
    padding: 10px;
    z-index: 1100;
    display: none;
    border-right: 4px solid #27ae60;
    font-size: 0.8rem;
}

.notification.show {
    display: block;
    animation: slideIn 0.3s ease;
}

.fast-mode-indicator {
    position: fixed;
    top: 5px;
    right: 5px;
    background: #f39c12;
    color: white;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: bold;
    z-index: 1001;
    display: none;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.section-container {
    display: none;
}

.section-container.active {
    display: block;
}

.btn-action {
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 500;
    border: none;
    transition: all 0.3s ease;
    font-size: 0.7rem;
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 188, 212, 0.1);
}

.alert-sound-indicator {
    position: fixed;
    bottom: 10px;
    right: 10px;
    background: #c0392b;
    color: white;
    padding: 8px 12px;
    border-radius: 50px;
    font-size: 0.7rem;
    z-index: 1000;
    display: none;
    animation: pulse 1s infinite;
}

.day-saturday { background-color: #e8f8f5; }
.day-sunday { background-color: #fef9e7; }
.day-monday { background-color: #fdedec; }
.day-tuesday { background-color: #ebf5fb; }
.day-wednesday { background-color: #f4ecf7; }
.day-thursday { background-color: #fef5e7; }
.day-friday { background-color: #eafaf1; }

@keyframes slideIn {
    from { transform: translateY(-100px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@media (max-width: 375px) {
    .main-container { padding: 8px; }
    .content-area { padding: 10px; }
    .section-title { font-size: 1.2rem; }
    .stats-number { font-size: 1rem; }
    .stats-label { font-size: 0.6rem; }
    .controls .btn { padding: 6px 10px; font-size: 0.7rem; }
    .weekly-meals-table th { font-size: 0.7rem; padding: 6px 4px; }
    .weekly-meals-table td { font-size: 0.65rem; padding: 6px 4px; }
    .meal-time { font-size: 0.6rem; }
    .meal-content { font-size: 0.6rem; }
}

@media (max-width: 320px) {
    .weekly-meals-table th { font-size: 0.6rem; }
    .weekly-meals-table td { font-size: 0.55rem; }
}