* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
}

html, body {
    height: 100%;
}

body {
    background: linear-gradient(145deg, #f0f7ff 0%, #e8f0fe 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

body.login-mode {
    height: 100vh;
    overflow: hidden;
    padding: 12px;
}

body.logged-in::before,
body.logged-in::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.12;
}

body.logged-in::before {
    width: 120px;
    height: 120px;
    background: #fbbf24;
    top: 30px;
    left: 30px;
    animation: float 3s ease-in-out infinite;
}

body.logged-in::after {
    width: 90px;
    height: 90px;
    background: #1e3a5f;
    bottom: 30px;
    right: 30px;
    animation: float 4s ease-in-out infinite reverse;
}

@keyframes float {
    0%,
    100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

body.logged-in {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
    height: 100vh;
    overflow: hidden;
}

body.logged-in::before,
body.logged-in::after {
    display: none;
}

body.logged-in .app-container {
    max-width: none;
    height: 100vh;
    border-radius: 0;
    box-shadow: none;
}

body.logged-in .main-content {
    border-radius: 0;
    max-height: none;
    height: 100%;
}

.app-container {
    display: flex;
    width: 100%;
    max-width: 1500px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    border-radius: 70px;
    box-shadow: 0 35px 65px -15px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

body.login-mode .app-container {
    max-width: 1100px;
    height: calc(100vh - 24px);
    border-radius: 32px;
}

body.login-mode .sidebar {
    display: none;
}

body.login-mode .main-content {
    border-radius: 32px;
    max-height: none;
    height: 100%;
    overflow: hidden;
}

.sidebar {
    width: 260px;
    min-width: 260px;
    height: 100%;
    background: #0c1929;
    padding: 0;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar::after {
    content: "";
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 180px;
    background: linear-gradient(0deg, rgba(249, 115, 22, 0.06) 0%, transparent 100%);
    pointer-events: none;
}

.sidebar-brand {
    text-align: center;
    padding: 1.15rem 1rem 0.85rem;
    border-bottom: none;
    position: relative;
    z-index: 1;
}

.sidebar-brand-heart {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0;
    margin-bottom: 6px;
    color: #fb7185;
    font-size: 1.65rem;
    line-height: 1;
    animation: sidebarHeartFloat 2.2s ease-in-out infinite;
    filter: drop-shadow(0 0 12px rgba(251, 113, 133, 0.5));
}

.sidebar-brand-heart i {
    display: block;
}

@keyframes sidebarHeartFloat {
    0%, 100% {
        transform: translateY(0);
        opacity: 0.92;
    }
    50% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

.sidebar-brand h2 {
    color: #fff;
    font-family: 'Katibeh', 'Changa', serif;
    font-size: 2rem;
    font-weight: 400;
    margin-top: 0;
    line-height: 1.15;
}

.logo-tagline {
    display: block;
    font-family: 'Changa', 'Cairo', sans-serif;
    color: rgba(255, 255, 255, 0.48);
    font-size: 0.74rem;
    font-weight: 500;
    margin-top: 2px;
}

.sidebar-search-wrap {
    padding: 0 0.75rem 0.65rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    z-index: 1;
}

.sidebar-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0 10px;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.sidebar-search-box:focus-within {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(249, 115, 22, 0.45);
}

.sidebar-search-icon {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.78rem;
    flex-shrink: 0;
}

.sidebar-search-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: #fff;
    font-family: 'Changa', 'Cairo', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    padding: 9px 0;
    outline: none;
}

.sidebar-search-input::placeholder {
    color: rgba(255, 255, 255, 0.38);
}

.sidebar-search-empty {
    margin: 6px 0 0;
    padding: 0 4px;
    font-family: 'Changa', 'Cairo', sans-serif;
    font-size: 0.72rem;
    color: rgba(251, 191, 36, 0.85);
    text-align: center;
}

/* ========== القائمة الجانبية ========== */
.sidebar-nav {
    flex: 1;
    min-height: 0;
    padding: 0.55rem 0.65rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: relative;
    z-index: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-nav-spacer {
    display: none;
}

.nav-item.nav-item-filtered {
    display: none !important;
}

.nav-section-title {
    font-family: 'Changa', 'Cairo', sans-serif;
    font-size: 0.68rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.04em;
    padding: 0.35rem 1rem 0.3rem;
    margin: 0;
}

.sidebar-footer {
    display: none;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.85rem 1rem;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border-radius: 0;
    cursor: pointer;
    text-align: right;
    font-family: 'Changa', 'Cairo', sans-serif;
    transition: background 0.2s ease, color 0.2s ease;
    position: relative;
}

.nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.nav-item:hover .icon-rect.nav:not(.danger) {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.nav-item.active {
    background: rgba(249, 115, 22, 0.15);
    color: #fff;
}

.nav-item.active:hover {
    background: rgba(249, 115, 22, 0.22);
}

.nav-item.active::before {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: linear-gradient(180deg, #fbbf24, #f97316);
    border-radius: 3px 0 0 3px;
}

.nav-label {
    font-family: 'Changa', 'Cairo', sans-serif;
    font-size: 0.98rem;
    font-weight: 600;
    letter-spacing: 0.015em;
    line-height: 1.35;
}

.nav-item.active .nav-label {
    font-weight: 700;
    color: #fff;
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.nav-logout {
    color: rgba(255, 255, 255, 0.65);
    margin-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 0.75rem;
}

.nav-logout:hover {
    background: rgba(239, 68, 68, 0.14);
    color: #fff;
}

.nav-logout:hover .icon-rect.nav.danger {
    background: linear-gradient(145deg, #dc2626, #ef4444);
    color: #fff;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

body.child-role .nav-parent-only {
    display: none;
}

/* ========== أيقونات مستطيلة ========== */
.icon-rect {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    background: linear-gradient(145deg, #1e3a5f, #2d4a6f);
    color: #fbbf24;
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.25);
}

.icon-rect.light {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    box-shadow: none;
}

.icon-rect.nav {
    width: 36px;
    height: 36px;
    min-width: 36px;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.55);
    box-shadow: none;
    border-radius: 8px;
}

.icon-rect.nav.danger {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.nav-item.active .icon-rect.nav {
    background: linear-gradient(145deg, #f59e0b, #f97316);
    color: #fff;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.35);
}

/* ========== محدد التاريخ ========== */
.date-picker-box {
    position: relative;
}

.date-picker-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 4px 4px 4px 14px;
    background: #fffdf9;
    color: #1e3a5f;
    border: 2px solid #f0e0cc;
    border-radius: 12px;
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 48px;
}

.date-picker-btn .icon-rect {
    width: 40px;
    height: 40px;
}

.date-picker-btn:hover {
    border-color: #f97316;
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.1);
}

.date-picker-text {
    flex: 1;
    text-align: right;
}

.date-input-hidden {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* ========== متابعة الأولاد ========== */
.follow-up-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.follow-up-card {
    background: white;
    border-radius: 20px;
    padding: 1.25rem;
    border: 1px solid #f0e6d8;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.follow-up-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(30, 58, 95, 0.1);
}

.follow-up-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1rem;
}

.follow-up-emoji {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.follow-up-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: #1e3a5f;
}

.follow-up-type {
    font-size: 0.75rem;
    color: #9a7b5a;
}

.follow-up-progress {
    margin-bottom: 8px;
}

.follow-up-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 4px;
}

.follow-up-bar {
    height: 8px;
    background: #f1f5f9;
    border-radius: 10px;
    overflow: hidden;
}

.follow-up-bar-fill {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, #22c55e, #4ade80);
    transition: width 0.4s ease;
}

.follow-up-total {
    text-align: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0e6d8;
    font-size: 0.85rem;
    color: #b45309;
    font-weight: 700;
}

.follow-up-done-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 10px 0 4px;
    padding: 8px 12px;
    border-radius: 12px;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border: 1px solid #86efac;
    color: #047857;
    font-size: 0.82rem;
    font-weight: 800;
}

.follow-up-done-badge.follow-up-done-weekly {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-color: #93c5fd;
    color: #1d4ed8;
}

.follow-up-done-badge.follow-up-done-monthly {
    background: linear-gradient(135deg, #f5f3ff, #ede9fe);
    border-color: #c4b5fd;
    color: #6d28d9;
}

/* ========== لوحات المحتوى ========== */
.dashboard-panel {
    display: none;
    animation: panelFadeIn 0.35s ease;
}

.dashboard-panel.active {
    display: block;
}

@keyframes panelFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.panel-header {
    margin-bottom: 1.5rem;
}

.panel-header h2 {
    font-size: 1.6rem;
    color: #1e3a5f;
    font-weight: 800;
    margin-bottom: 6px;
}

.panel-header h2 i {
    color: #f97316;
    margin-left: 8px;
}

.panel-header p {
    color: #9a7b5a;
    font-size: 0.9rem;
}

.panel-card {
    background: white;
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: 0 8px 30px rgba(30, 58, 95, 0.08);
    border: 1px solid #f0e6d8;
}

.sub-panel-title {
    font-size: 1.1rem;
    color: #1e3a5f;
    margin-bottom: 1rem;
    font-weight: 700;
}

.sub-panel-title i {
    color: #f97316;
    margin-left: 8px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #b45309;
}

.form-group label i {
    margin-left: 6px;
    color: #f97316;
}

/* ========== نموذج إضافة الابن — قائمة أيقونة منسدلة ========== */
.child-name-icon-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.child-name-icon-row .panel-input {
    flex: 1;
    min-width: 0;
}

.child-icon-dropdown {
    position: relative;
    flex-shrink: 0;
}

.child-icon-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 44px;
    min-width: 44px;
    padding: 0 6px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: linear-gradient(160deg, #fff 0%, #f8fafc 100%);
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 1px 4px rgba(30, 58, 95, 0.05);
}

.child-icon-dropdown-trigger:hover {
    border-color: #f97316;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.12);
}

.child-icon-dropdown-trigger[aria-expanded="true"] {
    border-color: #f97316;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.16);
}

.child-icon-dropdown-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    color: #94a3b8;
    font-size: 0.5rem;
    transition: transform 0.2s ease, color 0.2s ease;
}

.child-icon-dropdown-trigger:hover .child-icon-dropdown-chevron,
.child-icon-dropdown-trigger[aria-expanded="true"] .child-icon-dropdown-chevron {
    color: #f97316;
}

.child-icon-dropdown-trigger[aria-expanded="true"] .child-icon-dropdown-chevron {
    transform: rotate(180deg);
}

.child-icon-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.child-icon-preview .child-icon-badge {
    box-shadow: none;
}

.child-icon-dropdown-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: auto;
    z-index: 1200;
    width: min(340px, calc(100vw - 48px));
    max-height: min(320px, 52vh);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px;
    background: #fff;
    border: 1.5px solid #e8edf2;
    border-radius: 18px;
    box-shadow: 0 16px 40px rgba(30, 58, 95, 0.16), 0 4px 12px rgba(30, 58, 95, 0.08);
    scrollbar-width: thin;
    scrollbar-color: #f97316 #f1f5f9;
}

.child-icon-dropdown-panel::-webkit-scrollbar {
    width: 6px;
}

.child-icon-dropdown-panel::-webkit-scrollbar-thumb {
    background: #f97316;
    border-radius: 999px;
}

.child-edit-dialog .child-icon-dropdown-panel {
    z-index: 12050;
}

.child-icon-dropdown-section + .child-icon-dropdown-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #e8edf2;
}

.child-icon-dropdown-section-title {
    margin: 0 0 8px;
    font-size: 0.72rem;
    font-weight: 800;
    color: #94a3b8;
    letter-spacing: 0.02em;
}

.child-icon-dropdown-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
}

.child-icon-emoji-option {
    width: 100%;
    aspect-ratio: 1;
    min-height: 42px;
    border: 2px solid #eef2f7;
    border-radius: 12px;
    background: linear-gradient(160deg, #fff 0%, #f8fafc 100%);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
    padding: 0;
}

.child-icon-emoji-option:hover {
    transform: scale(1.08);
    border-color: #fed7aa;
    background: #fff8ed;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.12);
}

.child-icon-emoji-option.selected {
    border-color: #f97316;
    background: #fff7ed;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
    transform: scale(1.04);
}

/* شارات الأيقونة — عرض موحّد في كل الواجهة */
.child-icon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(30, 58, 95, 0.1);
}

.child-icon-badge i {
    line-height: 1;
}

.child-icon-badge.child-icon-emoji {
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
    line-height: 1;
}

.child-icon-badge--xs {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    font-size: 0.95rem;
}

.child-icon-badge--sm {
    width: 36px;
    height: 36px;
    border-radius: 11px;
}

.child-icon-badge--sm i { font-size: 0.95rem; }

.child-icon-badge--md {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 1.35rem;
}

.child-icon-badge--md i { font-size: 1.15rem; }

.child-icon-badge--lg {
    width: 52px;
    height: 52px;
    border-radius: 15px;
    font-size: 1.55rem;
}

.child-icon-badge--lg i { font-size: 1.25rem; }

.child-icon-badge--xl {
    width: 72px;
    height: 72px;
    border-radius: 22px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.child-icon-badge--xl i { font-size: 1.75rem; }

/* ثيمات ألوان الشارات */
.child-icon-theme--gold.child-icon-badge {
    background: linear-gradient(145deg, #fef3c7, #fde68a);
}

.child-icon-theme--teal.child-icon-badge {
    background: linear-gradient(145deg, #ccfbf1, #99f6e4);
}

.child-icon-theme--amber.child-icon-badge {
    background: linear-gradient(145deg, #fef08a, #fcd34d);
}

.child-icon-theme--indigo.child-icon-badge {
    background: linear-gradient(145deg, #e0e7ff, #c7d2fe);
}

.child-icon-theme--blue.child-icon-badge {
    background: linear-gradient(145deg, #dbeafe, #bfdbfe);
}

.child-icon-theme--green.child-icon-badge {
    background: linear-gradient(145deg, #d1fae5, #a7f3d0);
}

.child-icon-theme--sage.child-icon-badge {
    background: linear-gradient(145deg, #ecfdf5, #d1fae5);
}

.child-icon-theme--orange.child-icon-badge {
    background: linear-gradient(145deg, #ffedd5, #fed7aa);
}

.child-icon-theme--purple.child-icon-badge {
    background: linear-gradient(145deg, #ede9fe, #ddd6fe);
}

.child-icon-theme--bronze.child-icon-badge {
    background: linear-gradient(145deg, #fde68a, #fbbf24);
}

.child-icon-theme--pink.child-icon-badge {
    background: linear-gradient(145deg, #fce7f3, #fbcfe8);
}

.child-icon-theme--field.child-icon-badge {
    background: linear-gradient(145deg, #dcfce7, #bbf7d0);
}

.child-icon-theme--coral.child-icon-badge {
    background: linear-gradient(145deg, #ffe4e6, #fecdd3);
}

.child-icon-theme--violet.child-icon-badge {
    background: linear-gradient(145deg, #ede9fe, #e9d5ff);
}

.child-icon-theme--rose.child-icon-badge {
    background: linear-gradient(145deg, #ffe4e6, #fda4af);
}

.child-icon-theme--sky.child-icon-badge {
    background: linear-gradient(145deg, #e0f2fe, #bae6fd);
}

.child-icon-theme--navy.child-icon-badge {
    background: linear-gradient(145deg, #dbeafe, #93c5fd);
}

.child-icon-badge--lg.child-icon-emoji {
    font-size: 1.55rem;
}

.child-icon-badge--xl.child-icon-emoji {
    font-size: 2rem;
}

@media (max-width: 480px) {
    .child-icon-dropdown-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .child-icon-dropdown-panel {
        width: min(300px, calc(100vw - 32px));
    }
}

.child-age-display {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border: 1.5px solid #bfdbfe;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 800;
    color: #1e3a5f;
    text-align: center;
}

.registered-children-card {
    margin-top: 1.5rem;
}

.registered-children-wrap {
    margin-top: 0.5rem;
}

.registered-children-table-wrap {
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid #e8edf2;
}

.registered-children-table th.col-name,
.registered-children-table td.col-name {
    text-align: right;
}

.registered-children-table .col-icon,
.registered-children-table .col-num,
.registered-children-table .col-age,
.registered-children-table .col-action {
    text-align: center;
}

.reg-child-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.reg-child-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1.5px solid #bfdbfe;
    border-radius: 8px;
    background: #eff6ff;
    color: #1e3a5f;
    font-family: 'Cairo', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.reg-child-edit-btn:hover {
    background: #1e3a5f;
    color: #fff;
    border-color: #1e3a5f;
}

.child-edit-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.child-edit-overlay[hidden] {
    display: none !important;
}

.child-edit-dialog {
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 20px;
    padding: 1.25rem 1.5rem 1.5rem;
    box-shadow: 0 20px 50px rgba(30, 58, 95, 0.25);
    border: 1px solid #e8edf2;
}

.child-edit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.child-edit-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #1e3a5f;
    font-weight: 800;
}

.child-edit-header h3 i {
    color: #f97316;
    margin-left: 8px;
}

.child-edit-close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.child-edit-close:hover {
    background: #fee2e2;
    color: #dc2626;
}

.child-edit-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

.view-btn-outline {
    background: #fff !important;
    color: #1e3a5f !important;
    border: 2px solid #e2e8f0 !important;
    box-shadow: none !important;
}

.view-btn-outline:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
}

/* ========== التحكم في المهام ========== */
.task-mgmt-filters {
    margin-bottom: 1rem;
}

.task-mgmt-list-card {
    margin-bottom: 1rem;
}

.task-mgmt-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 0.5rem;
}

.task-mgmt-toolbar .sub-panel-title {
    margin-bottom: 0;
}

.task-mgmt-count {
    font-size: 0.82rem;
    font-weight: 800;
    color: #1e3a5f;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    padding: 6px 14px;
    border-radius: 20px;
}

.task-mgmt-hint {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0 0 1rem;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 10px;
    border-right: 3px solid #f97316;
}

.task-mgmt-hint i {
    color: #f97316;
    margin-left: 6px;
}

.task-mgmt-child-dropdown {
    width: 100%;
}

.task-mgmt-child-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 1.25rem;
}

.task-mgmt-child-group:last-child {
    margin-bottom: 0;
}

.task-mgmt-child-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #1e3a5f, #2d5a8e);
    border-radius: 10px;
    color: #fff;
}

.task-mgmt-child-name {
    font-size: 0.88rem;
    font-weight: 800;
}

.task-mgmt-child-name i {
    color: #fbbf24;
    margin-left: 6px;
}

.task-mgmt-child-count {
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.18);
    padding: 3px 10px;
    border-radius: 20px;
}

.task-mgmt-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 420px;
    overflow-y: auto;
    padding-left: 4px;
}

.task-mgmt-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #faf8f4;
    border: 1px solid #f0e6d8;
    border-radius: 14px;
    transition: background 0.15s, border-color 0.15s;
}

.task-mgmt-item:hover {
    background: #fff8ed;
    border-color: #fed7aa;
}

.task-mgmt-item.is-inactive {
    opacity: 0.72;
    background: #f1f5f9;
}

.task-mgmt-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 10px;
    background: linear-gradient(145deg, #1e3a5f, #2d5a8e);
    color: #fde68a;
    font-size: 0.8rem;
    font-weight: 800;
}

.task-mgmt-body {
    flex: 1;
    min-width: 0;
}

.task-mgmt-text {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: #1e3a5f;
    line-height: 1.5;
    word-break: break-word;
}

.task-mgmt-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.task-mgmt-tag {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 20px;
}

.task-mgmt-tag.tag-custom {
    background: #fef3c7;
    color: #92400e;
}

.task-mgmt-tag.tag-duaa {
    background: #fce7f3;
    color: #9d174d;
}

.task-mgmt-tag.tag-task {
    background: #e0f2fe;
    color: #0369a1;
}

.task-mgmt-tag.tag-inactive {
    background: #f1f5f9;
    color: #64748b;
}

.task-mgmt-delete {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    border-radius: 10px;
    background: #fff;
    color: #dc2626;
    font-family: 'Cairo', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    border: 1.5px solid #fecaca;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

.task-mgmt-delete:hover {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}

.task-mgmt-delete i {
    font-size: 0.85rem;
}

.task-mgmt-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: #64748b;
}

.task-mgmt-empty i {
    font-size: 2.2rem;
    color: #cbd5e1;
    margin-bottom: 10px;
    display: block;
}

.task-mgmt-empty p {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
}

.task-mgmt-add-card .sub-panel-title {
    margin-bottom: 0;
}

.panel-input,
.textarea-field {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #f0e0cc;
    border-radius: 14px;
    font-size: 0.95rem;
    background: #fffdf9;
    font-family: 'Cairo', sans-serif;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.textarea-field {
    resize: vertical;
    min-height: 80px;
}

.panel-input:focus,
.textarea-field:focus {
    border-color: #f97316;
    outline: none;
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.1);
}

.form-msg {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.85rem;
    display: none;
}

.form-msg.success {
    display: block;
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.form-msg.error {
    display: block;
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.control-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: white;
    border-radius: 20px;
    padding: 1.25rem;
    text-align: center;
    border: 1px solid #f0e6d8;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 10px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: #1e3a5f;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: #9a7b5a;
    margin-top: 4px;
}

.stat-card.orange .stat-icon { background: #fff7ed; color: #f97316; }
.stat-card.green .stat-icon { background: #f0fdf4; color: #16a34a; }
.stat-card.blue .stat-icon { background: #eff6ff; color: #2563eb; }
.stat-card.purple .stat-icon { background: #faf5ff; color: #9333ea; }

.account-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 14px;
    margin-bottom: 8px;
    border: 1px solid #e8edf2;
}

.account-row strong {
    color: #1e3a5f;
}

.account-row span {
    font-size: 0.85rem;
    color: #64748b;
}

/* ========== مركز التحكم ========== */
.control-parent-card,
.control-accounts-card,
.control-platform-card {
    margin-bottom: 1.5rem;
}

.control-section-desc {
    font-size: 0.88rem;
    color: #64748b;
    margin: -0.25rem 0 1rem;
}

.control-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.control-bulk-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.control-bulk-btn {
    border: none;
    border-radius: 12px;
    padding: 8px 14px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: transform 0.15s, box-shadow 0.15s;
}

.control-bulk-btn:hover {
    transform: translateY(-1px);
}

.control-bulk-enable {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.control-bulk-disable {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.control-accounts-table-wrap {
    overflow-x: auto;
    border-radius: 16px;
    border: 1px solid #e8edf2;
}

.control-accounts-table .col-icon {
    text-align: center;
}

.control-accounts-table .reg-child-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.account-meta {
    color: #94a3b8;
    font-size: 0.78rem;
}

.account-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.account-status-badge.status-active {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.account-status-badge.status-inactive {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.account-row-disabled {
    opacity: 0.65;
    background: #fafafa !important;
}

.account-toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    cursor: pointer;
}

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

.account-toggle-slider {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 999px;
    transition: background 0.2s;
}

.account-toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.account-toggle input:checked + .account-toggle-slider {
    background: #10b981;
}

.account-toggle input:checked + .account-toggle-slider::before {
    transform: translateX(22px);
}

.account-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.child-account-delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #dc2626;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.child-account-delete-btn:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
}

.control-platform-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.control-action-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    cursor: pointer;
    text-align: right;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.control-action-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    transform: translateY(-2px);
}

.control-action-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.control-action-icon.green { background: #ecfdf5; color: #059669; }
.control-action-icon.blue { background: #eff6ff; color: #2563eb; }
.control-action-icon.purple { background: #faf5ff; color: #9333ea; }

.control-action-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.control-action-text strong {
    color: #1e3a5f;
    font-size: 0.95rem;
}

.control-action-text small {
    color: #64748b;
    font-size: 0.78rem;
}

.children-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.child-chip {
    background: linear-gradient(135deg, #f8fafc, #fff9f0);
    border: 1px solid #f0e6d8;
    border-radius: 16px;
    padding: 14px;
    text-align: center;
}

.child-chip .emoji {
    font-size: 2rem;
    margin-bottom: 6px;
}

.child-chip .name {
    font-weight: 700;
    color: #1e3a5f;
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.main-content {
    flex: 1;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 0 70px 70px 0;
    overflow-y: auto;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

/* ========== الشريط العلوي الثابت — بسيط ومضغوط ========== */
.top-status-bar {
    display: none;
    position: sticky;
    top: 0;
    z-index: 300;
    flex-shrink: 0;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    padding: 8px 12px;
}

body.logged-in .top-status-bar {
    display: block;
}

.top-status-bar-frame {
    background: #fff;
    border: 1px solid #e8edf2;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(30, 58, 95, 0.05);
    padding: 6px;
}

.top-status-bar-inner {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 6px;
}

.top-status-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    flex: 1 1 0;
    min-width: 112px;
    background: #fafbfc;
    border: 1px solid #eef2f6;
    border-radius: 10px;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.top-status-chip:hover {
    border-color: #e2e8f0;
    background: #fff;
}

.top-status-chip.chip-clock {
    flex: 0 0 auto;
    min-width: 0;
    width: auto;
    justify-content: center;
    padding: 6px 8px;
}

.top-status-clock-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: 100%;
}

.top-status-clock-stack .top-status-label {
    width: 100%;
    text-align: center;
}

.top-status-clock-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 108px;
    width: auto;
    height: 30px;
    padding: 0 10px;
    border-radius: 8px;
    background: #7c3aed;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    font-family: 'Cairo', sans-serif;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    direction: ltr;
    unicode-bidi: isolate;
    white-space: nowrap;
    line-height: 1;
    flex-shrink: 0;
    letter-spacing: 0.01em;
    text-align: center;
}

.top-status-clock-box::before {
    display: none;
}

.top-status-chip.chip-calendar {
    flex: 1 1 140px;
    min-width: 0;
    max-width: none;
    position: relative;
}

.top-calendar-btn .top-status-icon.icon-calendar {
    width: 28px;
    height: 28px;
    min-width: 28px;
    font-size: 0.7rem;
}

.top-status-clickable {
    padding: 0;
    overflow: visible;
}

.top-calendar-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 100%;
    padding: 6px 10px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    text-align: right;
    border-radius: 12px;
    transition: background 0.2s ease;
}

.top-calendar-btn:hover {
    background: rgba(59, 130, 246, 0.05);
}

.top-status-calendar-full {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.72rem;
    text-align: center;
}

.top-calendar-btn .top-status-text {
    min-width: 0;
    flex: 1;
    text-align: center;
}

.top-calendar-popup {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    width: 290px;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 14px 36px rgba(30, 58, 95, 0.18);
    z-index: 500;
    padding: 12px;
}

.top-calendar-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: 800;
    color: #1e3a5f;
    font-size: 0.9rem;
}

.top-cal-nav {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: #f1f5f9;
    color: #1e3a5f;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.top-cal-nav:hover {
    background: #e2e8f0;
}

.top-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 6px;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: #94a3b8;
}

.top-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.top-cal-day {
    aspect-ratio: 1;
    border: none;
    border-radius: 8px;
    background: #f8fafc;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: default;
    font-family: 'Cairo', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1;
}

.top-cal-day.is-today {
    background: linear-gradient(145deg, #1e3a5f, #3b82f6);
    color: #fff;
    box-shadow: 0 3px 10px rgba(30, 58, 95, 0.25);
}

.top-cal-day.is-empty {
    background: transparent;
}

.top-bell-plain {
    font-size: 0.72rem;
    color: #d97706;
    flex-shrink: 0;
    line-height: 1;
    transition: color 0.15s ease;
}

.top-notify-btn:hover .top-bell-plain {
    color: #ea580c;
    animation: bellRing 0.45s ease;
}

@keyframes bellRing {
    0%, 100% { transform: rotate(0); }
    20% { transform: rotate(12deg); }
    40% { transform: rotate(-10deg); }
    60% { transform: rotate(6deg); }
    80% { transform: rotate(-4deg); }
}

.top-status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 8px;
    font-size: 0.72rem;
    flex-shrink: 0;
    border: none;
    box-shadow: none;
}

.top-status-icon::before,
.top-status-icon::after {
    display: none;
}

.top-status-icon i {
    line-height: 1;
}

.top-status-icon.icon-day {
    background: #fff7ed;
    color: #ea580c;
}

.top-status-icon.icon-month {
    background: #f0fdfa;
    color: #0f766e;
}

.top-status-icon.icon-date {
    background: #ecfdf5;
    color: #059669;
}

.top-status-icon.icon-calendar {
    background: #eff6ff;
    color: #2563eb;
}

.top-status-icon.icon-clock {
    background: #f5f3ff;
    color: #7c3aed;
}

.top-status-icon.icon-notify {
    background: #fffbeb;
    color: #d97706;
}

.top-status-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.top-status-label {
    font-size: 0.62rem;
    font-weight: 700;
    color: #94a3b8;
    white-space: nowrap;
}

.top-status-value {
    font-size: 0.8rem;
    font-weight: 800;
    color: #1e3a5f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    line-height: 1.2;
}

.top-status-chip:not(.chip-calendar) .top-status-text {
    text-align: center;
    flex: 1;
}


.top-status-notify-wrap {
    position: relative;
    flex: 0 1 112px;
    min-width: 104px;
    padding: 6px 8px;
}

.top-notify-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 100%;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    text-align: right;
    transition: background 0.2s ease;
    border-radius: 10px;
}

.top-notify-btn:hover,
.top-notify-btn[aria-expanded="true"] {
    background: rgba(249, 115, 22, 0.05);
}

.top-notify-bell-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 28px;
    min-width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #fffbeb;
}

.top-notify-bell-wrap::before {
    display: none;
}

.top-notify-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    border-radius: 20px;
    background: #dc2626;
    color: #fff;
    font-size: 0.55rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 1.5px solid #fff;
    z-index: 2;
}

.top-notify-panel {
    flex-shrink: 0;
    background: #fff;
    border-bottom: 2px solid #e2e8f0;
    box-shadow: inset 0 4px 12px rgba(30, 58, 95, 0.04);
    animation: notifyPanelIn 0.25s ease;
}

@keyframes notifyPanelIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.top-notify-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, #1e3a5f, #2d5a8e);
    color: #fff;
}

.top-notify-panel-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    font-weight: 700;
}

.top-notify-panel-title i {
    color: #fbbf24;
}

.top-notify-panel-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.top-notify-panel-close:hover {
    background: rgba(255, 255, 255, 0.28);
}

.top-notify-panel .top-notify-list {
    max-height: 280px;
    overflow-y: auto;
    padding: 6px 0;
}

.top-notify-dropdown {
    display: none;
}

.top-notify-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.82rem;
    color: #334155;
    line-height: 1.45;
    transition: background 0.15s ease;
}

.top-notify-item.is-unread {
    background: #fffbeb;
}

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

.top-notify-item-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    margin-top: 2px;
}

.top-notify-item-icon.notify-icon-done {
    background: #ecfdf5;
    color: #059669;
}

.top-notify-item-icon.notify-icon-note {
    background: #eff6ff;
    color: #2563eb;
}

.top-notify-item-body {
    flex: 1;
    min-width: 0;
}

.top-notify-item-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.top-notify-item-head strong {
    color: #1e3a5f;
    font-weight: 800;
    font-size: 0.84rem;
    line-height: 1.35;
}

.top-notify-item-time {
    font-size: 0.65rem;
    color: #94a3b8;
    white-space: nowrap;
    flex-shrink: 0;
}

.top-notify-item-tag {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 700;
    color: #b45309;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 999px;
    padding: 2px 8px;
    margin-bottom: 4px;
}

.top-notify-task {
    margin: 0 0 4px;
    color: #475569;
    font-size: 0.78rem;
    line-height: 1.4;
}

.top-notify-note {
    margin: 0;
    color: #1e3a5f;
    font-size: 0.78rem;
    font-style: italic;
    line-height: 1.45;
    background: #f8fafc;
    border-right: 3px solid #3b82f6;
    padding: 6px 8px;
    border-radius: 0 8px 8px 0;
}

.top-notify-reply-wrap {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.top-notify-reply-wrap.is-sent {
    margin-top: 8px;
}

.top-notify-reply-input {
    width: 100%;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    padding: 8px 10px;
    font-family: inherit;
    font-size: 0.78rem;
    resize: vertical;
    min-height: 52px;
    background: #fff;
    color: #1e293b;
}

.top-notify-reply-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.top-notify-reply-btn {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    font-size: 0.76rem;
    font-weight: 700;
    padding: 7px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
}

.top-notify-reply-btn:hover {
    filter: brightness(1.05);
}

.top-notify-parent-reply {
    margin: 0;
    padding: 8px 10px;
    background: #eff6ff;
    border-radius: 10px;
    border-right: 3px solid #3b82f6;
    color: #1e40af;
    font-size: 0.78rem;
}

.top-notify-parent-reply i {
    margin-left: 4px;
}

.top-notify-item-icon.notify-icon-reply {
    background: #eff6ff;
    color: #2563eb;
}

button.top-notify-item.top-notify-item-child {
    width: 100%;
    border: none;
    background: transparent;
    text-align: right;
    cursor: pointer;
    font-family: inherit;
}

button.top-notify-item.top-notify-item-child:hover {
    background: #f8fafc;
}

.parent-reply-bubble {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #dbeafe;
}

.parent-reply-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #1d4ed8;
    margin-bottom: 4px;
}

.parent-reply-header small {
    margin-right: auto;
    color: #94a3b8;
    font-weight: 500;
}

.parent-reply-text {
    margin: 0;
    font-size: 0.8rem;
    color: #1e3a8a;
    line-height: 1.5;
}

.child-note-btn.has-parent-reply {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.child-parent-reply-preview {
    margin: 6px 0 0;
    font-size: 0.65rem;
    color: #2563eb;
    line-height: 1.4;
}

.child-parent-reply-preview.is-unread {
    font-weight: 700;
}

.child-parent-reply-box {
    margin-bottom: 12px;
    padding: 12px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
}

.child-parent-reply-head {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #1d4ed8;
    margin-bottom: 6px;
}

.child-parent-reply-text {
    margin: 0;
    font-size: 0.88rem;
    color: #1e3a8a;
    line-height: 1.6;
}

.task-note-thread {
    max-height: 220px;
    overflow-y: auto;
    margin-bottom: 12px;
    padding: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.task-note-thread-empty {
    margin: 0;
    text-align: center;
    color: #94a3b8;
    font-size: 0.82rem;
    padding: 12px 8px;
}

.thread-msg {
    padding: 8px 10px;
    border-radius: 10px;
    max-width: 92%;
}

.thread-msg-child {
    align-self: flex-end;
    background: #fff7ed;
    border: 1px solid #fed7aa;
}

.thread-msg-parent {
    align-self: flex-start;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.thread-msg.is-unread {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.thread-msg-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 0.72rem;
}

.thread-msg-head strong {
    color: #334155;
}

.thread-msg-head small {
    color: #94a3b8;
}

.thread-msg-text {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.5;
    color: #1e293b;
    word-break: break-word;
}

.parent-note-thread-wrap .parent-note-thread {
    max-height: 180px;
    overflow-y: auto;
    margin-top: 8px;
}

.parent-note-thread-wrap .thread-msg {
    max-width: 100%;
}

.top-notify-thread-preview {
    margin-top: 8px;
    max-height: 140px;
    overflow-y: auto;
    padding: 6px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.top-notify-thread-preview .thread-msg {
    max-width: 100%;
    font-size: 0.75rem;
}

.top-notify-thread-preview .thread-msg-text {
    font-size: 0.75rem;
}

.top-notify-more {
    text-align: center;
    padding: 8px;
    font-size: 0.75rem;
    color: #94a3b8;
}

/* ========== التواصل المباشر ========== */
.nav-icon-wrap {
    position: relative;
    display: inline-flex;
}

.nav-comm-badge {
    position: absolute;
    top: -4px;
    left: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: linear-gradient(145deg, #ef4444, #dc2626);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.45);
    border: 2px solid #1e293b;
}

.nav-comm-badge[hidden] {
    display: none !important;
}

.comm-panel-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem !important;
}

.comm-select-row {
    margin: 0;
    max-width: 420px;
}

.comm-chat-area {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.comm-chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: #94a3b8;
    min-height: 180px;
    padding: 1.5rem 1rem;
}

.comm-chat-empty[hidden] {
    display: none !important;
}

.comm-chat-empty i {
    font-size: 2.5rem;
    opacity: 0.5;
}

.comm-chat-empty p {
    margin: 0;
    font-size: 0.95rem;
}

.comm-chat-active {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comm-chat-active[hidden] {
    display: none !important;
}

.comm-chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #fff9f0, #fff);
    border: 1px solid #f0e0cc;
    border-radius: 14px;
}

.comm-chat-avatar {
    font-size: 1.8rem;
    line-height: 1;
}

.comm-chat-header strong {
    display: block;
    font-size: 0.95rem;
    color: #1e3a5f;
}

.comm-chat-header small {
    color: #64748b;
    font-size: 0.75rem;
}

.comm-compose-area {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.comm-history-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.comm-history-title {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 700;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 6px;
}

.comm-history-title i {
    color: #f97316;
}

.comm-thread {
    flex: 1;
    min-height: 220px;
    max-height: 340px;
    overflow-y: auto;
    padding: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
}

.comm-textarea {
    margin: 0;
}

.comm-child-panel {
    margin: 0 0 1rem;
    padding: 1.25rem;
}

.comm-child-header {
    margin-bottom: 1rem;
}

.comm-child-header h3 {
    margin: 0 0 0.35rem;
    font-size: 1.1rem;
    color: #1e3a5f;
}

.comm-child-header p {
    margin: 0;
    font-size: 0.85rem;
    color: #64748b;
}

.comm-empty-hint {
    margin: 0;
    padding: 1rem;
    text-align: center;
    color: #64748b;
    font-size: 0.88rem;
}

.top-notify-item strong {
    color: #1e3a5f;
    font-weight: 800;
}

.top-notify-empty {
    padding: 1.5rem 1rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 600;
}

.top-notify-empty i {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: #cbd5e1;
}

/* ========== شاشة الدخول ========== */
.login-screen {
    background: #fafbfc;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.login-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 100%;
    min-height: 0;
}

.login-brand {
    position: relative;
    background: linear-gradient(160deg, #1e3a5f 0%, #2d4a6f 45%, #3d2a1a 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 1.5rem;
    min-height: 0;
    overflow: hidden;
}

.brand-glow {
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.25) 0%, transparent 70%);
    top: -80px;
    right: -80px;
    pointer-events: none;
}

.brand-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    max-width: 360px;
    width: 100%;
    flex-shrink: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.35rem;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 5px 14px;
    border-radius: 30px;
    font-size: 0.78rem;
    margin: 0 auto 0.15rem;
    color: #fde68a;
}

.brand-vision {
    position: relative;
    margin: 0;
    padding: 0.85rem 0.8rem 0.75rem;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.vision-symbol {
    position: relative;
    height: 40px;
    margin-bottom: 0.35rem;
}

.vision-svg {
    position: relative;
    z-index: 2;
    width: 52px;
    height: auto;
    margin: 0 auto;
    display: block;
}

.vision-seedling {
    animation: visionSeedGrow 4s ease-in-out infinite;
    transform-origin: 40px 32px;
}

@keyframes visionSeedGrow {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.vision-headline {
    font-size: 1.25rem;
    font-weight: 900;
    color: #fff;
    line-height: 1.35;
    margin-bottom: 4px;
}

.vision-headline em {
    font-style: normal;
    background: linear-gradient(135deg, #fde68a, #fbbf24, #34d399);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.vision-lead {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.45;
    font-weight: 500;
}

.vision-quote {
    margin: 0 0 0.55rem;
    padding: 0;
    border: none;
    position: relative;
    z-index: 2;
}

.vision-lines {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
    text-align: right;
}

.vision-lines li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.88);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 5px 9px;
    line-height: 1.4;
}

.vision-lines li i {
    width: 22px;
    height: 22px;
    border-radius: 7px;
    background: rgba(251, 191, 36, 0.15);
    color: #fde68a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    flex-shrink: 0;
}

.brand-title-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    margin: -0.1rem 0 0;
    padding: 8px 4px 4px;
    animation: brandTitleFloat 3.2s ease-in-out infinite;
}

.brand-title {
    font-size: 2.2rem;
    font-weight: 900;
    background: linear-gradient(120deg, #fde68a 0%, #fbbf24 35%, #f97316 65%, #fcd34d 100%);
    background-size: 220% 220%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin: 0;
    position: relative;
    z-index: 2;
    line-height: 1.2;
    animation: brandTitleShimmer 5s ease-in-out infinite;
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.25);
}

.brand-title-heart {
    color: #fb7185;
    font-size: 1.35rem;
    line-height: 1;
    animation: brandHeartPulse 2.4s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(251, 113, 133, 0.45));
}

@keyframes brandTitleFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes brandTitleShimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes brandHeartPulse {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.15); opacity: 1; }
}

.brand-subtitle {
    font-size: 0.78rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.72);
    margin: 0;
}

.brand-features-desktop {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: right;
    margin-top: 0.35rem;
}

@media (max-height: 820px) {
    .brand-features-desktop {
        display: none;
    }

    .vision-symbol {
        height: 58px;
        margin-bottom: 0.25rem;
    }

    .brand-content {
        gap: 0.25rem;
    }
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.08);
    padding: 10px 16px;
    border-radius: 14px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.feature-item i {
    width: 32px;
    height: 32px;
    background: rgba(251, 191, 36, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fbbf24;
    flex-shrink: 0;
}

.brand-shapes .shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.08;
    background: #fbbf24;
}

.shape-1 { width: 180px; height: 180px; bottom: -40px; left: -40px; }
.shape-2 { width: 100px; height: 100px; top: 40px; left: 30px; animation: float 5s ease-in-out infinite; }
.shape-3 { width: 60px; height: 60px; bottom: 80px; right: 40px; animation: float 4s ease-in-out infinite reverse; }

.login-form-side {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(180deg, #ffffff 0%, #fff9f0 100%);
    min-height: 0;
    overflow: hidden;
}

.login-card {
    width: 100%;
    max-width: 380px;
    background: white;
    border-radius: 28px;
    padding: 2rem 2rem 1.5rem;
    box-shadow: 0 20px 50px -15px rgba(30, 58, 95, 0.15);
    border: 1px solid #f0e6d8;
}

.login-card-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.login-card-header h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: #1e3a5f;
    margin-bottom: 6px;
}

.login-card-header p {
    color: #9a7b5a;
    font-size: 0.9rem;
}

.input-group {
    margin-bottom: 1.1rem;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: #b45309;
    margin-bottom: 6px;
    padding-right: 4px;
}

.input-wrap {
    position: relative;
}

.input-wrap i {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #d4a574;
    font-size: 0.95rem;
    pointer-events: none;
}

.input-wrap-password .input-field {
    padding-left: 44px;
}

.password-toggle-btn {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #b45309;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    transition: color 0.2s, background 0.2s;
}

.password-toggle-btn:hover {
    color: #f97316;
    background: rgba(249, 115, 22, 0.08);
}

.input-field {
    width: 100%;
    padding: 13px 44px 13px 16px;
    border: 2px solid #f0e0cc;
    border-radius: 14px;
    font-size: 0.95rem;
    background: #fffdf9;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-field:focus {
    border-color: #f97316;
    outline: none;
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.1);
}

.btn-login {
    background: linear-gradient(95deg, #1e3a5f, #2d4a6f);
    border: none;
    padding: 14px 20px;
    width: 100%;
    border-radius: 14px;
    font-size: 1.05rem;
    font-weight: 700;
    color: white;
    cursor: pointer;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(30, 58, 95, 0.3);
}

.btn-login:active {
    transform: translateY(0);
}

.error-message {
    background: #fef2f2;
    color: #b91c1c;
    border-radius: 12px;
    padding: 10px 14px;
    margin-top: 12px;
    display: none;
    font-size: 0.85rem;
    align-items: center;
    gap: 8px;
    border: 1px solid #fecaca;
}

.login-footer-note {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.78rem;
    color: #b8a088;
    line-height: 1.6;
}

.dashboard {
    display: none;
    padding: 1.5rem;
}

.welcome-card {
    background: linear-gradient(135deg, #1e3a5f, #2d1b0e);
    border-radius: 40px;
    padding: 1.5rem 2rem;
    color: white;
    margin-bottom: 2rem;
}

.welcome-card h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.role-badge {
    background: #ffd700;
    color: #1e3a5f;
    padding: 2px 12px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-right: 10px;
}

.selection-area {
    background: white;
    padding: 1.1rem 1.25rem;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    border: 1px solid #f0e6d8;
    margin-bottom: 1.5rem;
}

.selection-filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: center;
    justify-content: flex-start;
}

.selection-action-row {
    display: flex;
    justify-content: center;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #f0e6d8;
}

.filter-period-inline {
    display: none;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

/* ========== فلاتر في سطر واحد: أيقونة + حقل ========== */
.filter-inline-row {
    display: flex;
    align-items: stretch;
    min-height: 44px;
    flex: 0 1 auto;
}

.filter-inline-children {
    min-width: 200px;
    max-width: 280px;
    flex: 1 1 220px;
}

.filter-inline-type {
    min-width: 170px;
    max-width: 220px;
    flex: 0 1 190px;
}

.filter-inline-date {
    min-width: 220px;
    max-width: 300px;
    flex: 1 1 240px;
}

.filter-inline-period {
    flex: 1 1 auto;
    min-width: 0;
}

.filter-icon-strip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    min-width: 48px;
    border-radius: 0 12px 12px 0;
    color: #fff;
    font-size: 1.05rem;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
    z-index: 1;
}

.filter-icon-strip.strip-children {
    background: linear-gradient(145deg, #1e3a5f, #3b82f6);
    box-shadow: 0 4px 14px rgba(30, 58, 95, 0.32);
}

.filter-icon-strip.strip-type {
    background: linear-gradient(145deg, #ea580c, #f97316);
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.32);
}

.filter-icon-strip.strip-date {
    background: linear-gradient(145deg, #059669, #34d399);
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.32);
}

.filter-icon-strip.strip-week {
    background: linear-gradient(145deg, #7c3aed, #a78bfa);
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.32);
}

.filter-icon-strip.strip-month {
    background: linear-gradient(145deg, #0d9488, #2dd4bf);
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.32);
}

.filter-inline-body {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: stretch;
}

.filter-inline-body .filter-dropdown,
.filter-inline-body .unified-field {
    width: 100%;
}

.unified-field-inline {
    height: 44px;
    min-height: 44px;
    border-radius: 12px 0 0 12px;
    border-right: none;
    margin-right: -1px;
}

.filter-inline-row:has(:focus-within) .filter-icon-strip,
.filter-inline-row:has(.filter-dropdown.open) .filter-icon-strip {
    filter: brightness(1.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

.filter-inline-body .unified-field-inline.unified-field-date {
    max-width: none;
}

.period-inline-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: stretch;
    flex: 1;
}

.period-inline-select {
    flex: 1 1 100px;
    min-width: 95px;
}

.period-inline-select .unified-select {
    font-size: 0.78rem;
}

/* ========== فلاتر مدمجة (قديم) ========== */
.filter-compact-item {
    flex: 0 1 auto;
    min-width: 155px;
    max-width: 200px;
}

.filter-compact-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 6px;
    white-space: nowrap;
}

.filter-compact-label i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: 9px;
    font-size: 0.88rem;
    color: #fff;
    background: linear-gradient(145deg, #ea580c, #f97316);
    box-shadow: 0 3px 10px rgba(249, 115, 22, 0.28);
    flex-shrink: 0;
}

.filter-compact-item:first-of-type .filter-compact-label i {
    background: linear-gradient(145deg, #1e3a5f, #3b82f6);
    box-shadow: 0 3px 10px rgba(30, 58, 95, 0.28);
}

.filter-compact-item:nth-of-type(2) .filter-compact-label i {
    background: linear-gradient(145deg, #ea580c, #f97316);
    box-shadow: 0 3px 10px rgba(249, 115, 22, 0.28);
}

#dailyPeriodBox .filter-compact-label i {
    background: linear-gradient(145deg, #059669, #34d399);
    box-shadow: 0 3px 10px rgba(5, 150, 105, 0.28);
}

.filter-compact-body {
    width: 100%;
}

.period-row-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}

.period-field {
    flex: 0 1 auto;
    min-width: 115px;
    max-width: 155px;
}

.period-mini-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #a16207;
    margin-bottom: 5px;
    text-align: right;
    white-space: nowrap;
}

.period-mini-label i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 8px;
    font-size: 0.8rem;
    color: #fff;
    background: linear-gradient(145deg, #7c3aed, #a78bfa);
    box-shadow: 0 3px 9px rgba(124, 58, 237, 0.25);
    flex-shrink: 0;
}

.period-field:nth-of-type(1) .period-mini-label i {
    background: linear-gradient(145deg, #1e3a5f, #3b82f6);
    box-shadow: 0 3px 9px rgba(30, 58, 95, 0.25);
}

.period-field:nth-of-type(2) .period-mini-label i {
    background: linear-gradient(145deg, #ea580c, #f97316);
    box-shadow: 0 3px 9px rgba(249, 115, 22, 0.25);
}

.period-field:nth-of-type(3) .period-mini-label i {
    background: linear-gradient(145deg, #7c3aed, #a78bfa);
    box-shadow: 0 3px 9px rgba(124, 58, 237, 0.25);
}

.unified-field-compact {
    height: 38px;
    min-height: 38px;
    border-radius: 10px;
    border-width: 1.5px;
    background: #fff;
}

.unified-field-compact .unified-select {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0 28px 0 10px;
}

.unified-field-compact .unified-content {
    padding: 0 8px;
    font-size: 0.8rem;
}

.unified-field-compact .unified-arrow {
    left: 10px;
    font-size: 0.65rem;
}

.unified-field-compact .unified-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.unified-field-compact.unified-field-date {
    max-width: 280px;
}

.unified-field-compact .unified-icon-date {
    min-width: 46px;
    width: 46px;
}

.view-btn-compact {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    min-height: 40px;
    padding: 0 20px !important;
    font-size: 0.85rem;
    white-space: nowrap;
    border-radius: 10px;
}

.view-btn-compact > i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.22);
}

.select-box {
    min-width: 0;
}

.select-box label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    color: #b45309;
    font-size: 0.85rem;
    white-space: nowrap;
}

.label-invisible {
    visibility: hidden;
}

.select-box-action {
    min-width: 140px;
}

/* ========== حقول موحّدة ========== */
.unified-field {
    position: relative;
    display: flex;
    align-items: center;
    height: 48px;
    min-height: 48px;
    width: 100%;
    background: #fffef7;
    border: 2px solid #ffddb0;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.unified-field:focus-within,
.filter-dropdown.open .unified-field {
    border-color: #f97316;
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.08);
}

.unified-trigger {
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    text-align: inherit;
    padding: 0;
}

.unified-icon {
    width: 46px;
    min-width: 46px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #1e3a5f, #2d4a6f);
    color: #fbbf24;
    font-size: 1rem;
    flex-shrink: 0;
}

.unified-content {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    padding: 4px 10px;
    overflow: hidden;
}

.unified-placeholder {
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 600;
}

.unified-select {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: none;
    background: transparent;
    padding: 0 10px 0 30px;
    font-family: 'Cairo', sans-serif;
    font-size: 0.92rem;
    font-weight: 700;
    color: #1e3a5f !important;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    outline: none;
    line-height: normal;
}

.unified-select option {
    color: #1e3a5f;
    background: #fff;
    font-weight: 600;
}

.unified-arrow {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    color: #b45309;
    pointer-events: none;
}

.filter-dropdown.open .unified-arrow {
    transform: translateY(-50%) rotate(180deg);
}

.unified-date-btn {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: none;
    background: transparent;
    font-family: 'Cairo', sans-serif;
    font-size: 0.92rem;
    font-weight: 700;
    color: #1e3a5f;
    cursor: pointer;
    text-align: right;
    padding: 0 10px 0 30px;
    display: flex;
    align-items: center;
}

.icon-rect-sm {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    font-size: 0.85rem !important;
}

.unified-field-btn {
    cursor: pointer;
}

.unified-icon-date {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    min-width: 54px;
    width: 54px;
    height: 100%;
    padding: 2px 4px;
    border: none;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    flex-shrink: 0;
}

.unified-icon-date.has-date {
    background: linear-gradient(145deg, #163352, #1e3a5f);
}

.unified-icon-date .fa-calendar-day {
    font-size: 0.75rem;
    color: #fbbf24;
    margin-bottom: 1px;
}

.date-label-in-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1;
    gap: 1px;
}

.date-day-num {
    font-size: 1.05rem;
    font-weight: 900;
    color: #fff;
    line-height: 1;
}

.date-sub-txt {
    font-size: 0.58rem;
    font-weight: 700;
    color: #fde68a;
    line-height: 1;
}

.date-field-hint {
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0 10px 0 12px;
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.unified-field-date {
    cursor: pointer;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 3px 4px 3px 10px;
    background: linear-gradient(135deg, #fff7ed, #ffedd5);
    border: 1px solid #fdba74;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
    line-height: 1.4;
}

.filter-chip-name {
    color: #9a3412;
    padding-left: 6px;
}

.filter-chip-mark {
    width: 12px;
    height: 12px;
    min-width: 12px;
    background: linear-gradient(145deg, #f59e0b, #f97316);
    border-radius: 3px;
    flex-shrink: 0;
}

.filter-chip.chip-all {
    background: linear-gradient(135deg, #1e3a5f, #2d4a6f);
    border-color: #1e3a5f;
    color: #fde68a;
}

.filter-chip.chip-all i {
    font-size: 0.7rem;
}

/* ========== فلتر الأبناء ========== */
.filter-dropdown {
    position: relative;
    width: 100%;
}

.filter-dropdown.open {
    z-index: 1000;
}

.filter-dropdown.open .filter-menu {
    display: block;
}

.filter-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    background: #fff;
    border: 1px solid #e8dcc8;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(30, 58, 95, 0.12);
    z-index: 9999;
    padding: 5px;
    max-height: min(220px, 50vh);
    overflow-y: auto;
}

#childFilterOptions {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.filter-option {
    display: block;
    cursor: pointer;
    user-select: none;
    width: 100%;
    position: relative;
}

.filter-option-frame {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 6px 10px;
    min-height: 32px;
    border: 1px solid #f0e6d8;
    border-radius: 8px;
    background: #fff;
    transition: border-color 0.15s, background 0.15s;
}

.filter-option-name {
    flex: 1;
    text-align: right;
    color: #1e3a5f;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.3;
}

.filter-check {
    width: 16px;
    height: 16px;
    min-width: 16px;
    border: 1.5px solid #d4a574;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.filter-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.filter-option:hover .filter-option-frame {
    border-color: #fdba74;
    background: #fff9f0;
}

.filter-option:has(input:checked) .filter-option-frame {
    border-color: #f97316;
    background: #fff9f0;
    box-shadow: none;
}

.filter-option:has(input:checked) .filter-option-name {
    font-weight: 800;
    color: #9a3412;
}

.filter-all .filter-option-frame {
    border-color: #fed7aa;
    background: #fffbf5;
}

.filter-all .filter-option-name {
    color: #b45309;
    font-size: 0.9rem;
}

.filter-option:has(input:checked) .filter-check {
    background: linear-gradient(145deg, #f59e0b, #f97316);
    border-color: #f97316;
}

.filter-option:has(input:checked) .filter-check::after {
    content: "✓";
    color: #fff;
    font-size: 0.65rem;
    font-weight: bold;
}

.filter-divider {
    height: 1px;
    background: #f0e0cc;
    margin: 4px 2px;
}

.view-btn-inline {
    width: 100%;
    justify-content: center;
    white-space: nowrap;
}

.compare-table-wrap {
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid #e8edf2;
    margin-top: 1.25rem;
}

.compare-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 55%, #3b82f6 100%);
    border-radius: 16px;
    color: #fff;
    box-shadow: 0 8px 24px rgba(30, 58, 95, 0.22);
}

.compare-banner-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.15);
    font-size: 1.4rem;
    flex-shrink: 0;
}

.compare-banner-text h4 {
    margin: 0 0 4px;
    font-size: 1.1rem;
    font-weight: 800;
}

.compare-banner-text p {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.9;
}

.compare-leaderboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
}

.compare-stat-card {
    position: relative;
    background: #fff;
    border: 2px solid #e8edf2;
    border-radius: 16px;
    padding: 1.1rem 1rem 1rem;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.compare-stat-card.is-leader {
    border-color: var(--child-color, #f97316);
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.15);
    transform: translateY(-2px);
}

.compare-stat-rank {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--child-color, #64748b);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 3px 12px;
    border-radius: 20px;
    white-space: nowrap;
}

.compare-stat-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--child-color, #3b82f6);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 900;
    margin-bottom: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.compare-ring-wrap {
    position: relative;
    width: 88px;
    height: 88px;
    margin: 0 auto 10px;
}

.compare-ring-wrap svg {
    transform: rotate(-90deg);
}

.compare-ring-bg {
    fill: none;
    stroke: #e8edf2;
    stroke-width: 6;
}

.compare-ring-fill {
    fill: none;
    stroke: var(--child-color, #f97316);
    stroke-width: 6;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.6s ease;
}

.compare-ring-pct {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    font-weight: 900;
    color: #1e3a5f;
}

.compare-stat-name {
    font-weight: 800;
    color: #1e3a5f;
    margin-bottom: 4px;
    font-size: 1rem;
}

.compare-stat-detail {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 6px;
}

.compare-stat-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-top: 6px;
}

.compare-mini-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    background: #f1f5f9;
    color: #475569;
}

.compare-mini-badge.badge-done {
    background: #dcfce7;
    color: #166534;
}

.compare-mini-badge.badge-pending {
    background: #fef3c7;
    color: #92400e;
}

.compare-diff-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 1rem;
    padding: 10px 14px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 12px;
    font-size: 0.85rem;
    color: #92400e;
    font-weight: 600;
}

.compare-diff-summary i {
    color: #f59e0b;
}

.compare-table th.compare-child-col {
    text-align: center;
    font-size: 0.85rem;
    font-weight: 800;
    color: #1e3a5f;
    background: color-mix(in srgb, var(--child-color, #3b82f6) 12%, #fff);
    border-bottom: 3px solid var(--child-color, #3b82f6);
}

.compare-child-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 4px 0;
    color: #1e3a5f;
}

.compare-child-header span:not(.compare-child-dot) {
    color: #1e3a5f;
    font-weight: 800;
    font-size: 0.9rem;
}

.compare-child-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--child-color, #3b82f6);
}

.compare-row-diff {
    background: #fffbeb !important;
}

.compare-row-diff:hover {
    background: #fef3c7 !important;
}

.compare-cell {
    text-align: center !important;
    font-size: 0.85rem;
    vertical-align: middle;
}

.compare-cell-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 0.9rem;
}

.compare-cell-icon.cell-done {
    background: #dcfce7;
    color: #16a34a;
}

.compare-cell-icon.cell-pending {
    background: #fef3c7;
    color: #d97706;
}

.compare-cell-icon.cell-inactive {
    background: #f1f5f9;
    color: #94a3b8;
}

.compare-cell-leader {
    outline: 2px solid var(--child-color, #f97316);
    outline-offset: 2px;
}

.compare-stats-grid {
    display: none;
}

.compare-stat-pct {
    display: none;
}

.progress-bar-wrap {
    background: #e0e0e0;
    border-radius: 10px;
    height: 8px;
    margin-top: 8px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #4ade80);
    border-radius: 10px;
    transition: width 0.4s ease;
}

.stats-success {
    color: #2e7d32;
    font-weight: bold;
    margin-top: 10px;
}

.custom-select {
    width: 100%;
    padding: 12px 18px;
    border: 2px solid #ffddb0;
    border-radius: 12px;
    font-size: 1rem;
    background: #fffef7;
    cursor: pointer;
}
.view-btn {
    background: linear-gradient(95deg, #f97316, #fbbf24);
    border: none;
    padding: 6px 20px 6px 6px;
    border-radius: 12px;
    font-weight: bold;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    align-self: flex-end;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
    min-height: 48px;
}

.view-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(249, 115, 22, 0.35);
}

.view-btn-sm {
    padding: 4px;
    font-size: 0.9rem;
    min-height: 42px;
}

.view-btn-icon-only {
    padding: 4px !important;
    min-width: 42px;
    justify-content: center;
}

.view-btn-sm .icon-rect {
    width: 34px;
    height: 34px;
    min-width: 34px;
    font-size: 0.85rem;
}
.view-btn.green {
    background: linear-gradient(95deg, #2e7d32, #4caf50);
}


.tasks-table-container {
    background: white;
    border-radius: 40px;
    padding: 1.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    display: none;
}
.tasks-table-container h3 {
    font-size: 1.15rem;
    color: #2d1b0e;
    margin-bottom: 0;
    border-right: 5px solid #f97316;
    padding-right: 12px;
    line-height: 1.5;
    font-weight: 700;
}
.tasks-table-wrap {
    overflow-x: auto;
    border-radius: 16px;
    border: 1px solid #e5dcc8;
    box-shadow: 0 4px 18px rgba(30, 58, 95, 0.07);
    background: #fff;
}

.tasks-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.tasks-table-pro th.col-status {
    min-width: 110px;
}

.tasks-table-pro th.col-points,
.tasks-table-pro td.col-points {
    min-width: 108px;
    text-align: center;
    white-space: nowrap;
}

.points-editor {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: #fff9f0;
    border: 1px solid #f0e0cc;
    border-radius: 12px;
    padding: 4px 8px;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

.points-input {
    width: 28px;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 0.88rem;
    font-weight: 800;
    color: #1e3a5f;
    padding: 2px 0;
    font-family: inherit;
    font-variant-numeric: lining-nums;
    direction: ltr;
    unicode-bidi: isolate;
}

.points-input.points-earned {
    color: #059669;
}

.points-input.points-max {
    color: #b45309;
    width: 38px;
}

.points-max-fixed {
    min-width: 14px;
    text-align: center;
    font-size: 0.88rem;
    font-weight: 800;
    color: #b45309;
    font-family: inherit;
    font-variant-numeric: lining-nums;
}

.points-input:focus {
    outline: none;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}

.points-slash {
    color: #cbd5e1;
    font-size: 0.8rem;
    font-weight: 600;
}

.points-inactive {
    color: #94a3b8;
}

.num-en {
    direction: ltr;
    unicode-bidi: isolate;
    font-variant-numeric: lining-nums;
    font-feature-settings: "lnum" 1;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

.points-fraction {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    white-space: nowrap;
}

.points-pending-wait {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #94a3b8;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.points-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
}

.points-badge-earned {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.points-badge-wait {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.points-summary-bar {
    margin: 1rem 0 0.75rem;
    padding: 0.85rem 1rem;
    background: linear-gradient(135deg, #fff9f0, #fff);
    border: 1px solid #f0e0cc;
    border-radius: 16px;
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.08);
}

.points-summary-main {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.points-summary-main i {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #fde68a, #f97316);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.points-summary-label {
    display: block;
    font-size: 0.78rem;
    color: #9a7b5a;
    margin-bottom: 2px;
}

.points-summary-value {
    font-size: 1.25rem;
    color: #1e3a5f;
    font-weight: 900;
}

.points-summary-meter {
    height: 8px;
    background: #f0e6d8;
    border-radius: 999px;
    overflow: hidden;
}

.points-summary-fill {
    height: 100%;
    background: linear-gradient(90deg, #fbbf24, #f97316);
    border-radius: 999px;
    transition: width 0.3s ease;
}

.stats-points-msg {
    margin-top: 10px;
    color: #b45309;
    font-weight: 600;
    font-size: 0.95rem;
}

.stats-points-msg strong {
    color: #059669;
    font-size: 1.1rem;
}

/* ========== ترحيب الابن ========== */
.child-welcome-hero {
    position: relative;
    margin-bottom: 1.25rem;
    border-radius: 28px;
    overflow: hidden;
    background: linear-gradient(135deg, #1e3a5f 0%, #2d4a6f 50%, #4a2c12 100%);
    box-shadow: 0 16px 40px rgba(30, 58, 95, 0.2);
}

.child-welcome-inner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.35rem 1.5rem;
    color: #fff;
}

.child-welcome-sparkles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.child-welcome-sparkles span {
    position: absolute;
    font-size: 1rem;
    opacity: 0.35;
    animation: welcomeSparkle 4s ease-in-out infinite;
}

.child-welcome-sparkles span:nth-child(1) { top: 12%; right: 8%; animation-delay: 0s; }
.child-welcome-sparkles span:nth-child(2) { top: 60%; right: 18%; animation-delay: 1.2s; }
.child-welcome-sparkles span:nth-child(3) { bottom: 15%; left: 12%; animation-delay: 2s; }

@keyframes welcomeSparkle {
    0%, 100% { transform: translateY(0) scale(1); opacity: 0.3; }
    50% { transform: translateY(-6px) scale(1.15); opacity: 0.7; }
}

.child-welcome-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.child-welcome-greeting {
    display: inline-block;
    font-size: 0.82rem;
    color: #fde68a;
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.3);
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 6px;
}

.child-welcome-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 1.45rem;
    font-weight: 900;
    margin: 0 0 4px;
    line-height: 1.35;
}

.child-welcome-title-prefix {
    color: rgba(255, 255, 255, 0.92);
}

.child-welcome-brand-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.child-welcome-brand-name {
    background: linear-gradient(135deg, #fde68a 0%, #fbbf24 45%, #f97316 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: childBrandShimmer 4s ease-in-out infinite;
}

.child-welcome-brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, rgba(251, 113, 133, 0.35), rgba(249, 115, 22, 0.25));
    border: 1.5px solid rgba(251, 191, 36, 0.55);
    box-shadow: 0 0 16px rgba(251, 113, 133, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    animation: childBrandHeartPulse 2.2s ease-in-out infinite;
}

.child-welcome-brand-icon i {
    font-size: 0.95rem;
    color: #fb7185;
    filter: drop-shadow(0 0 6px rgba(251, 113, 133, 0.6));
}

@keyframes childBrandShimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes childBrandHeartPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 16px rgba(251, 113, 133, 0.35); }
    50% { transform: scale(1.1); box-shadow: 0 0 22px rgba(251, 113, 133, 0.55); }
}

.child-welcome-date {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.65);
    margin: 0 0 8px;
}

.child-welcome-msg {
    font-size: 0.92rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.88);
    margin: 0 0 10px;
}

.child-welcome-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.child-welcome-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.child-welcome-chip.chip-gold {
    background: rgba(251, 191, 36, 0.18);
    border-color: rgba(251, 191, 36, 0.35);
    color: #fde68a;
}

.child-tasks-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 12px;
}

.child-tasks-header-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.child-tasks-header-top h3 {
    margin: 0;
}

.child-task-type-select-row {
    margin: 0;
    max-width: 100%;
    width: min(100%, 520px);
}

.child-task-picker-hint {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #fff9f0, #fff);
    border: 1px solid #f0e0cc;
    border-radius: 14px;
    color: #475569;
    margin-bottom: 14px;
}

.child-task-picker-hint i {
    color: #f97316;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.child-task-picker-hint p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.child-task-picker-summary {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.child-task-picker-summary-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
}

.child-task-picker-summary-item.is-empty {
    opacity: 0.7;
}

.child-task-picker-summary-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #fff7ed, #ffedd5);
    color: #ea580c;
    flex-shrink: 0;
}

.child-task-picker-summary-item:nth-child(2) .child-task-picker-summary-icon {
    background: linear-gradient(145deg, #eff6ff, #dbeafe);
    color: #2563eb;
}

.child-task-picker-summary-item:nth-child(3) .child-task-picker-summary-icon {
    background: linear-gradient(145deg, #f5f3ff, #ede9fe);
    color: #7c3aed;
}

.child-task-picker-summary-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.child-task-picker-summary-body strong {
    font-size: 0.9rem;
    color: #1e3a5f;
}

.child-task-picker-summary-body > span {
    font-size: 0.78rem;
    color: #64748b;
}

.child-back-picker-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #dbeafe;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 8px 14px;
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.child-back-picker-btn:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}

.child-task-picker {
    margin-top: 4px;
}

.child-task-picker-head {
    margin-bottom: 16px;
}

.child-task-picker-head h3 {
    margin: 0 0 6px;
    font-size: 1.1rem;
    color: #1e3a5f;
    display: flex;
    align-items: center;
    gap: 8px;
}

.child-task-picker-head p {
    margin: 0;
    color: #64748b;
    font-size: 0.88rem;
}

.child-task-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.child-task-picker-card {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    text-align: right;
    border: 1px solid #e2e8f0;
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border-radius: 18px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.22s ease;
    font-family: inherit;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.child-task-picker-card:hover:not(:disabled) {
    transform: translateY(-2px);
    border-color: #fdba74;
    box-shadow: 0 10px 24px rgba(249, 115, 22, 0.12);
}

.child-task-picker-card.is-empty,
.child-task-picker-card:disabled {
    opacity: 0.72;
    cursor: not-allowed;
    background: #f8fafc;
}

.child-task-picker-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #fff7ed, #ffedd5);
    color: #ea580c;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.child-task-picker-card:nth-child(2) .child-task-picker-icon {
    background: linear-gradient(145deg, #eff6ff, #dbeafe);
    color: #2563eb;
}

.child-task-picker-card:nth-child(3) .child-task-picker-icon {
    background: linear-gradient(145deg, #f5f3ff, #ede9fe);
    color: #7c3aed;
}

.child-task-picker-body {
    flex: 1;
    min-width: 0;
}

.child-task-picker-body h4 {
    margin: 0 0 4px;
    font-size: 1rem;
    color: #1e293b;
}

.child-task-picker-body p {
    margin: 0 0 8px;
    font-size: 0.78rem;
    color: #64748b;
}

.child-task-picker-meta {
    font-size: 0.76rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 8px;
}

.child-task-picker-dot {
    margin: 0 6px;
    color: #cbd5e1;
}

.child-task-picker-empty {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.76rem;
    color: #94a3b8;
    font-weight: 600;
}

.child-task-picker-bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.child-task-picker-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #10b981);
    border-radius: 999px;
    transition: width 0.3s ease;
}

.child-task-picker-arrow {
    color: #94a3b8;
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* ========== ملاحظات المهام ========== */
.tasks-table-pro th.col-note,
.tasks-table-pro td.col-note {
    min-width: 120px;
    text-align: center;
    vertical-align: middle;
}

.task-row-has-note {
    background: rgba(251, 191, 36, 0.04) !important;
}

.child-note-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.child-note-btn:hover {
    border-color: #f97316;
    color: #f97316;
    background: #fff9f0;
}

.child-note-btn.has-note {
    background: #fff7ed;
    border-color: #fdba74;
    color: #c2410c;
}

.child-note-preview {
    font-size: 0.65rem;
    color: #94a3b8;
    margin: 4px 0 0;
    line-height: 1.35;
    max-width: 130px;
    margin-inline: auto;
}

.parent-note-empty {
    font-size: 0.75rem;
    color: #94a3b8;
}

.parent-note-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid #fdba74;
    background: linear-gradient(135deg, #fff7ed, #ffedd5);
    color: #c2410c;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 7px 12px;
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.parent-note-btn:hover {
    background: linear-gradient(135deg, #ffedd5, #fed7aa);
    border-color: #f97316;
    transform: translateY(-1px);
}

.parent-note-btn.has-new {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: #1d4ed8;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.parent-note-btn.has-new::after {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ef4444;
    flex-shrink: 0;
}

.parent-note-bubble {
    text-align: right;
    background: linear-gradient(135deg, #fff9f0, #fff);
    border: 1px solid #f0e0cc;
    border-right: 3px solid #f97316;
    border-radius: 12px;
    padding: 8px 10px;
    max-width: 220px;
    margin: 0 auto;
}

.parent-note-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.68rem;
    font-weight: 800;
    color: #b45309;
    margin-bottom: 4px;
}

.parent-note-header small {
    margin-right: auto;
    color: #94a3b8;
    font-weight: 500;
}

.parent-note-text {
    font-size: 0.78rem;
    line-height: 1.45;
    color: #334155;
    margin: 0;
    word-break: break-word;
}

.parent-notes-report {
    margin: 1rem 0;
    background: linear-gradient(135deg, #fff9f0 0%, #fff 100%);
    border: 1px solid #f0e0cc;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.08);
}

.parent-notes-report-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 1rem 1.15rem;
    background: linear-gradient(135deg, #1e3a5f, #2d4a6f);
    color: #fff;
}

.parent-notes-report-head i {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(251, 191, 36, 0.2);
    color: #fde68a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.parent-notes-report-head h4 {
    margin: 0 0 2px;
    font-size: 1rem;
}

.parent-notes-report-head p {
    margin: 0;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.75);
}

.parent-notes-report-list {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.parent-notes-report-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #f0e6d8;
    border-radius: 14px;
}

.parent-notes-report-num {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #fff7ed;
    color: #f97316;
    font-weight: 800;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.parent-notes-report-body {
    flex: 1;
    min-width: 0;
}

.parent-notes-report-body strong {
    display: block;
    font-size: 0.8rem;
    color: #1e3a5f;
    margin-bottom: 4px;
}

.parent-notes-report-body p {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.5;
    color: #475569;
}

.parent-notes-report-status {
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ========== نافذة ملاحظة الابن ========== */
.child-note-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.child-note-modal[hidden] {
    display: none !important;
}

.child-note-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
}

.child-note-modal-card {
    position: relative;
    z-index: 2;
    width: min(100%, 420px);
    background: #fff;
    border-radius: 22px;
    padding: 1.25rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
    animation: noteModalIn 0.25s ease;
}

@keyframes noteModalIn {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.child-note-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.child-note-modal-header h3 {
    margin: 0;
    font-size: 1.05rem;
    color: #1e3a5f;
}

.child-note-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f5f9;
    border-radius: 10px;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    color: #64748b;
}

.child-note-task-title {
    font-size: 0.85rem;
    color: #b45309;
    background: #fff9f0;
    border: 1px solid #f0e0cc;
    border-radius: 12px;
    padding: 8px 12px;
    margin: 0 0 0.75rem;
    line-height: 1.45;
}

.child-note-textarea {
    width: 100%;
    border: 2px solid #f0e0cc;
    border-radius: 14px;
    padding: 12px;
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
    background: #fffdf9;
    transition: border-color 0.2s;
}

.child-note-textarea:focus {
    outline: none;
    border-color: #f97316;
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.1);
}

.child-note-hint {
    font-size: 0.72rem;
    color: #94a3b8;
    margin: 8px 0 12px;
}

.child-note-modal-actions {
    display: flex;
    gap: 8px;
}

.child-note-save-btn,
.child-note-clear-btn {
    flex: 1;
    border: none;
    border-radius: 12px;
    padding: 10px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.child-note-save-btn {
    background: linear-gradient(135deg, #1e3a5f, #2d4a6f);
    color: #fff;
}

.child-note-clear-btn {
    background: #fef2f2;
    color: #b91c1c;
    flex: 0 0 auto;
    padding-inline: 14px;
}

@media (max-width: 768px) {
    .child-welcome-inner {
        flex-direction: column;
        text-align: center;
        padding: 1.1rem;
    }

    .child-welcome-chips {
        justify-content: center;
    }

    .child-welcome-title {
        font-size: 1.2rem;
    }
}

.tasks-table-pro thead tr {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a8e 100%);
}

.tasks-table-pro th {
    padding: 13px 16px;
    text-align: center;
    color: #fde68a;
    font-size: 0.85rem;
    font-weight: 700;
    border: none;
    white-space: nowrap;
}

.tasks-table-pro th.col-task {
    text-align: right;
}

.tasks-table-pro tbody tr {
    transition: background 0.15s ease;
}

.tasks-table-pro tbody tr:nth-child(even) {
    background: #faf8f4;
}

.tasks-table-pro tbody tr:hover {
    background: #fff8ed;
}

.tasks-table-pro tbody tr.task-row-done {
    background: #f0fdf4;
}

.tasks-table-pro tbody tr.task-row-done:hover {
    background: #e8f9ee;
}

.tasks-table-pro tbody tr.task-row-inactive {
    background: #f5f5f5;
    opacity: 0.8;
}

.tasks-table-pro td {
    padding: 13px 16px;
    text-align: right;
    border-bottom: 1px solid #ede5d8;
    vertical-align: middle;
}

.tasks-table-pro tbody tr:last-child td {
    border-bottom: none;
}

.col-num {
    width: 52px;
    text-align: center !important;
}

.col-check {
    width: 52px;
    text-align: center !important;
}

.col-category {
    width: 130px;
    text-align: center !important;
}

.col-status {
    width: 150px;
    text-align: center !important;
}

.col-action {
    width: 110px;
    text-align: center !important;
}

.col-task {
    min-width: 200px;
}

.task-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: linear-gradient(145deg, #fff1e0, #ffe4c4);
    color: #b45309;
    font-weight: 800;
    font-size: 0.82rem;
    border: 1px solid #ffd9a8;
}

.task-text {
    font-size: 0.92rem;
    font-weight: 600;
    color: #2d1b0e;
    line-height: 1.6;
    display: block;
}

.category-empty {
    color: #ccc;
    font-size: 0.9rem;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.status-pill-done {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.status-pill-pending {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
}

.status-pill-inactive {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #e5e7eb;
}

.task-check-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.task-check-wrap input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.task-check-box {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    border: 2px solid #f97316;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.task-check-wrap input:checked + .task-check-box {
    background: linear-gradient(145deg, #22c55e, #16a34a);
    border-color: #16a34a;
}

.task-check-wrap input:checked + .task-check-box::after {
    content: '✓';
    color: #fff;
    font-size: 0.85rem;
    font-weight: bold;
}

.completed-task {
    text-decoration: none !important;
}

.tasks-table-pro tr.task-row-done .task-text {
    text-decoration: none !important;
    color: #047857 !important;
    font-weight: 700;
}

.tasks-table-pro tr:not(.task-row-done):not(.task-row-inactive) .task-text {
    color: #2d1b0e;
    font-weight: 600;
}

#childDashboard .task-text {
    text-decoration: none !important;
    color: inherit !important;
}

#childDashboard .task-row-done .task-text {
    color: #047857 !important;
    font-weight: 700;
}

/* ========== احتفال إنجاز المهمة — شاشة كاملة (6–12 سنة) ========== */
.child-celebrate-overlay {
    position: fixed;
    inset: 0;
    z-index: 11000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow: hidden;
    pointer-events: none;
}

.child-celebrate-overlay[hidden] {
    display: none !important;
}

.celebrate-screen-flash {
    position: absolute;
    inset: 0;
    z-index: 5;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.85) 0%, rgba(251, 191, 36, 0.35) 40%, transparent 70%);
    opacity: 0;
    pointer-events: none;
}

.celebrate-screen-flash.flash-active {
    animation: celebrateScreenFlash 0.55s ease-out forwards;
}

@keyframes celebrateScreenFlash {
    0% { opacity: 0; transform: scale(0.8); }
    15% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.15); }
}

.child-celebrate-backdrop {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: radial-gradient(ellipse at center, rgba(15, 23, 42, 0.55) 0%, rgba(15, 23, 42, 0.82) 100%);
    backdrop-filter: blur(4px);
}

.celebrate-fireworks-layer,
.celebrate-confetti-layer,
.celebrate-popper-layer {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

.celebrate-fireworks-layer { z-index: 3; }
.celebrate-confetti-layer { z-index: 4; }
.celebrate-popper-layer { z-index: 5; }

/* قصاصات ملونة */
.celebrate-particle {
    position: absolute;
    top: -20px;
    width: var(--size);
    height: var(--size);
    background: var(--color);
    opacity: 0;
    animation: celebrateParticleFall var(--duration) ease-out var(--delay) forwards;
}

.celebrate-particle-rect {
    border-radius: 2px;
}

.celebrate-particle-circle {
    border-radius: 50%;
}

@keyframes celebrateParticleFall {
    0% {
        opacity: 1;
        transform: translateY(0) translateX(0) rotate(0deg) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(110vh) translateX(var(--drift)) rotate(var(--spin)) scale(0.4);
    }
}

/* ألعاب نارية */
.celebrate-firework-burst {
    position: absolute;
    width: 0;
    height: 0;
    transform: translate(-50%, -50%);
}

.celebrate-burst-core {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 20px 6px var(--burst-color, #fbbf24);
    animation: burstCorePop 0.5s ease-out forwards;
}

@keyframes burstCorePop {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    40% { transform: translate(-50%, -50%) scale(1.4); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
}

.celebrate-spark {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 8px 2px currentColor;
    animation: sparkFly 0.9s ease-out forwards;
    animation-delay: 0.05s;
}

@keyframes sparkFly {
    0% {
        transform: translate(-50%, -50%) rotate(var(--angle)) translateX(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) rotate(var(--angle)) translateX(var(--dist));
        opacity: 0;
    }
}

/* إيموجي فرقعة */
.celebrate-popper-emoji {
    position: absolute;
    top: -30px;
    opacity: 0;
    animation: popperEmojiFall var(--duration) cubic-bezier(0.25, 0.46, 0.45, 0.94) var(--delay) forwards;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.2));
}

@keyframes popperEmojiFall {
    0% {
        opacity: 1;
        transform: translateY(0) translateX(0) scale(0.3) rotate(0deg);
    }
    20% {
        transform: translateY(15vh) translateX(calc(var(--drift) * 0.3)) scale(1.2) rotate(180deg);
    }
    100% {
        opacity: 0;
        transform: translateY(105vh) translateX(var(--drift)) scale(0.8) rotate(720deg);
    }
}

/* بطاقة البطل */
.child-celebrate-card {
    position: relative;
    z-index: 10;
    text-align: center;
    pointer-events: auto;
}

.celebrate-hero-card {
    background: linear-gradient(165deg, #ffffff 0%, #fffbeb 45%, #fef3c7 100%);
    border: 3px solid transparent;
    border-radius: 32px;
    padding: 2.25rem 2rem 1.75rem;
    max-width: 380px;
    width: min(92vw, 380px);
    box-shadow:
        0 0 0 1px rgba(251, 191, 36, 0.5),
        0 30px 80px rgba(249, 115, 22, 0.35),
        0 0 60px rgba(251, 191, 36, 0.25);
    background-clip: padding-box;
    overflow: visible;
}

.celebrate-hero-card::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 35px;
    background: linear-gradient(135deg, #f97316, #fbbf24, #ef4444, #a855f7, #f97316);
    background-size: 300% 300%;
    z-index: -1;
    animation: celebrateBorderGlow 2s linear infinite;
}

@keyframes celebrateBorderGlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.celebrate-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid rgba(251, 191, 36, 0.45);
    pointer-events: none;
}

.celebrate-ring-1 {
    inset: -18px;
    animation: celebrateRingPulse 1.8s ease-out infinite;
}

.celebrate-ring-2 {
    inset: -36px;
    animation: celebrateRingPulse 1.8s ease-out 0.4s infinite;
}

@keyframes celebrateRingPulse {
    0% { transform: scale(0.95); opacity: 0.7; }
    50% { transform: scale(1.05); opacity: 0.35; }
    100% { transform: scale(1.15); opacity: 0; }
}

.child-celebrate-overlay.celebrate-in .celebrate-hero-card {
    animation: celebrateHeroPop 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.child-celebrate-overlay.celebrate-out .celebrate-hero-card {
    animation: celebrateHeroOut 0.45s ease forwards;
}

@keyframes celebrateHeroPop {
    0% { transform: scale(0.3) rotate(-8deg); opacity: 0; }
    60% { transform: scale(1.08) rotate(2deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes celebrateHeroOut {
    to { transform: scale(0.85) translateY(20px); opacity: 0; }
}

.child-celebrate-icon {
    width: 88px;
    height: 88px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fde68a 0%, #f97316 50%, #ef4444 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    box-shadow: 0 10px 30px rgba(249, 115, 22, 0.45);
    animation: celebrateTrophyBounce 0.7s ease-in-out infinite alternate;
}

@keyframes celebrateTrophyBounce {
    from { transform: scale(1) rotate(-5deg); }
    to { transform: scale(1.12) rotate(5deg); }
}

.child-celebrate-title {
    font-size: clamp(2.2rem, 8vw, 3rem);
    font-weight: 900;
    margin: 0 0 6px;
    background: linear-gradient(135deg, #f97316, #fbbf24, #ef4444);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: celebrateTitleShine 1.5s linear infinite;
    text-shadow: none;
    filter: drop-shadow(0 2px 8px rgba(249, 115, 22, 0.3));
}

@keyframes celebrateTitleShine {
    to { background-position: 200% center; }
}

.child-celebrate-sub {
    font-size: 1.05rem;
    color: #92400e;
    margin: 0 0 10px;
    font-weight: 800;
}

.child-celebrate-msg {
    font-size: 1.05rem;
    color: #1e3a5f;
    margin: 0;
    line-height: 1.55;
    font-weight: 700;
}

.child-celebrate-overlay.celebrate-speaking .child-celebrate-icon {
    animation: celebrateTrophyBounce 0.45s ease-in-out infinite alternate,
               celebrateSpeakerPulse 0.8s ease-in-out infinite;
}

@keyframes celebrateSpeakerPulse {
    0%, 100% { box-shadow: 0 10px 30px rgba(249, 115, 22, 0.45); }
    50% { box-shadow: 0 10px 40px rgba(249, 115, 22, 0.7), 0 0 0 8px rgba(251, 191, 36, 0.25); }
}

@media (max-width: 480px) {
    .celebrate-hero-card {
        padding: 1.75rem 1.25rem 1.5rem;
        border-radius: 24px;
    }

    .child-celebrate-icon {
        width: 72px;
        height: 72px;
        font-size: 2rem;
    }
}

.child-encourage-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10900;
    width: min(calc(100% - 2rem), 440px);
    pointer-events: none;
}

.child-encourage-toast .child-encourage-inner {
    pointer-events: auto;
}

.child-encourage-toast[hidden] {
    display: none !important;
}

.child-encourage-inner {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: linear-gradient(135deg, #1e3a5f, #2d4a6f);
    color: #fff;
    padding: 1rem 2.5rem 1rem 1rem;
    border-radius: 18px;
    box-shadow: 0 12px 40px rgba(30, 58, 95, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.child-encourage-toast.toast-in .child-encourage-inner {
    animation: toastPopIn 0.35s ease;
}

.child-encourage-toast.toast-out .child-encourage-inner {
    animation: toastPopOut 0.28s ease forwards;
}

@keyframes toastPopIn {
    from { transform: scale(0.88); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes toastPopOut {
    to { transform: scale(0.92); opacity: 0; }
}

@keyframes toastSlideUp {
    from { transform: translateY(24px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes toastSlideDown {
    to { transform: translateY(16px); opacity: 0; }
}

.child-encourage-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(251, 191, 36, 0.2);
    color: #fde68a;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
}

.child-encourage-inner p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.55;
    padding-top: 2px;
}

.child-encourage-close {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
}

.task-toggle-btn {
    background: #e8f5e9;
    border: none;
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 0.8rem;
    color: #2e7d32;
    cursor: pointer;
}
.task-toggle-btn.inactive {
    background: #ffebee;
    color: #c62828;
}
.stats {
    margin-top: 20px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
    border-radius: 16px;
    text-align: center;
    border: 1px solid #bbf7d0;
    font-size: 0.92rem;
}

.progress-bar-wrap {
    background: #e0e0e0;
    border-radius: 20px;
    margin-top: 10px;
    height: 8px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #16a34a);
    border-radius: 20px;
    transition: width 0.3s;
}

.stats-success {
    color: #15803d;
    font-weight: bold;
    margin-top: 10px;
    font-size: 0.9rem;
}
.status-done {
    color: #2e7d32;
    font-weight: bold;
}
.status-pending {
    color: #f57c00;
    font-weight: bold;
}
.status-inactive {
    color: #999;
}
.duaa-badge {
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    color: #fff;
    margin-right: 8px;
    display: inline-block;
    font-weight: bold;
}
.duaa-badge.wake {
    background: #ff9800;
}
.duaa-badge.sleep {
    background: #3f51b5;
}
.duaa-badge.enter {
    background: #4caf50;
}
.duaa-badge.exit {
    background: #f44336;
}
.duaa-badge.food {
    background: #9c27b0;
}

.task-badge {
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    color: #fff;
    margin-right: 8px;
    display: inline-block;
    font-weight: bold;
    background: #1e3a5f;
}
footer {
    background: #fef5e7;
    text-align: center;
    padding: 15px;
    margin-top: 2rem;
    border-radius: 30px;
    font-size: 0.85rem;
    color: #7f5e3a;
}

.update-section {
    background: #fff3e0;
    padding: 15px;
    border-radius: 30px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    justify-content: center;
}
.update-section p {
    color: #b45309;
    font-weight: 600;
}

@media (max-width: 768px) {
    body.login-mode {
        padding: 0;
        overflow: hidden;
        height: 100dvh;
        align-items: stretch;
    }

    body.login-mode .app-container {
        height: 100dvh;
        border-radius: 0;
        max-width: none;
    }

    body.login-mode .main-content {
        border-radius: 0;
        height: 100dvh;
        overflow: hidden;
        max-height: none;
    }

    .login-screen {
        height: 100%;
        overflow: hidden;
    }

    .login-layout {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
        height: 100%;
        overflow: hidden;
    }

    .login-brand {
        justify-content: flex-start;
        align-items: center;
        overflow: hidden;
        min-height: 0;
        padding: 0.3rem 0.65rem 0.45rem;
    }

    .brand-content {
        max-width: none;
        gap: 0.15rem;
        transform: scale(0.97);
        transform-origin: top center;
        justify-content: flex-start;
    }

    .brand-badge {
        margin-bottom: 0;
        padding: 4px 11px;
        font-size: 0.68rem;
    }

    .brand-title-wrap {
        padding: 6px 4px 2px;
        margin-top: -0.15rem;
    }

    .brand-title {
        font-size: 1.75rem;
    }

    .brand-title-heart {
        font-size: 1.15rem;
    }

    .vision-symbol {
        display: none;
    }

    .brand-vision {
        padding: 0.55rem 0.55rem 0.5rem;
        border-radius: 14px;
        margin: 0;
    }

    .vision-headline {
        font-size: 0.95rem;
        margin-bottom: 2px;
    }

    .vision-lead {
        font-size: 0.68rem;
        line-height: 1.35;
    }

    .vision-quote {
        margin-bottom: 0.35rem;
    }

    .vision-lines {
        gap: 4px;
    }

    .vision-lines li {
        font-size: 0.62rem;
        padding: 4px 7px;
        border-radius: 8px;
        gap: 6px;
    }

    .vision-lines li i {
        width: 18px;
        height: 18px;
        font-size: 0.55rem;
        border-radius: 5px;
    }

    .brand-subtitle {
        font-size: 0.62rem;
        line-height: 1.35;
    }

    .brand-features-desktop {
        display: none;
    }

    .login-form-side {
        padding: 0.65rem 1rem;
        min-height: 0;
        overflow: hidden;
    }

    .login-card {
        padding: 0.85rem 0.5rem 0.5rem;
        border-radius: 16px;
        box-shadow: none;
        border: none;
        background: transparent;
    }

    .login-card-header {
        margin-bottom: 0.85rem;
    }

    .login-card-header h2 {
        font-size: 1.25rem;
    }

    .login-card-header p {
        font-size: 0.78rem;
    }

    .input-group {
        margin-bottom: 0.75rem;
    }

    .input-group label {
        font-size: 0.78rem;
        margin-bottom: 4px;
    }

    .input-field {
        padding: 10px 40px 10px 12px;
        font-size: 0.85rem;
    }

    .btn-login {
        padding: 11px 16px;
        font-size: 0.92rem;
        margin-top: 0.25rem;
    }

    .login-footer-note {
        margin-top: 0.75rem;
        font-size: 0.68rem;
    }
}

@media (max-width: 768px) and (max-height: 680px) {
    .brand-content {
        transform: scale(0.9);
    }

    .brand-title {
        font-size: 1.4rem;
    }
}

@media (max-width: 768px) and (max-height: 600px) {
    .brand-content {
        transform: scale(0.82);
    }
}

@media (max-width: 900px) {
    /* السماح بتمرير الصفحة كاملة على الأجهزة اللوحية والهواتف */
    html, body {
        height: auto;
    }
    body.logged-in {
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    body.logged-in .app-container {
        height: auto;
        min-height: 100vh;
    }
    body.logged-in .main-content {
        height: auto;
        max-height: none;
        overflow-y: visible;
    }

    .top-status-bar {
        padding: 8px 10px;
    }

    .top-status-bar-inner {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .top-status-chip {
        min-width: 0;
    }

    .top-status-chip.chip-calendar {
        grid-column: 1 / -1;
        min-width: 0;
    }

    .top-status-chip.chip-clock {
        width: auto;
        min-width: 0;
    }

    .top-status-notify-wrap {
        grid-column: 1 / -1;
        min-width: 0;
    }

    .app-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        min-width: unset;
        border-radius: 0;
        max-height: none;
    }
    .sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
        padding: 0.5rem;
        gap: 4px;
        overflow: hidden;
    }
    .sidebar-nav-spacer {
        display: none;
    }
    .nav-section-title {
        width: 100%;
    }
    .nav-item {
        flex: 1 1 calc(50% - 4px);
        padding: 10px 12px;
    }
    .nav-logout {
        flex: 1 1 100%;
        border-top: none;
        margin-top: 0;
        padding-top: 10px;
    }
    .main-content {
        border-radius: 0;
        max-height: none;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .selection-filters-row {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-inline-row,
    .filter-inline-children,
    .filter-inline-type,
    .filter-inline-date {
        max-width: none;
        width: 100%;
    }
    .period-inline-group {
        flex-direction: column;
    }
    .period-inline-select {
        min-width: 0;
        width: 100%;
    }
    .filter-compact-item,
    .period-field {
        max-width: none;
        width: 100%;
    }
    .filter-period-inline {
        width: 100%;
    }
    .view-btn-compact {
        width: 100%;
        justify-content: center;
    }
    .label-invisible {
        display: none;
    }
}
