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

body {
    font-family: "Segoe UI", Arial, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    color: #1f2937;
}

a {
    color: inherit;
}

/* ---------- Navbar ---------- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 32px;
    background: #1e3c72;
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    font-weight: bold;
    text-decoration: none;
}

.logo-img {
    width: 40px;
    height: 40px;
    padding: 3px;
    border-radius: 8px;
    background: #fff;
    object-fit: contain;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
}

.nav-links a {
    display: block;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.2s;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.15);
}

.nav-links a.active {
    background: #ffffff;
    color: #1e3c72;
    font-weight: bold;
}

.badge {
    display: inline-block;
    min-width: 22px;
    padding: 1px 6px;
    margin-left: 4px;
    border-radius: 11px;
    background: #ffb300;
    color: #1e3c72;
    font-size: 0.8rem;
    font-weight: bold;
    text-align: center;
}

/* ---------- Layout ---------- */
.content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 16px;
}

h1 {
    font-size: 2rem;
    margin-bottom: 20px;
}

h2 {
    font-size: 1.3rem;
    margin: 24px 0 12px;
}

.panel h2 {
    margin-top: 0;
}

.panel {
    background: #ffffff;
    color: #1f2937;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e3e8f0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
    overflow-x: auto;
}

.muted {
    color: #8a94a6;
}

.warn {
    color: #d93025;
    font-size: 0.9rem;
}

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

.back {
    display: inline-block;
    margin-bottom: 16px;
    text-decoration: none;
    opacity: 0.85;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.toolbar h1 {
    margin: 0;
}

/* ---------- Forms & buttons ---------- */
input,
select,
textarea {
    font: inherit;
    padding: 8px 12px;
    border: 1px solid #cfd6e4;
    border-radius: 6px;
    background: #ffffff;
    color: #1f2937;
}

#search {
    width: min(320px, 100%);
}

.qty,
#qty {
    width: 80px;
}

.form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0 16px;
}

/* Class day checkboxes on the admin page */
.days {
    margin-bottom: 14px;
    font-weight: 600;
    font-size: 0.9rem;
}

.form .days label {
    display: inline;
    margin: 4px 8px 0 0;
    font-weight: normal;
}

.btn {
    display: inline-block;
    padding: 9px 18px;
    border: none;
    border-radius: 6px;
    background: #2a5298;
    color: #ffffff;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
}

.btn:hover {
    background: #1e3c72;
}

.btn:disabled {
    background: #b8c0cf;
    cursor: not-allowed;
}

.btn.secondary {
    background: #e6ebf5;
    color: #1e3c72;
}

.btn.danger {
    background: #d93025;
}

.btn.danger:hover {
    background: #a52714;
}

.btn.small {
    padding: 5px 12px;
    font-size: 0.85rem;
}

/* ---------- Product grid ---------- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    color: #1f2937;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e3e8f0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-4px);
}

.card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px 16px;
    flex: 1;
}

.card-body .btn {
    margin-top: auto;
}

.card-title {
    font-weight: 600;
    text-decoration: none;
}

.price {
    color: #2a5298;
    font-weight: bold;
}

.price.big {
    font-size: 1.6rem;
    margin-bottom: 12px;
}

.thumb {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.thumb.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #dfe7f7, #b9c9ea);
    color: #2a5298;
    font-size: 3rem;
    font-weight: bold;
}

.thumb.large {
    border-radius: 10px;
}

.thumb.preview {
    width: 160px;
    margin-bottom: 14px;
    border-radius: 8px;
    border: 1px solid #e3e8f0;
}

.thumb.preview[hidden] {
    display: none;
}

.thumb.tiny {
    width: 44px;
    border-radius: 6px;
    font-size: 1.1rem;
}

.detail {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 28px;
    align-items: start;
}

.detail h1 {
    margin-bottom: 8px;
}

.detail p {
    margin-bottom: 14px;
    line-height: 1.5;
}

/* ---------- Tables, cart, orders ---------- */
table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid #edf0f5;
    vertical-align: middle;
}

th {
    font-size: 0.85rem;
    color: #8a94a6;
    text-transform: uppercase;
}

td a {
    text-decoration: none;
    font-weight: 600;
}

.actions {
    white-space: nowrap;
    text-align: right;
}

.total {
    margin-top: 14px;
    text-align: right;
    font-size: 1.2rem;
    font-weight: bold;
}

.order-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.items {
    list-style: none;
    border-top: 1px solid #edf0f5;
}

.items li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #edf0f5;
}

.status {
    font-weight: 600;
    text-transform: capitalize;
}

.status.pending   { background: #fff4d6; }
.status.shipped   { background: #dbe8ff; }
.status.delivered { background: #dcf5e3; }
.status.cancelled { background: #fde0dd; }

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 22px;
    border-radius: 8px;
    background: #1f9d55;
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    z-index: 20;
}

.toast.error {
    background: #d93025;
}
