* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f6f8f5;
    color: #1f2933;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    width: min(1180px, 92%);
    margin: auto;
}

.topbar {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 10;
}

.nav {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo {
    font-size: 28px;
    font-weight: 800;
    color: #1f7a4d;
}

.logo span {
    color: #f59e0b;
}

nav {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 15px;
}

nav a {
    color: #374151;
    font-weight: 600;
}

.nav-btn {
    background: #1f7a4d;
    color: white !important;
    padding: 10px 16px;
    border-radius: 999px;
}

.hero {
    padding: 80px 0;
    background:
        radial-gradient(circle at top left, rgba(34,197,94,.20), transparent 35%),
        linear-gradient(135deg, #ecfdf5, #fff7ed);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 40px;
    align-items: center;
}

.badge {
    display: inline-block;
    background: #dcfce7;
    color: #166534;
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 700;
    margin-bottom: 18px;
}

.hero h1 {
    font-size: clamp(36px, 5vw, 62px);
    line-height: 1.05;
    margin: 0 0 22px;
    color: #111827;
}

.hero p {
    font-size: 19px;
    line-height: 1.7;
    color: #4b5563;
    max-width: 680px;
}

.hero-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.btn {
    display: inline-block;
    padding: 14px 24px;
    border-radius: 14px;
    font-weight: 800;
}

.btn.primary {
    background: #1f7a4d;
    color: white;
    box-shadow: 0 12px 24px rgba(31, 122, 77, .25);
}

.btn.secondary {
    background: white;
    color: #1f7a4d;
    border: 1px solid #bbf7d0;
}

.hero-card {
    background: white;
    border-radius: 28px;
    padding: 32px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .12);
}

.hero-card h3 {
    margin-top: 0;
    font-size: 24px;
}

.hero-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hero-card li {
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
    font-weight: 600;
}

.tools {
    padding: 70px 0;
    background: white;
}

.tools h2,
.why h2,
.cta h2 {
    font-size: 36px;
    margin-bottom: 10px;
}

.section-intro {
    color: #6b7280;
    font-size: 18px;
    margin-bottom: 30px;
}

.cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
}

.card {
    display: block;
    background: #f9fafb;
    padding: 28px;
    border-radius: 24px;
    border: 1px solid #e5e7eb;
    transition: .2s ease;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(15, 23, 42, .10);
    background: #ffffff;
}

.icon {
    font-size: 38px;
    margin-bottom: 14px;
}

.card h3 {
    margin: 0 0 10px;
    color: #111827;
}

.card p {
    color: #6b7280;
    line-height: 1.6;
}

.why {
    padding: 70px 0;
    background: #f0fdf4;
}

.why-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.why p {
    font-size: 18px;
    line-height: 1.8;
    color: #4b5563;
}

.why-list {
    display: grid;
    gap: 14px;
}

.why-list div {
    background: white;
    padding: 18px 20px;
    border-radius: 16px;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}

.cta {
    padding: 70px 0;
    text-align: center;
    background: #111827;
    color: white;
}

.cta p {
    color: #d1d5db;
    font-size: 18px;
    margin-bottom: 28px;
}

footer {
    background: #0b1220;
    color: #9ca3af;
    padding: 24px 0;
    text-align: center;
    font-size: 14px;
}

@media (max-width: 900px) {
    .nav {
        flex-direction: column;
        padding: 16px 0;
    }

    nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero-grid,
    .why-grid {
        grid-template-columns: 1fr;
    }

    .cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .cards {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: 50px 0;
    }
}

.page-section {
    padding: 70px 0;
    background: #f6f8f5;
}

.page-heading {
    max-width: 820px;
    margin-bottom: 36px;
}

.page-heading h1 {
    font-size: clamp(34px, 5vw, 54px);
    line-height: 1.1;
    margin: 14px 0 16px;
    color: #111827;
}

.page-heading p {
    font-size: 18px;
    line-height: 1.7;
    color: #4b5563;
}

.calculator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    align-items: stretch;
}

.calc-box,
.result-box,
.info-panel {
    background: #ffffff;
    border-radius: 26px;
    padding: 32px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .08);
    border: 1px solid #e5e7eb;
}

.calc-box h2,
.result-box h2,
.info-panel h2 {
    margin-top: 0;
    color: #111827;
}

.calc-form {
    display: grid;
    gap: 18px;
}

.calc-form label {
    display: grid;
    gap: 8px;
    font-weight: 800;
    color: #374151;
}

.calc-form input,
.calc-form select {
    width: 100%;
    padding: 15px 16px;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    font-size: 17px;
    outline: none;
    background: #f9fafb;
}

.calc-form input:focus,
.calc-form select:focus {
    border-color: #1f7a4d;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(31, 122, 77, .10);
}

.result-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.result-number {
    font-size: 76px;
    font-weight: 900;
    line-height: 1;
    color: #1f7a4d;
}

.result-label {
    font-size: 26px;
    font-weight: 900;
    margin-top: 12px;
    color: #111827;
}

.result-box p {
    font-size: 17px;
    color: #4b5563;
    line-height: 1.7;
}

.ideal-box {
    margin-top: 22px;
    padding: 18px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 18px;
}

.ideal-box strong,
.ideal-box span {
    display: block;
}

.ideal-box span {
    margin-top: 8px;
    font-size: 22px;
    font-weight: 900;
    color: #166534;
}

.bmi-table {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.bmi-table div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    background: #f9fafb;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
}

.small-note {
    margin-top: 20px;
    color: #6b7280;
    font-size: 14px;
}

.bmi-low .result-number { color: #2563eb; }
.bmi-normal .result-number { color: #16a34a; }
.bmi-over .result-number { color: #f59e0b; }
.bmi-obese .result-number { color: #f97316; }
.bmi-danger .result-number { color: #dc2626; }

@media (max-width: 850px) {
    .calculator-grid {
        grid-template-columns: 1fr;
    }

    .result-number {
        font-size: 58px;
    }

    .bmi-table div {
        flex-direction: column;
    }
}

.macro-results {
    display: grid;
    gap: 14px;
    margin-top: 28px;
}

.macro-results div {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 18px;
}

.macro-results strong {
    display: block;
    color: #374151;
    margin-bottom: 8px;
}

.macro-results span {
    display: block;
    font-size: 26px;
    font-weight: 900;
    color: #1f7a4d;
}

.footer-disclaimer {
    max-width: 850px;
    margin: 0 auto 12px;
    color: #cbd5e1;
    font-size: 13px;
    line-height: 1.6;
}

.logo-link{
    text-decoration:none;
}

.logo-link {
    text-decoration: none;
}

.food-search-box {
    margin-bottom: 24px;
}

.food-search-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.food-search-form input {
    flex: 1;
    min-width: 260px;
    padding: 15px 16px;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    font-size: 17px;
    outline: none;
    background: #f9fafb;
}

.food-search-form input:focus {
    border-color: #1f7a4d;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(31, 122, 77, .10);
}

.foods-summary {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.foods-summary div {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 16px 20px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
}

.foods-summary strong,
.foods-summary span {
    display: block;
}

.foods-summary strong {
    font-size: 24px;
    color: #1f7a4d;
}

.foods-summary span {
    color: #6b7280;
    font-size: 14px;
}

.foods-table-wrap {
    background: #ffffff;
    border-radius: 26px;
    overflow: hidden;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .08);
    border: 1px solid #e5e7eb;
}

.foods-table {
    width: 100%;
    border-collapse: collapse;
}

.foods-table th {
    background: #f0fdf4;
    color: #166534;
    text-align: left;
    padding: 16px;
    font-size: 14px;
}

.foods-table td {
    padding: 16px;
    border-top: 1px solid #e5e7eb;
    color: #374151;
}

.foods-table tbody tr:hover {
    background: #f9fafb;
}

.empty-box {
    padding: 30px;
    text-align: center;
    color: #6b7280;
}

.pagination {
    margin-top: 26px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    padding: 12px 16px;
    border-radius: 14px;
    font-weight: 700;
}

.pagination a {
    color: #1f7a4d;
}

@media (max-width: 760px) {
    .foods-table-wrap {
        overflow-x: auto;
    }

    .foods-table {
        min-width: 720px;
    }
}

.foods-note{
    background:#fff7ed;
    border:1px solid #fed7aa;
    color:#9a3412;
    padding:14px 18px;
    border-radius:14px;
    margin-bottom:20px;
    font-weight:600;
}

.source-pill {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 12px;
    font-weight: 800;
}

.food-link{
    color:#166534;
    text-decoration:none;
}

.food-link:hover{
    text-decoration:underline;
}

.back-link{
    display:inline-block;
    margin-top:10px;
    color:#166534;
    font-weight:700;
    text-decoration:none;
}

.back-link:hover{
    text-decoration:underline;
}

.recipe-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(280px,1fr));
    gap:24px;
}

.recipe-card{
    background:#fff;
    border-radius:22px;
    padding:24px;
    box-shadow:0 12px 35px rgba(0,0,0,.08);
}

.recipe-card h3{
    margin-bottom:20px;
    color:#166534;
}

.recipe-macros{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:12px;
    margin-bottom:20px;
}

.recipe-macros div{
    background:#f8fafc;
    padding:12px;
    border-radius:12px;
    text-align:center;
}

.recipe-macros strong{
    display:block;
    font-size:20px;
}

.recipe-macros span{
    font-size:13px;
    color:#666;
}

.recipe-footer{
    display:flex;
    justify-content:space-between;
    align-items:center;
}

.food-search-form select{
    padding:15px;
    border:1px solid #d1d5db;
    border-radius:14px;
    background:#fff;
    min-width:220px;
}

.recipe-detail {
    display: grid;
    grid-template-columns: 1.3fr .7fr;
    gap: 28px;
    align-items: start;
}

.recipe-main h1 {
    font-size: clamp(34px, 5vw, 54px);
    margin: 16px 0 24px;
    color: #111827;
}

.recipe-photo {
    display: block;
    width: auto;
    max-width: 420px;
    max-height: 320px;
    object-fit: contain;
    border-radius: 22px;
    margin: 0 auto 28px;
    box-shadow: 0 14px 35px rgba(15, 23, 42, .10);
    background: #fff;
}

.recipe-side {
    display: grid;
    gap: 22px;
    position: sticky;
    top: 100px;
}

.recipe-text {
    font-size: 17px;
    line-height: 1.85;
    color: #374151;
}

.ingredients-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
}

.ingredients-list li {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
}

.ingredients-list span {
    font-weight: 700;
    color: #374151;
}

.ingredients-list strong {
    color: #166534;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .recipe-detail {
        grid-template-columns: 1fr;
    }

    .recipe-side {
        position: static;
    }
}

.nutrition-table-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.nutrition-table-box {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    overflow: hidden;
}

.nutrition-table-box h3 {
    margin: 0;
    padding: 14px 16px;
    background: #f0fdf4;
    color: #166534;
    font-size: 17px;
}

.nutrition-table {
    width: 100%;
    border-collapse: collapse;
}

.nutrition-table td {
    padding: 10px 14px;
    border-top: 1px solid #e5e7eb;
    font-size: 14px;
}

.nutrition-table td:first-child {
    color: #4b5563;
}

.nutrition-table td:last-child {
    text-align: right;
    font-weight: 800;
    color: #111827;
    white-space: nowrap;
}

@media (max-width: 760px) {
    .nutrition-table-grid {
        grid-template-columns: 1fr;
    }
}

.checkbox-line {
    display: flex !important;
    align-items: center;
    gap: 10px;
    font-weight: 800;
}

.checkbox-line input {
    width: auto !important;
}

.admin-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.admin-actions form {
    margin: 0;
}

.btn.danger {
    background: #dc2626;
    color: #fff;
    border: 0;
    cursor: pointer;
}

.footer-admin{
    color:#9ca3af;
    text-decoration:none;
    font-size:12px;
    opacity:.5;
    transition:.2s;
}

.footer-admin:hover{
    opacity:1;
}

.admin-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.admin-stat-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    padding: 28px;
    text-decoration: none;
    box-shadow: 0 14px 35px rgba(15, 23, 42, .08);
    transition: .2s ease;
}

.admin-stat-card:hover {
    transform: translateY(-4px);
}

.admin-stat-card strong {
    display: block;
    font-size: 42px;
    color: #166534;
    margin-bottom: 8px;
}

.admin-stat-card span {
    font-weight: 800;
    color: #374151;
}

.admin-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

nav a.active {
    color: #166534;
    font-weight: 900;
}

.site-footer {
    background: #0b1220;
    color: #9ca3af;
    padding: 22px 0;
    text-align: center;
}

@media (max-width: 900px) {
    .admin-dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .admin-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.admin-recipe-form {
    display: grid;
    gap: 24px;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.form-grid-5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}

.form-grid-2 label,
.form-grid-5 label,
.ingredients-admin-grid label,
.admin-recipe-form label {
    display: grid;
    gap: 8px;
    font-weight: 800;
    color: #374151;
}

.admin-recipe-form input,
.admin-recipe-form select,
.admin-recipe-form textarea {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    font-size: 15px;
    outline: none;
    background: #f9fafb;
    font-family: Arial, Helvetica, sans-serif;
}

.admin-recipe-form textarea {
    line-height: 1.6;
    resize: vertical;
}

.admin-recipe-form input:focus,
.admin-recipe-form select:focus,
.admin-recipe-form textarea:focus {
    border-color: #1f7a4d;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(31, 122, 77, .10);
}

.ingredients-admin-grid {
    display: grid;
    grid-template-columns: 1fr 180px;
    gap: 14px;
}

.admin-current-photo {
    margin-top: 18px;
}

.admin-current-photo img {
    display: block;
    max-width: 220px;
    border-radius: 16px;
    margin-top: 10px;
    border: 1px solid #e5e7eb;
}

.admin-form-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding-bottom: 30px;
}

@media (max-width: 900px) {
    .form-grid-2,
    .form-grid-5,
    .ingredients-admin-grid {
        grid-template-columns: 1fr;
    }
}

.user-messages-list {
    display: grid;
    gap: 14px;
}

.user-message-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 18px;
}

.user-message-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.user-message-head strong {
    color: #166534;
    font-size: 17px;
}

.user-message-head span {
    color: #6b7280;
    font-size: 13px;
    white-space: nowrap;
}

.user-message-card p {
    margin: 0;
    line-height: 1.7;
    color: #374151;
}

@media (max-width: 640px) {
    .user-message-head {
        flex-direction: column;
        gap: 4px;
    }
}

.diet-meal-list {
    display: grid;
    gap: 14px;
}

.diet-meal-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 18px;
}

.diet-meal-card strong,
.diet-meal-card span {
    display: block;
}

.diet-meal-card strong {
    color: #111827;
    font-size: 18px;
}

.diet-meal-card span {
    color: #6b7280;
    margin-top: 4px;
    font-size: 14px;
}

.diet-meal-card b {
    color: #166534;
    font-size: 22px;
    white-space: nowrap;
}

@media (max-width: 620px) {
    .diet-meal-card {
        flex-direction: column;
        align-items: flex-start;
    }
}
.diet-meal-list {
    display: grid;
    gap: 14px;
}

.diet-meal-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 18px 20px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .05);
}

.diet-meal-header {
    display: grid;
    grid-template-columns: 1fr 120px;
    align-items: center;
    gap: 20px;
}

.diet-meal-info strong,
.diet-meal-info small {
    display: block;
    white-space: nowrap;
}

.diet-meal-info strong {
    font-size: 18px;
    color: #111827;
}

.diet-meal-info small {
    margin-top: 4px;
    color: #6b7280;
    font-size: 13px;
}

.diet-meal-calories {
    width: 120px;
    text-align: right;
    white-space: nowrap;
    font-size: 20px;
    font-weight: 900;
    color: #166534;
}

.diet-progress {
    width: 100%;
    height: 8px;
    background: #edf2f7;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 12px;
}

.diet-progress-fill {
    display: block;
    height: 100%;
    background: #86efac;
    border-radius: 999px;
    min-width: 4px;
}

.diet-macros {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 15px;
}

.diet-macro-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 14px;
    text-align: center;
}

.diet-macro-card strong {
    display: block;
    font-size: 16px;
}

.diet-macro-card span {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #6b7280;
}

.diet-macro-card b {
    display: block;
    margin-top: 8px;
    font-size: 22px;
    color: #166534;
}

.meal-type-checks {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.meal-type-check {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    padding: 12px 10px;
    cursor: pointer;
    font-weight: 800;
    text-align: center;
}

.meal-type-check input {
    width: 16px !important;
    height: 16px;
    margin: 0;
}

.meal-type-check span {
    color: #374151;
    white-space: nowrap;
}

.meal-type-check:has(input:checked) {
    background: #f0fdf4;
    border-color: #22c55e;
}

@media (max-width: 900px) {
    .meal-type-checks {
        grid-template-columns: repeat(2, 1fr);
    }
}

.meal-suggestions {
    margin-top: 14px;
    display: grid;
    gap: 8px;
}

.meal-suggestions h4 {
    margin: 0 0 4px;
    font-size: 15px;
    color: #374151;
}

.meal-suggestion-item {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f9fafb;
    text-decoration: none;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.meal-suggestion-item:hover {
    background: #f0fdf4;
    border-color: #86efac;
}

.meal-suggestion-item span {
    font-weight: 700;
}

.meal-suggestion-item strong {
    color: #166534;
    white-space: nowrap;
}