* { box-sizing: border-box; }
html, body {
    margin: 0;
    padding: 0;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: #f8f9fa;
    color: #212529;
}

.loading {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
}

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.card {
    width: 100%;
    max-width: 400px;
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.card h2 {
    margin: 0 0 30px;
    text-align: center;
    color: #333;
    font-size: 24px;
}
.sub { margin: -20px 0 20px; color: #666; text-align: center; font-size: 13px; }

label {
    display: block;
    margin: 0 0 8px;
    color: #555;
    font-weight: 500;
}

input, select, textarea, button { font-size: 14px; }
input, select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    transition: border-color .3s;
}
input:focus, select:focus, textarea:focus {
    outline: 0;
    border-color: #667eea;
    box-shadow: none;
}

button {
    padding: 8px 16px;
    border: 0;
    border-radius: 4px;
    background: #007bff;
    color: #fff;
    cursor: pointer;
    font-weight: 500;
}
button:hover { background: #0056b3; }
button:disabled { opacity: .55; cursor: not-allowed; }
button.secondary { background: #6c757d; color: white; }
button.secondary:hover { background: #5a6268; }
button.danger { background: #dc3545; }
button.danger:hover { background: #c82333; }

.table-action-btn {
    padding: 2px 8px;
    font-size: 12px;
    line-height: 1.2;
}
.table-action-btn.action-addtime { background: #0d6efd; color: #fff; }
.table-action-btn.action-addtime:hover { background: #0b5ed7; }
.table-action-btn.action-disable { background: #fd7e14; color: #fff; }
.table-action-btn.action-disable:hover { background: #e56b06; }
.table-action-btn.action-restore { background: #198754; color: #fff; }
.table-action-btn.action-restore:hover { background: #157347; }
.table-action-btn.action-delete { background: #dc3545; color: #fff; }
.table-action-btn.action-delete:hover { background: #c82333; }

.remember-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 25px;
    color: #555;
}
.remember-row input { width: auto; margin: 0; }

.msg {
    min-height: 20px;
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 4px;
    margin-top: 12px;
    text-align: center;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #343a40;
    color: white;
    border-bottom: 1px solid #2e353b;
    position: sticky;
    top: 0;
    z-index: 3;
}
.topbar h2 { margin: 0; font-size: 20px; color: white; }
.build-tag { color: #adb5bd; font-size: 12px; margin-left: auto; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.whoami { color: #ced4da; font-size: 13px; }

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

.global-userbar {
    position: fixed;
    right: 16px;
    top: 10px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 10px;
}

.global-userbar .whoami {
    color: #f1f5f9;
}

.sidebar {
    width: 220px;
    background: #343a40;
    color: #fff;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 600;
    padding: 8px 10px 16px;
    border-bottom: 1px solid #495057;
    margin-bottom: 6px;
}

.side-link {
    background: transparent;
    border: 0;
    color: #ced4da;
    text-align: left;
    padding: 10px;
    border-radius: 4px;
}

.side-link:hover {
    background: #495057;
    color: #fff;
}

.side-link.active {
    background: #007bff;
    color: #fff;
}

.main-area {
    flex: 1;
    min-width: 0;
}

.panel {
    margin: 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 16px;
    box-shadow: none;
}

.toolbar {
    display: flex;
    gap: 8px;
    margin: 8px 0 12px;
    align-items: center;
    flex-wrap: wrap;
}
.toolbar input { max-width: 360px; }
.cards-layout { margin-bottom: 12px; }
.cards-tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}
.cards-block {
    border: 1px solid #e3e6ea;
    border-radius: 6px;
    background: #fcfcfd;
    padding: 10px;
}
.cards-block-title {
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}
.cards-toolbar { margin: 0; }
.cards-toolbar input, .cards-toolbar select { max-width: 220px; }
.codes-output {
    font-family: Consolas, "Courier New", monospace;
    background: #fff;
    min-height: 88px;
}

.grid {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
}
th, td {
    border: 1px solid #ddd;
    padding: 5px 8px;
    font-size: 13px;
    vertical-align: middle;
    line-height: 1.2;
}
th { background: #f2f2f2; text-align: left; color: #212529; }
tr:nth-child(even) td { background: #fff; }
textarea { margin: 8px 0 12px; }

.pager {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    gap: 8px;
    flex-wrap: wrap;
}
.pager-info { color: #6c757d; font-size: 13px; }
.pager-actions { display: flex; align-items: center; gap: 8px; }
.pager-actions select { width: auto; min-width: 70px; }

.mall-stack { display: flex; flex-direction: column; gap: 16px; }
.mall-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.mall-grid .mall-cell-text { width: 100%; min-width: 200px; margin: 0; font-size: 13px; resize: vertical; }
.mall-mono { font-family: Consolas, "Courier New", monospace; font-size: 12px; }
.mall-toolbar { align-items: center; }
.pickup-toolbar { flex-wrap: nowrap; }
    .pickup-toolbar input {
        flex: 1 1 auto;
        /*max-width: none;*/
        width: 120px;
        min-width: 120px;
    }
.pickup-toolbar select,
.pickup-toolbar button {
    flex: 0 0 auto;
}
.pickup-toolbar select {
    width: 120px;
    min-width: 120px;
}
.mall-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    color: #495057;
}
.mall-check input { width: auto; margin: 0; }
button.table-action-btn.danger { background: #dc3545; color: #fff; padding: 2px 8px; }
button.table-action-btn.danger:hover { background: #c82333; }

@media (max-width: 980px) {
    .cards-tools { grid-template-columns: 1fr; }
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}
