* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: #eef5f1;
    color: #1f2937;
}

.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #0f5132, #14532d);
    color: white;
    padding: 24px;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 30px;
}

.brand-icon {
    width: 54px;
    height: 54px;
    background: rgba(255,255,255,0.15);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
}

.brand h2 {
    margin: 0;
    font-size: 24px;
}

.brand p {
    margin: 3px 0 0;
    opacity: 0.8;
    font-size: 13px;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.menu a {
    color: white;
    text-decoration: none;
    padding: 13px 14px;
    border-radius: 14px;
    background: rgba(255,255,255,0.08);
    transition: 0.2s;
}

.menu a:hover {
    background: rgba(255,255,255,0.2);
    transform: translateX(4px);
}

.api-box {
    margin-top: 30px;
    padding: 14px;
    border-radius: 14px;
    background: rgba(0,0,0,0.18);
}

.api-box span {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
}

.api-box small {
    word-break: break-all;
    opacity: 0.85;
}

.content {
    margin-left: 280px;
    padding: 28px;
    width: calc(100% - 280px);
}

.topbar {
    background: white;
    border-radius: 22px;
    padding: 22px 26px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 30px rgba(15, 81, 50, 0.08);
    margin-bottom: 24px;
}

.topbar h1 {
    margin: 0;
    font-size: 28px;
}

.topbar p {
    margin: 6px 0 0;
    color: #64748b;
}

.time-card {
    background: #ecfdf5;
    padding: 13px 18px;
    border-radius: 16px;
    text-align: right;
    color: #065f46;
}

.time-card span {
    display: block;
    font-size: 12px;
}

.time-card b {
    font-size: 16px;
}

.grid {
    display: grid;
    gap: 18px;
}

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

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

.card {
    background: white;
    border-radius: 22px;
    padding: 22px;
    box-shadow: 0 10px 30px rgba(15, 81, 50, 0.08);
}

.stat {
    position: relative;
    overflow: hidden;
}

.stat:after {
    content: "";
    position: absolute;
    right: -25px;
    top: -25px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.12);
}

.stat span {
    color: #64748b;
    font-size: 14px;
}

.stat h2 {
    margin: 10px 0 0;
    font-size: 32px;
}

.stat small {
    display: block;
    margin-top: 8px;
    color: #94a3b8;
}

.section-title {
    margin: 30px 0 14px;
    font-size: 20px;
}

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

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

th {
    text-align: left;
    background: #f8fafc;
    color: #475569;
    padding: 13px;
    font-size: 13px;
}

td {
    padding: 13px;
    border-top: 1px solid #e2e8f0;
}

tr:hover td {
    background: #f8fafc;
}

.badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.btn {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 12px;
    background: #16a34a;
    color: white;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

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

.btn-danger {
    background: #dc2626;
}

.btn-danger:hover {
    background: #b91c1c;
}

.form-control {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    outline: none;
}

.form-control:focus {
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.full {
    grid-column: 1 / -1;
}

.alert-item {
    padding: 14px;
    border-radius: 14px;
    background: #fff7ed;
    border-left: 5px solid #f97316;
    margin-bottom: 10px;
}

.batch-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 150px;
}

.checkbox-control {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    font-size: 13px;
    color: #475569;
}

.checkbox-control input {
    width: 16px;
    height: 16px;
}

.expired-row td {
    background: #fff7ed;
}

.qr-box {
    text-align: center;
}

.qr-box img {
    width: 190px;
    height: 190px;
    border: 10px solid white;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}

.trace-page {
    max-width: 920px;
    margin: 30px auto;
    padding: 0 16px;
}

.trace-hero {
    background: linear-gradient(135deg, #16a34a, #065f46);
    color: white;
    border-radius: 26px;
    padding: 30px;
    margin-bottom: 20px;
}

.trace-hero h1 {
    margin: 0;
    font-size: 30px;
}

.trace-hero p {
    opacity: 0.9;
}

@media (max-width: 900px) {
    .sidebar {
        position: static;
        width: 100%;
    }

    .app {
        display: block;
    }

    .content {
        margin-left: 0;
        width: 100%;
    }

    .grid-4,
    .grid-3,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        display: block;
    }

    .time-card {
        margin-top: 12px;
        text-align: left;
    }
}
