@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');

/* === НаГрадинка Admin - Color Variables === */
:root {
    --berry: #FF6B8A;
    --lavender: #B28DFF;
    --sky: #6EC6FF;
    --grass: #4ECB71;
    --sun: #FFD93D;
    --peach: #FFAB76;
    --deep: #2D3561;
    --soft-bg: #FFF8F0;
    --berry-light: #FFE0E8;
    --lavender-light: #EDE0FF;
    --sky-light: #E0F2FF;
    --grass-light: #E0F8E6;
    --sun-light: #FFF8DC;
    --peach-light: #FFF0E0;
    --sidebar-dark: #1E2444;
    --card-shadow: 0 4px 15px rgba(45, 53, 97, 0.08);
    --card-radius: 16px;
}

/* === Base Styles === */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    font-family: 'Nunito', 'Segoe UI', sans-serif;
    background-color: var(--soft-bg);
    color: var(--deep);
    margin: 0;
    padding: 0;
    height: 100%;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--deep);
}

h1:focus { outline: none; }

a { color: var(--berry); }
a:hover { color: #e0527a; }

/* === App Layout === */
.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* === Sidebar === */
.sidebar {
    width: 260px;
    min-width: 260px;
    height: 100vh;
    background: linear-gradient(180deg, var(--deep) 0%, var(--sidebar-dark) 100%);
    color: white;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.brand-icon {
    font-size: 2rem;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.brand-sub {
    font-size: 0.75rem;
    opacity: 0.6;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* === Top Bar === */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    background: #fff;
    border-bottom: 1px solid #f0e8e0;
    min-height: 60px;
    flex-shrink: 0;
}

.top-bar-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--deep);
}

.top-bar-date {
    font-size: 0.9rem;
    color: #8890a4;
    font-weight: 600;
}

/* === Nav Menu === */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 12px 10px;
    gap: 2px;
}

.sidebar-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.sidebar-nav .nav-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    text-decoration: none;
}

.sidebar-nav .nav-item.active {
    background: linear-gradient(135deg, var(--berry), var(--lavender));
    color: white;
    box-shadow: 0 4px 12px rgba(255, 107, 138, 0.4);
}

.sidebar-nav .nav-item-highlight {
    border: 1px dashed rgba(255,255,255,0.25);
}

.sidebar-nav .nav-item-highlight.active {
    border-color: transparent;
}

.nav-icon {
    font-size: 1.2rem;
    width: 28px;
    text-align: center;
}

.nav-text {
    white-space: nowrap;
}

/* === Main Content === */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.content-container {
    padding: 32px 40px;
    max-width: 1400px;
    flex: 1;
    overflow-y: auto;
}

/* === Page Header === */
.page-header {
    margin-bottom: 28px;
}

.page-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0 0 4px 0;
}

.page-header p {
    color: #8890a4;
    font-size: 1rem;
    margin: 0;
}

/* === Cards === */
.card {
    background: white;
    border: none;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(45, 53, 97, 0.12);
}

.card-body {
    padding: 24px;
}

/* === Stat Cards === */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border-radius: var(--card-radius);
    padding: 24px;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-card .stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}

.stat-icon.berry-bg { background: var(--berry-light); }
.stat-icon.lavender-bg { background: var(--lavender-light); }
.stat-icon.sky-bg { background: var(--sky-light); }
.stat-icon.grass-bg { background: var(--grass-light); }
.stat-icon.sun-bg { background: var(--sun-light); }
.stat-icon.peach-bg { background: var(--peach-light); }

.stat-card .stat-info h3 {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0;
    line-height: 1;
}

.stat-card .stat-info p {
    margin: 4px 0 0 0;
    color: #8890a4;
    font-size: 0.85rem;
    font-weight: 600;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    border-radius: 10px;
    padding: 10px 24px;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-berry {
    background: var(--berry);
    color: white;
}

.btn-berry:hover {
    background: #e0527a;
    color: white;
    box-shadow: 0 4px 12px rgba(255, 107, 138, 0.35);
}

.btn-grass {
    background: var(--grass);
    color: white;
}

.btn-grass:hover {
    background: #3db85d;
    color: white;
}

.btn-sky {
    background: var(--sky);
    color: white;
}

.btn-sky:hover {
    background: #4fb5f5;
    color: white;
}

.btn-lavender {
    background: var(--lavender);
    color: white;
}

.btn-lavender:hover {
    background: #9a70f0;
    color: white;
}

.btn-sun {
    background: var(--sun);
    color: var(--deep);
}

.btn-sun:hover {
    background: #f0c800;
}

.btn-peach {
    background: var(--peach);
    color: white;
}

.btn-peach:hover {
    background: #f09050;
    color: white;
}

.btn-danger {
    background: #ff4757;
    color: white;
}

.btn-danger:hover {
    background: #d63031;
    color: white;
}

.btn-outline-berry {
    background: transparent;
    color: var(--berry);
    border: 2px solid var(--berry);
}

.btn-outline-berry:hover {
    background: var(--berry);
    color: white;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
    border-radius: 8px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
    border-radius: 12px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.btn-icon-danger {
    background: #ffe0e0;
    color: #d32f2f;
}

.btn-icon-danger:hover {
    background: #d32f2f;
    color: white;
}

.btn-icon-edit {
    background: var(--sky-light);
    color: var(--sky);
}

.btn-icon-edit:hover {
    background: var(--sky);
    color: white;
}

/* === Tables === */
.table-container {
    background: white;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    border: none;
}

.table thead th {
    background: var(--soft-bg);
    border: none;
    padding: 14px 20px;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #8890a4;
    text-align: left;
}

.table tbody td {
    padding: 14px 20px;
    border-bottom: 1px solid #f5f0eb;
    vertical-align: middle;
    font-size: 0.95rem;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover {
    background: #fffcf8;
}

/* === Forms === */
.form-group {
    margin-bottom: 16px;
}

.form-group label,
.form-label {
    display: block;
    font-weight: 700;
    font-size: 0.85rem;
    color: #5a6078;
    margin-bottom: 6px;
}

.form-control, .form-select {
    width: 100%;
    border: 2px solid #e8e0d8;
    border-radius: 10px;
    padding: 10px 16px;
    font-family: 'Nunito', sans-serif;
    font-size: 0.95rem;
    transition: border-color 0.2s ease;
    background: #fff;
    color: #333;
}

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--lavender);
    box-shadow: 0 0 0 3px rgba(178, 141, 255, 0.15);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

textarea.form-control {
    min-height: 80px;
    resize: vertical;
}

.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 200px;
}

/* === Quick Log Styles === */
.quick-action-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 20px 0;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px 12px;
    border-radius: 14px;
    border: 3px solid transparent;
    cursor: pointer;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    text-align: center;
}

.quick-action-btn .action-icon {
    font-size: 2rem;
}

.quick-action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.quick-action-btn.selected {
    border-color: var(--deep);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.quick-action-btn.meal { background: var(--peach-light); color: var(--deep); }
.quick-action-btn.sleep { background: var(--lavender-light); color: var(--deep); }
.quick-action-btn.wakeup { background: var(--sun-light); color: var(--deep); }
.quick-action-btn.activity { background: var(--sky-light); color: var(--deep); }
.quick-action-btn.toilet { background: var(--grass-light); color: var(--deep); }
.quick-action-btn.mood { background: var(--berry-light); color: var(--deep); }

/* === Child Cards (Quick Log) === */
.children-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.child-card {
    background: white;
    border-radius: 14px;
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    border: 3px solid transparent;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.child-card:hover {
    border-color: var(--sky);
    transform: translateY(-2px);
}

.child-card.selected {
    border-color: var(--grass);
    background: var(--grass-light);
}

.child-card .child-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sky), var(--lavender));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px auto;
    font-size: 1.3rem;
    color: white;
    font-weight: 800;
}

.child-card .child-name {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--deep);
}

.child-card .child-check {
    margin-top: 6px;
    font-size: 1.1rem;
}

/* === Badges === */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.75rem;
}

.badge-berry {
    background: var(--berry-light);
    color: var(--berry);
}

.badge-lavender {
    background: var(--lavender-light);
    color: var(--lavender);
}

.badge-sky {
    background: var(--sky-light);
    color: var(--sky);
}

.badge-grass {
    background: var(--grass-light);
    color: var(--grass);
}

.badge-sun {
    background: var(--sun-light);
    color: #b8860b;
}

.badge-peach {
    background: var(--peach-light);
    color: #d4762c;
}

/* === Modal === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(45, 53, 97, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-panel {
    background: white;
    border-radius: 20px;
    padding: 32px;
    width: 90%;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(45, 53, 97, 0.2);
}

.modal-panel h3 {
    margin: 0 0 24px 0;
    font-size: 1.3rem;
    font-weight: 800;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* === Alerts === */
.alert {
    border: none;
    border-radius: 12px;
    padding: 14px 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.alert-success {
    background: var(--grass-light);
    color: #2d7a40;
}

.alert-danger {
    background: #ffe0e0;
    color: #c0392b;
}

.alert-info {
    background: var(--sky-light);
    color: #2a7ab5;
}

.alert-warning {
    background: var(--sun-light);
    color: #b8860b;
}

/* === Activity Feed === */
.activity-feed {
    background: white;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    padding: 24px;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid #f5f0eb;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.activity-text {
    flex: 1;
}

.activity-text strong {
    font-weight: 700;
}

.activity-time {
    color: #8890a4;
    font-size: 0.8rem;
    margin-top: 2px;
}

/* === Selection Controls === */
.select-all-bar {
    background: var(--sky-light);
    border-radius: 12px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

/* === Food Menu === */
.menu-day {
    margin-bottom: 24px;
}

.menu-day-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--deep);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-meal-row {
    display: grid;
    grid-template-columns: 160px 1fr 1fr;
    gap: 12px;
    margin-bottom: 8px;
    align-items: center;
}

.meal-label {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--deep);
    padding: 10px 0;
}

/* === Calendar Events === */
.event-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.event-card {
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
    gap: 14px;
    border-left: 4px solid var(--lavender);
    transition: all 0.2s ease;
}

.event-card:hover {
    box-shadow: var(--card-shadow);
}

.event-card.holiday {
    border-left-color: var(--berry);
}

.event-date-badge {
    background: var(--soft-bg);
    border-radius: 10px;
    padding: 8px 12px;
    text-align: center;
    min-width: 54px;
    flex-shrink: 0;
}

.event-date-badge .day {
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1;
    color: var(--deep);
}

.event-date-badge .month {
    font-size: 0.7rem;
    font-weight: 700;
    color: #8890a4;
    text-transform: uppercase;
}

/* === Upload Drop Zone (Admin) === */
.upload-drop-zone:hover {
    border-color: var(--sky) !important;
    background: var(--sky-light) !important;
}
.upload-drop-zone.has-file {
    border-color: var(--grass) !important;
    background: var(--grass-light) !important;
    border-style: solid !important;
}

/* === Photo Gallery === */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.photo-card {
    background: white;
    border-radius: var(--card-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all 0.2s ease;
}

.photo-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(45, 53, 97, 0.12);
}

.photo-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.photo-card .photo-preview {
    height: 160px;
    background: linear-gradient(135deg, var(--sky-light), var(--lavender-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.photo-card .photo-info {
    padding: 16px;
}

.photo-card .photo-info h5 {
    margin: 0 0 6px 0;
    font-size: 0.9rem;
}

.photo-card .photo-info .photo-date {
    color: #8890a4;
    font-size: 0.8rem;
}

/* === Group Cards === */
.group-card {
    background: white;
    border-radius: 14px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

.group-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.group-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.group-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.group-details h4 {
    font-weight: 700;
    color: var(--deep);
    font-size: 1rem;
    margin: 0;
}

.group-details span {
    font-size: 0.8rem;
    color: #8890a4;
    font-weight: 600;
}

.group-actions {
    display: flex;
    gap: 8px;
}

/* === Notification Items === */
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 10px;
    background: white;
    border: 1px solid #f0e8e0;
    transition: all 0.2s ease;
}

.notif-item:hover {
    box-shadow: var(--card-shadow);
}

/* === Row helpers === */
.row {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.col-lg-8 {
    flex: 2;
    min-width: 300px;
}

.col-lg-4 {
    flex: 1;
    min-width: 280px;
}

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #8890a4;
}

.empty-state .empty-icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
}

.empty-state h4 {
    color: #8890a4;
    font-weight: 700;
}

/* === Checkbox Custom === */
.custom-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
}

.custom-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--grass);
}

/* === Scrollbar === */
.content-container::-webkit-scrollbar,
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.content-container::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.content-container::-webkit-scrollbar-thumb {
    background: #d0c8c0;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

/* === Loading Spinner === */
.spinner-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 4px solid #e8e0d8;
    border-top-color: var(--berry);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.spinner.sm { width: 20px; height: 20px; border-width: 3px; }

.spinner-inline {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #8890a4;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 12px 0;
}

.spinner-inline .spinner { width: 20px; height: 20px; border-width: 3px; }

@keyframes spin { to { transform: rotate(360deg); } }

/* === Allergen Alert Banner === */
.allergen-alert-banner {
    background: linear-gradient(135deg, #fff0f0, #ffe0e8);
    border: 2px solid var(--berry);
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 24px;
    animation: alertPulse 2s ease-in-out infinite;
}

.allergen-alert-banner h4 {
    color: #d32f2f;
    font-size: 1.1rem;
    font-weight: 800;
    margin: 0 0 12px;
}

.allergen-alert-item {
    padding: 10px 14px;
    background: white;
    border-radius: 10px;
    margin-bottom: 8px;
    border-left: 4px solid var(--berry);
}

@keyframes alertPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 138, 0.2); }
    50% { box-shadow: 0 0 0 8px rgba(255, 107, 138, 0); }
}

/* === Blazor Error UI === */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "Възникна грешка."
}

/* === Validation === */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--grass);
}

.invalid {
    outline: 1px solid var(--berry);
}

.validation-message {
    color: var(--berry);
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE APP STYLES (/app/* routes)
   ═══════════════════════════════════════════════════════════════ */

/* Mobile App Shell */
.m-app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--soft-bg);
    overflow: hidden;
}

.m-content {
    flex: 1;
    overflow: hidden;
}

.m-page-wrap {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Mobile Tab Bar */
.m-tabbar {
    display: flex;
    background: white;
    border-top: 1px solid #f0e8e0;
    padding: 6px 0 max(6px, env(safe-area-inset-bottom));
    flex-shrink: 0;
}

.m-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 0;
    text-decoration: none;
    color: #b8b9c9;
    font-size: 0.7rem;
    font-weight: 700;
    transition: color 0.2s;
}

.m-tab.active {
    color: var(--berry);
}

.m-tab-icon {
    font-size: 1.3rem;
    line-height: 1;
}

.m-tab-label {
    font-size: 0.7rem;
}

/* Mobile Header */
.m-header {
    padding: 24px 20px 20px;
    border-radius: 0 0 28px 28px;
    color: white;
    flex-shrink: 0;
    z-index: 100;
}

.m-header.berry { background: var(--berry); }
.m-header.lavender { background: var(--lavender); }
.m-header.sky { background: var(--sky); }
.m-header.grass { background: var(--grass); }
.m-header.sun { background: var(--sun); color: var(--deep); }

.m-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
    color: white;
}

.m-header p {
    margin: 4px 0 0;
    opacity: 0.8;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Mobile Page Content */
.m-page {
    padding: 16px 20px 24px;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Mobile Cards */
.m-card {
    background: white;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 2px 10px rgba(45,53,97,0.06);
}

/* Mobile Chips */
.m-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: 14px;
    -webkit-overflow-scrolling: touch;
}

.m-chips::-webkit-scrollbar { display: none; }

.m-chip {
    padding: 8px 18px;
    border-radius: 24px;
    border: 2px solid transparent;
    font-family: 'Nunito', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    flex-shrink: 0;
}

.m-chip.berry { background: var(--berry-light); color: var(--berry); border-color: var(--berry); }
.m-chip.lavender { background: var(--lavender-light); color: var(--lavender); border-color: var(--lavender); }
.m-chip.sky { background: var(--sky-light); color: var(--sky); border-color: var(--sky); }
.m-chip.grass { background: var(--grass-light); color: var(--grass); border-color: var(--grass); }
.m-chip.sun { background: var(--sun-light); color: #b8860b; border-color: var(--sun); }
.m-chip.peach { background: var(--peach-light); color: #d4762c; border-color: var(--peach); }

.m-chip.active {
    color: white !important;
}
.m-chip.berry.active { background: var(--berry); }
.m-chip.lavender.active { background: var(--lavender); }
.m-chip.sky.active { background: var(--sky); }
.m-chip.grass.active { background: var(--grass); }
.m-chip.sun.active { background: var(--sun); color: var(--deep) !important; }
.m-chip.peach.active { background: var(--peach); }

.m-section-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #8890a4;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Mobile Child Card */
.m-child-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: white;
    border-radius: 18px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 10px rgba(45,53,97,0.06);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}

.m-child-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(45,53,97,0.1);
}

.m-child-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--lavender-light), var(--sky-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.m-child-name { font-weight: 700; font-size: 1rem; color: var(--deep); }
.m-child-group { font-size: 0.85rem; color: #8890a4; }

/* Mobile Quick Links */
.m-quick-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    border-radius: 20px;
    text-decoration: none;
    color: white;
    font-weight: 700;
    font-size: 0.95rem;
    transition: transform 0.2s;
}

.m-quick-link:hover { transform: translateY(-2px); color: white; }
.m-quick-link.sky { background: var(--sky); }
.m-quick-link.lavender { background: var(--lavender); }
.m-quick-link.berry { background: var(--berry); }
.m-quick-link.grass { background: var(--grass); }

/* Mobile Entry Card */
.m-entry-card {
    background: white;
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(45,53,97,0.05);
}

.m-entry-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.m-entry-header strong {
    font-size: 1rem;
    color: var(--deep);
}

.m-entry-desc {
    color: #7b7f9e;
    font-size: 0.9rem;
    margin: 4px 0;
}

.m-entry-time {
    font-size: 0.8rem;
    color: #a8abbd;
    font-weight: 600;
}

/* Mobile File Upload */
.m-upload-box {
    border: 2px dashed #d0c8c0;
    border-radius: 16px;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--soft-bg);
    position: relative;
}

.m-upload-box:hover {
    border-color: var(--sky);
    background: var(--sky-light);
}

.m-upload-box.has-file {
    border-color: var(--grass);
    background: var(--grass-light);
    border-style: solid;
}

.m-upload-box input[type="file"] {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.m-upload-icon {
    font-size: 2.2rem;
    margin-bottom: 8px;
}

.m-upload-text {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--deep);
}

.m-upload-hint {
    font-size: 0.8rem;
    color: #a8abbd;
    margin-top: 4px;
}

.m-upload-file {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.m-upload-file-icon {
    font-size: 1.5rem;
}

.m-upload-file-info {
    text-align: left;
}

.m-upload-file-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--deep);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.m-upload-file-size {
    font-size: 0.75rem;
    color: var(--grass);
    font-weight: 600;
}

/* Mobile Video Thumbnail */
.m-video-wrap {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, #1a1d3b, #2d3561);
    cursor: pointer;
}

.m-video-wrap video {
    width: 100%;
    max-height: 280px;
    display: block;
}

.m-video-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3);
    transition: background 0.2s;
}

.m-video-overlay:hover {
    background: rgba(0,0,0,0.15);
}

.m-video-play {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.m-video-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 3px 10px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
}

/* Mobile Notification Card */
.m-notif-card {
    background: white;
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(45,53,97,0.05);
    cursor: pointer;
    transition: background 0.2s;
}

.m-notif-card.unread {
    background: #fffcf8;
}

.m-notif-title {
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.m-notif-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--berry);
    flex-shrink: 0;
}

.m-notif-body {
    color: #7b7f9e;
    font-size: 0.9rem;
    margin: 4px 0;
}

.m-notif-time {
    font-size: 0.8rem;
    color: #a8abbd;
}

/* Mobile Calendar Grid */
.m-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
}

.m-cal-header {
    font-size: 0.75rem;
    font-weight: 700;
    color: #a8abbd;
    padding: 6px 0;
}

.m-cal-cell {
    padding: 8px 0;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 10px;
}

.m-cal-cell.today {
    background: var(--berry);
    color: white;
    font-weight: 800;
}

.m-cal-cell.holiday {
    background: var(--berry-light);
    color: var(--berry);
    font-weight: 800;
}

.m-cal-cell.event {
    background: var(--lavender-light);
    color: var(--lavender);
    font-weight: 800;
}

/* Mobile Welcome */
.m-welcome {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--soft-bg);
}

.m-welcome-top {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.m-welcome-logo {
    font-size: 5rem;
    margin-bottom: 12px;
    filter: drop-shadow(0 8px 24px rgba(255,107,138,0.3));
}

.m-welcome-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--deep);
    margin: 0;
}

.m-welcome-sub {
    color: #8890a4;
    font-size: 1rem;
    font-weight: 600;
    margin: 8px 0 0;
}

.m-welcome-bottom {
    padding: 0 28px 48px;
}

.m-welcome-hint {
    text-align: center;
    color: #a8abbd;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.m-welcome-btn {
    display: block;
    width: 100%;
    text-align: center;
    margin-bottom: 12px;
    font-size: 1.1rem;
    padding: 16px;
    border-radius: 20px;
    text-decoration: none;
}

.btn-lavender.m-welcome-btn:hover { color: white; }
.btn-berry.m-welcome-btn:hover { color: white; }

/* Mobile Login */
.m-login {
    min-height: 100vh;
    background: var(--soft-bg);
}

.m-login-header {
    padding: 40px 24px 60px;
    text-align: center;
    border-radius: 0 0 36px 36px;
    color: white;
}

.m-login-header.berry { background: var(--berry); }
.m-login-header.lavender { background: var(--lavender); }

.m-login-header-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 8px;
    background: rgba(255,255,255,0.2);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.m-login-header h1 {
    font-size: 2rem;
    font-weight: 800;
    margin: 8px 0 0;
    color: white;
}

.m-login-header p {
    margin: 4px 0 0;
    opacity: 0.8;
    font-weight: 600;
}

.m-login-card {
    background: white;
    border-radius: 24px;
    padding: 32px 28px;
    margin: -36px 20px 20px;
    box-shadow: 0 12px 40px rgba(45,53,97,0.1);
}

.m-login-card h2 {
    text-align: center;
    font-weight: 800;
    font-size: 1.4rem;
    margin: 0 0 24px;
}

/* Mobile Loading */
.m-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: var(--soft-bg);
}

.m-loading-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    animation: flowerSpin 3s ease-in-out infinite;
}

@keyframes flowerSpin {
    0% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(10deg); }
    50% { transform: scale(1) rotate(0deg); }
    75% { transform: scale(1.1) rotate(-10deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.m-loading-text { font-size: 1.3rem; font-weight: 800; color: var(--deep); }
.m-loading-sub { color: #8890a4; font-weight: 600; }

.m-center {
    display: flex;
    justify-content: center;
    padding: 40px 0;
}

.m-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #eee;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.m-spinner.berry { border-top-color: var(--berry); }
.m-spinner.lavender { border-top-color: var(--lavender); }
.m-spinner.sky { border-top-color: var(--sky); }
.m-spinner.grass { border-top-color: var(--grass); }

@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════════
   END MOBILE APP STYLES
   ═══════════════════════════════════════════════════════════════ */

/* === Responsive === */
@media (max-width: 768px) {
    .sidebar {
        width: 70px;
        min-width: 70px;
    }
    .sidebar-brand .brand-text {
        display: none;
    }
    .nav-text {
        display: none;
    }
    .content-container {
        padding: 20px 16px;
    }
    .stat-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    .quick-action-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .menu-meal-row {
        grid-template-columns: 1fr;
    }
    .row {
        flex-direction: column;
    }
}
