* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f4f6f8;
    color: #17202a;
    font-family: Arial, Tahoma, sans-serif;
}

a {
    color: #155ab6;
    text-decoration: none;
}

.page {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0;
}

.topbar,
.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 6px;
    font-size: 30px;
}

h2 {
    margin-bottom: 16px;
    font-size: 20px;
}

p,
.muted,
.small-url,
td span {
    color: #667085;
}

.actions,
.quick-links,
.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.quick-links {
    margin-bottom: 16px;
}

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 0;
    border-radius: 8px;
    background: #155ab6;
    color: #fff;
    padding: 10px 16px;
    font-weight: 700;
    cursor: pointer;
}

.button.secondary {
    background: #e8eef7;
    color: #17416f;
}

.button.danger {
    background: #fdecec;
    color: #b42318;
}

.panel,
.menu-card {
    background: #fff;
    border: 1px solid #dde3ea;
    border-radius: 8px;
    padding: 22px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

label {
    display: grid;
    gap: 7px;
    color: #344054;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 11px 12px;
    font: inherit;
}

textarea {
    resize: vertical;
}

.full,
.form-actions {
    grid-column: 1 / -1;
}

.alert {
    border-radius: 8px;
    margin-bottom: 16px;
    padding: 12px 14px;
    font-weight: 700;
}

.alert.success {
    background: #e7f7ed;
    color: #146c2e;
}

.alert.error {
    background: #fdecec;
    color: #b42318;
}

.menu-grid,
.detail-grid,
.stats-grid,
.content-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 16px;
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card {
    display: grid;
    gap: 8px;
    background: #fff;
    border: 1px solid #dde3ea;
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.stat-card.wide {
    grid-column: span 2;
}

.stat-card span {
    color: #667085;
    font-weight: 700;
}

.stat-card strong {
    font-size: 28px;
}

.menu-card {
    display: grid;
    gap: 8px;
    color: inherit;
}

.menu-card strong {
    font-size: 18px;
}

.sticker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
}

.sticker {
    background: #fff;
    border: 1px dashed #344054;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.sticker img {
    width: 180px;
    height: 180px;
    margin: 10px auto;
}

.sticker-title,
.asset-code {
    font-weight: 800;
}

.asset-code {
    font-size: 22px;
}

.device-name {
    margin-top: 4px;
    font-weight: 700;
}

.small-url {
    margin-top: 10px;
    overflow-wrap: anywhere;
    font-size: 11px;
}

.status {
    border-radius: 999px;
    padding: 8px 12px;
    background: #e8eef7;
    color: #17416f;
    font-weight: 800;
}

.status.repair {
    background: #fff4df;
    color: #9a5b00;
}

.status.retired {
    background: #fdecec;
    color: #b42318;
}

.detail-grid div {
    display: grid;
    gap: 4px;
}

.detail-grid span {
    color: #667085;
    font-size: 13px;
}

.detail-grid strong {
    overflow-wrap: anywhere;
}

.timeline {
    display: grid;
    gap: 12px;
}

.timeline-item {
    display: grid;
    gap: 5px;
    border-left: 4px solid #155ab6;
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px 14px;
}

.timeline-item time {
    color: #667085;
    font-size: 13px;
}

.empty-state {
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 22px;
    text-align: center;
    color: #667085;
}

.table-wrap {
    overflow-x: auto;
}

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

.row-actions form {
    margin: 0;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.login-panel {
    width: min(420px, 100%);
    display: grid;
    gap: 16px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    border-bottom: 1px solid #e4e7ec;
    padding: 12px;
    text-align: left;
    vertical-align: top;
}

th {
    color: #344054;
    font-size: 13px;
}

@media (max-width: 760px) {
    .topbar,
    .section-title {
        align-items: stretch;
        flex-direction: column;
    }

    .form-grid,
    .menu-grid,
    .detail-grid,
    .stats-grid,
    .content-grid {
        grid-template-columns: 1fr;
    }

    .stat-card.wide {
        grid-column: auto;
    }
}

@media print {
    body {
        background: #fff;
    }

    .page {
        width: 100%;
        padding: 0;
    }

    .no-print {
        display: none;
    }

    .sticker-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8mm;
    }

    .sticker {
        break-inside: avoid;
        box-shadow: none;
    }
}
