* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    background: #eef3f8;
    color: #122033;
}

.layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 320px 1fr;
}

.sidebar {
    background: #0f3f74;
    color: #ffffff;
    padding: 32px 26px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.sidebar img {
    width: 100%;
    max-height: 210px;
    object-fit: cover;
    border-radius: 18px;
    background: rgba(255,255,255,.14);
    box-shadow: 0 14px 30px rgba(0,0,0,.22);
}

.sidebar h2 {
    margin: 8px 0 0;
    font-size: 25px;
    line-height: 1.15;
}

.sidebar p {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
    color: #d9e8f7;
}

.sidebar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.home-button,
.btn,
button,
input[type=submit] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 11px 18px;
    border: 0;
    border-radius: 11px;
    background: #1d75d8;
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(29,117,216,.25);
}

.home-button:hover,
.btn:hover,
button:hover,
input[type=submit]:hover,
.site-card:hover {
    background: #0f63bf;
}

.btn.secondary {
    background: #456c94;
}

.btn.secondary:hover {
    background: #345a80;
}

.btn.danger {
    background: #b42318;
}

.btn.ok {
    background: #15803d;
}

.content {
    padding: 36px;
    overflow: auto;
}

.content h1 {
    margin: 0 0 22px;
    font-size: 38px;
    letter-spacing: -0.02em;
}

#search,
.search-input {
    width: 100%;
    max-width: 760px;
    min-height: 54px;
    margin-bottom: 24px;
    padding: 0 18px;
    border: 2px solid #c8d7e6;
    border-radius: 14px;
    background: #ffffff;
    font-size: 19px;
    outline: none;
}

#search:focus,
.search-input:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: #1d75d8;
    box-shadow: 0 0 0 4px rgba(29,117,216,.12);
}

.sites,
.grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.site-card,
.card.tile {
    min-height: 118px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 9px;
    padding: 22px;
    border-radius: 18px;
    background: #1d75d8;
    color: #ffffff;
    text-decoration: none;
    box-shadow: 0 12px 26px rgba(29,117,216,.22);
}

.site-card strong,
.card.tile h2 {
    margin: 0;
    font-size: 22px;
    line-height: 1.15;
}

.site-card span,
.card.tile .muted {
    color: #dcecff;
    font-size: 15px;
}

.card {
    background: #ffffff;
    border: 1px solid #d9e3ee;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 8px 22px rgba(15,63,116,.08);
}

.card h2,
.card h3 {
    margin-top: 0;
}

.muted {
    color: #5f7185;
}

.price {
    font-size: 22px;
    font-weight: 800;
    color: #0f3f74;
}

.product-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 14px;
    background: #dbe7f2;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 8px 22px rgba(15,63,116,.08);
}

.table th,
.table td {
    padding: 13px;
    border-bottom: 1px solid #d9e3ee;
    text-align: left;
    vertical-align: top;
}

.table th {
    background: #0f3f74;
    color: #ffffff;
}

.form-row {
    margin-bottom: 14px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    padding: 11px 12px;
    border: 2px solid #c8d7e6;
    border-radius: 11px;
    font-size: 16px;
    background: #ffffff;
}

textarea {
    min-height: 95px;
}

.notice {
    background: #e2f0ff;
    border: 1px solid #9fc8f4;
    color: #12395d;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 18px;
}

.error {
    background: #fff0f0;
    border-color: #ffb4b4;
    color: #7f1d1d;
}

.badge,
.cart-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    min-height: 26px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #ffffff;
    color: #0f3f74;
    font-weight: 800;
}

.actions,
.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.admin-nav {
    margin-bottom: 20px;
}

.stock-low {
    color: #b42318;
    font-weight: 800;
}

@media (max-width: 1180px) {
    .sites,
    .grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .layout {
        grid-template-columns: 1fr;
    }
    .sidebar {
        border-radius: 0 0 22px 22px;
    }
    .sidebar img {
        max-width: 300px;
    }
    .content {
        padding: 24px;
    }
}

@media (max-width: 700px) {
    .sites,
    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .content h1 {
        font-size: 31px;
    }
    .table {
        font-size: 14px;
    }
}

@media (max-width: 460px) {
    .sites,
    .grid {
        grid-template-columns: 1fr;
    }
    .content {
        padding: 18px;
    }
}
