* {
    box-sizing: border-box;
}
body {
    margin: 0;
    font-family: "Helvetica Neue", Arial, sans-serif;
    background: #f4f6f8;
    color: #333;
}
.container {
    width: min(1200px, 100%);
    margin: 0 auto;
    padding: 16px;
}
.site-header {
    background: #1b3a8a;
    color: #fff;
    padding: 12px 0;
}
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
}
.brand-area {
    display: flex;
    align-items: center;
    gap: 10px;
}
.brand-logo {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    flex-shrink: 0;
}
.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}
.brand-org {
    font-size: 13px;
    color: rgba(255,255,255,0.78);
    font-weight: 500;
}
.brand-sys {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}
.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
    font-size: 13px;
}
.user-mystats {
    color: #fff !important;
    text-decoration: none !important;
    padding: 3px 12px;
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    transition: background .15s;
}
.user-mystats:hover {
    background: rgba(255,255,255,0.15);
}
.user-guest-badge {
    padding: 2px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(255,255,255,0.15);
    color: #fbbf24;
}
.user-role {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.85);
}
.user-name {
    font-weight: 600;
    color: #fff;
}
.user-logout {
    color: rgba(255,255,255,0.7) !important;
    text-decoration: none !important;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
}
.user-logout:hover {
    background: rgba(255,255,255,0.1);
    color: #fff !important;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, #1b3a8a 0%, #102764 100%);
}
.login-box {
    width: min(420px, 90%);
    padding: 36px 32px 28px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,.12);
}
.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-bottom: 20px;
    text-align: center;
}
.login-logo {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    margin-bottom: 6px;
}
.login-org {
    font-size: 15px;
    color: #475569;
    font-weight: 500;
}
.login-sys {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
}
.login-title {
    font-size: 16px;
    font-weight: 600;
    color: #334155;
    margin: 0 0 4px !important;
}
.login-footer {
    text-align: center;
    font-size: 12px;
    color: #94a3b8;
    margin: 20px 0 0;
}
.pwd-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.pwd-wrapper input {
    width: 100%;
    padding-right: 36px;
    box-sizing: border-box;
}
.pwd-toggle {
    position: absolute;
    right: 10px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    user-select: none;
    opacity: .6;
}
.pwd-toggle:hover {
    opacity: 1;
}
.login-box label {
    display: block;
    margin-top: 16px;
    margin-bottom: 8px;
    font-weight: 600;
}
.login-box input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
}
.login-box button {
    width: 100%;
    margin-top: 24px;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: #1b3a8a;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
}
.alert-error {
    padding: 12px;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    color: #b91c1c;
}
.alert-success {
    padding: 12px;
    background: #dcfce7;
    border: 1px solid #86efac;
    border-radius: 8px;
    color: #047857;
}
.pagination {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    justify-content: center;
}
.pagination .active {
    background: #2563eb;
}
.page-section {
    padding: 24px 0;
}
.page-title {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}
.page-title h2 {
    margin: 0;
}
.breadcrumb {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 8px;
    padding: 8px 0 0;
}
.breadcrumb a {
    color: #1b3a8a;
    text-decoration: none;
}
.breadcrumb a:hover {
    text-decoration: underline;
}
.breadcrumb .sep {
    margin: 0 6px;
    color: #94a3b8;
}
.button {
    display: inline-block;
    padding: 10px 18px;
    background: #1b3a8a;
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
}
.button.small {
    padding: 8px 14px;
    font-size: 0.9rem;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
}
.data-table th,
.data-table td {
    padding: 14px 18px;
    border-bottom: 1px solid #eceff6;
}
.data-table th {
    background: #f1f5f9;
    text-align: left;
}
.data-table tr:last-child td {
    border-bottom: none;
}

/* ===== Card-based room layout ===== */
.summary-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 20px 36px;
    background: #fff;
    padding: 18px 24px;
    border-radius: 14px;
    margin-top: 18px;
    box-shadow: 0 4px 12px rgba(15,23,42,.04);
}
.summary-item {
    font-size: 14px;
    color: #475569;
}
.summary-num {
    font-size: 22px;
    font-weight: 700;
    margin-right: 4px;
}
.summary-link {
    text-decoration: none;
    cursor: pointer;
    transition: transform .15s, opacity .15s;
    border-radius: 8px;
    padding: 2px 8px;
    margin: -2px -8px;
}
.summary-link:hover {
    transform: translateY(-1px);
    opacity: .8;
}
.floor-group {
    margin-top: 28px;
}
.floor-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
    color: #1e293b;
}
.room-cards {
    display: grid;
    gap: 14px;
}
.room-card {
    background: #fff;
    border-radius: 14px;
    padding: 20px 22px;
    box-shadow: 0 4px 14px rgba(15,23,42,.05);
    border: 1px solid #f1f5f9;
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.card-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.room-name {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
}
.room-code {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}
.card-rate {
    font-size: 20px;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 8px;
}
.card-rate.progress-low { color: #15803d; background: #dcfce7; }
.card-rate.progress-medium { color: #1d4ed8; background: #dbeafe; }
.card-rate.progress-high { color: #b45309; background: #fef3c7; }
.card-rate.progress-full { color: #b91c1c; background: #fee2e2; }

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .3px;
}
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-green { background: #dcfce7; color: #15803d; }
.badge-purple { background: #f3e8ff; color: #7c3aed; }
.badge-slate { background: #f1f5f9; color: #475569; }
.badge-orange { background: #fed7aa; color: #c2410c; }
.badge-pink { background: #fce7f3; color: #be185d; }
.badge-gray { background: #f3f4f6; color: #6b7280; }

/* Card body - occupancy */
.card-body {
    margin-bottom: 10px;
}
.occ-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
}
.occ-numbers {
    font-size: 15px;
}
.occ-numbers strong {
    font-size: 20px;
}
.occ-label {
    font-size: 13px;
    color: #64748b;
}
.occ-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-top: 8px;
    font-size: 13px;
}
.stat-free { color: #15803d; }
.stat-occ { color: #1d4ed8; }
.stat-reserved { color: #b45309; }
.stat-dirty { color: #c2410c; }
.stat-disabled { color: #94a3b8; }

/* Room project leaders */
.room-leaders {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.room-leaders-empty {
    opacity: .55;
}
.rl-label {
    font-size: 13px;
    color: #64748b;
    flex-shrink: 0;
}
.rl-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.rl-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border: 1px solid #dbe4f0;
    border-radius: 12px;
    background: #f4f7fb;
    color: #334155;
    font-size: 13px;
    cursor: default;
    transition: background .15s, border-color .15s;
}
.rl-chip:hover {
    background: #eaf1ff;
    border-color: #aac3f5;
}
.rl-count {
    color: #1d4ed8;
    font-weight: 600;
}
.rl-chip-more {
    color: #1d4ed8;
    cursor: pointer;
    border-color: #bfdbfe;
    background: #f8faff;
}
.rl-chip-more:hover {
    background: #dbeafe;
}
.rl-empty {
    font-size: 13px;
    color: #94a3b8;
}

/* Description */
.card-desc {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 12px;
    line-height: 1.5;
}

/* Actions */
.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.button.outline {
    background: transparent;
    border: 1px solid #cbd5e1;
    color: #334155;
}
.button.outline:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}
.danger-text {
    color: #b91c1c !important;
    border-color: #fca5a5 !important;
}
.danger-text:hover {
    background: #fee2e2 !important;
    border-color: #b91c1c !important;
}

/* Collapsible rack detail */
.rack-detail {
    display: none;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #f1f5f9;
}
.rack-detail.open {
    display: block;
}
.rack-mini-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
}
.rack-mini-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    text-decoration: none;
    color: #1e293b;
    transition: border-color .15s;
}
.rack-mini-card:hover {
    border-color: #93c5fd;
}
.rmc-code {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}
.rmc-nums {
    font-size: 14px;
    font-weight: 700;
}
.rmc-bar {
    height: 5px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}
.rmc-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
}

/* Progress bar (shared) */
.progress {
    width: 100%;
    height: 10px;
    overflow: hidden;
    background: #e5e7eb;
    border-radius: 999px;
}
.progress-bar {
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s ease;
}
.progress-segment {
    height: 100%;
    float: left;
    transition: width 0.3s ease;
}
.progress-seg-occ { background: #2563eb; }
.progress-seg-res { background: #d97706; }
.progress-seg-dirty { background: #ea580c; }
.progress-low { background: #22c55e; }
.progress-medium { background: #3b82f6; }
.progress-high { background: #f59e0b; }
.progress-full { background: #ef4444; }

/* ===== Rack list occupancy ===== */
.rack-spec strong {
    display: block;
    font-size: 14px;
}
.rack-spec small {
    display: block;
    margin-top: 3px;
    color: #64748b;
    font-size: 12px;
}
.rack-usage-cell {
    min-width: 220px;
}
.rack-usage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 14px;
}
.rack-usage-header strong {
    color: #0f172a;
}
.rack-usage-percent {
    font-weight: 700;
    color: #334155;
}
.rack-progress {
    width: 100%;
    height: 9px;
    overflow: hidden;
    background: #e5e7eb;
    border-radius: 999px;
}
.rack-progress-bar {
    height: 100%;
    border-radius: inherit;
    transition: width 0.25s ease;
}
.rack-usage-detail {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 6px;
    color: #64748b;
    font-size: 12px;
}
.btn-view-rack {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 14px;
    color: #1e40af;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 7px;
    white-space: nowrap;
}
.btn-view-rack:hover {
    color: #fff;
    background: #1e40af;
    border-color: #1e40af;
}
.rack-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}
.btn-rack-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    color: #b91c1c;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 7px;
    white-space: nowrap;
    cursor: pointer;
}
.btn-rack-delete:hover {
    color: #fff;
    background: #dc2626;
    border-color: #dc2626;
}

/* ===== Rack summary card ===== */
.rack-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 16px;
    padding: 18px 22px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
}
.rack-summary-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: #0f172a;
}
.rack-summary-sub {
    font-size: 13px;
    color: #64748b;
    margin-top: 2px;
    display: block;
}
.rack-summary-stats {
    display: flex;
    align-items: center;
    gap: 16px 22px;
    flex-wrap: wrap;
}
.rs-item {
    font-size: 12px;
    color: #64748b;
    text-align: center;
}
.rs-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
}
.rs-occ .rs-num { color: #2563eb; }
.rs-free .rs-num { color: #16a34a; }
.rs-dirty .rs-num { color: #ea580c; }
.rs-dis .rs-num { color: #94a3b8; }
.rs-rate {
    display: flex;
    align-items: center;
    gap: 10px;
}
.rs-rate-pct {
    font-size: 18px;
    font-weight: 800;
    padding: 2px 10px;
    border-radius: 6px;
}
.rs-rate-pct.progress-low { color: #15803d; background: #dcfce7; }
.rs-rate-pct.progress-medium { color: #1d4ed8; background: #dbeafe; }
.rs-rate-pct.progress-high { color: #b45309; background: #fef3c7; }
.rs-rate-pct.progress-full { color: #b91c1c; background: #fee2e2; }

/* ===== Cage layout (row-based, left-border cards) ===== */
.cage-layout {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.cage-row {
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 12px;
    align-items: stretch;
}
.cage-layer-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 8px;
    min-height: 90px;
    gap: 2px;
}
.layer-checkbox {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
    cursor: pointer;
}
.layer-checkbox input {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #3b82f6;
}
.layer-num {
    font-weight: 700;
    font-size: 15px;
    color: #334155;
}
.layer-sub {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 2px;
}
.cage-row-cells {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
}
.cage-cell {
    display: flex;
    flex-direction: column;
    padding: 10px 12px;
    min-height: 88px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left: 5px solid #94a3b8;
    cursor: pointer;
    transition: box-shadow .15s, border-color .15s;
    position: relative;
    color: #0f172a;
}
.cage-cell:hover {
    box-shadow: 0 2px 8px rgba(15,23,42,.08);
    border-color: #cbd5e1;
}
.cage-cell.selected {
    border-color: #2563eb !important;
    border-left-color: #2563eb !important;
    box-shadow: 0 0 0 2px rgba(37,99,235,.2);
}
.cage-checkbox {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #2563eb;
    margin: 0;
    z-index: 2;
}
/* Left border colors */
.card-occupied { border-left-color: #2563eb; }
.card-free { border-left-color: #16a34a; }
.card-dirty { border-left-color: #ea580c; }
.card-disabled { border-left-color: #94a3b8; background: #f8fafc; }
.card-reserved { border-left-color: #d97706; }

.cc-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.cc-label {
    font-weight: 700;
    font-size: 14px;
}
.cc-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.cc-dot-occ { background: #2563eb; }
.cc-dot-free { background: #16a34a; }
.cc-dot-dirty { background: #ea580c; }
.cc-dot-dis { background: #94a3b8; }
.cc-status {
    font-size: 13px;
    font-weight: 600;
}
.cc-info {
    font-size: 11px;
    color: #64748b;
    margin-top: 4px;
    word-break: break-all;
}
.cc-detail {
    font-size: 11px;
    color: #475569;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cc-meta {
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.cc-meta-line {
    font-size: 11px;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}
.cc-meta-op {
    font-size: 10px;
    color: #94a3b8;
}

/* Card status (occupied) extra */
.card-occupied .cc-status { color: #2563eb; }
.card-free .cc-status { color: #16a34a; }
.card-dirty .cc-status { color: #ea580c; }
.card-disabled .cc-status { color: #94a3b8; }
.card-reserved .cc-status { color: #d97706; }

/* ===== Batch toolbar ===== */
.batch-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
    padding: 12px 18px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}
.batch-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}
.batch-toggle input {
    width: 18px;
    height: 18px;
    accent-color: #1b3a8a;
}
.batch-count {
    font-size: 13px;
    color: #64748b;
    min-width: 50px;
}
.batch-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.btn-batch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, border-color .15s;
    height: 36px;
}
.btn-batch:disabled {
    opacity: .4;
    cursor: default;
}
.btn-batch-primary {
    background: #047857;
    color: #fff;
    border-color: #047857;
}
.btn-batch-primary:hover:not(:disabled) {
    background: #065f46;
}
.btn-batch-ambert {
    background: #d97706;
    color: #fff;
    border-color: #d97706;
}
.btn-batch-ambert:hover:not(:disabled) {
    background: #b45309;
}
.btn-batch-info {
    background: #1d4ed8;
    color: #fff;
    border-color: #1d4ed8;
}
.btn-batch-info:hover:not(:disabled) {
    background: #1e40af;
}
.btn-batch-warning {
    background: #ea580c;
    color: #fff;
    border-color: #ea580c;
}
.btn-batch-warning:hover:not(:disabled) {
    background: #c2410c;
}
.btn-batch-danger {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}
.btn-batch-danger:hover:not(:disabled) {
    background: #b91c1c;
}
.btn-batch-outline {
    background: #fff;
    color: #334155;
    border-color: #cbd5e1;
}
.btn-batch-outline:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #94a3b8;
}

/* ===== Batch form grid (modal) ===== */
.batch-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
    width: 100%;
    box-sizing: border-box;
}
.bf-item {
    display: flex;
    flex-direction: column;
}
.bf-item label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 13px;
    color: #334155;
}
.bf-item input,
.bf-item select {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    height: 38px;
    box-sizing: border-box;
}
.bf-wide {
    grid-column: span 2;
}
.bf-item .req { color: #dc2626; }

/* Old status classes kept for backward compat */
.status-free, .status-occupied, .status-reserved, .status-dirty, .status-disabled, .status-unknown { }

/* ===== Cage detail page redesign ===== */
.cd-page {
    max-width: 1100px;
}
.cd-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.cd-header-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.cd-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: #0f172a;
}
.cd-sub {
    font-size: 13px;
    color: #64748b;
}
.cd-box-code {
    font-size: 12px;
    color: #94a3b8;
    font-family: Consolas, monospace;
    margin-top: 2px;
}
.cd-header-right {
    flex-shrink: 0;
}
.cd-status-tag {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}
.cd-st-occupied { background: #dbeafe; color: #1d4ed8; }
.cd-st-free { background: #dcfce7; color: #15803d; }
.cd-st-dirty { background: #fed7aa; color: #c2410c; }
.cd-st-disabled { background: #f1f5f9; color: #64748b; }
.cd-st-reserved { background: #fef3c7; color: #b45309; }

.cd-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
    padding: 12px 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}
.cd-summary-left {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 14px;
    color: #334155;
}
.cd-summary-animal { font-weight: 700; }
.cd-summary-dot { color: #cbd5e1; }
.cd-summary-sex, .cd-summary-qty { color: #475569; }
.cd-summary-right { flex-shrink: 0; }

.cd-rem-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    background: #f1f5f9;
    color: #475569;
    white-space: nowrap;
}
.cd-rem-over { background: #fee2e2; color: #b91c1c; }
.cd-rem-today { background: #fecaca; color: #dc2626; }
.cd-rem-soon { background: #fed7aa; color: #c2410c; }
.cd-rem-na { background: #f3e8ff; color: #7c3aed; }

.cd-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}
.cd-left, .cd-right {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.cd-section {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px 20px;
}
.cd-section-title {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
}
.cd-section-title-warn {
    color: #b45309;
}
.cd-dl {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 6px 12px;
    margin: 0;
    font-size: 13px;
}
.cd-dl dt {
    color: #64748b;
    font-weight: 500;
}
.cd-dl dd {
    margin: 0;
    color: #0f172a;
}
.cd-overdue-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background: #fee2e2;
    color: #b91c1c;
}
.cd-expiry-actions {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}

.cd-empty {
    margin-top: 16px;
    padding: 40px;
    text-align: center;
    color: #94a3b8;
    background: #fff;
    border: 1px dashed #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
}

.cd-section-logs {
    margin-top: 14px;
}
.cd-logs {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.cd-log-item {
    display: flex;
    gap: 10px;
    font-size: 13px;
    color: #475569;
    padding: 6px 0;
    border-bottom: 1px solid #f8fafc;
}
.cd-log-item:last-child { border-bottom: none; }
.cd-log-time {
    color: #94a3b8;
    font-size: 12px;
    white-space: nowrap;
    width: 140px;
    flex-shrink: 0;
}
.cd-log-user {
    font-weight: 600;
    width: 60px;
    flex-shrink: 0;
}
.cd-log-action {
    color: #64748b;
}

.cd-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
    justify-content: center;
}
.cd-btn-checkout {
    background: #ea580c !important;
    border-color: #ea580c !important;
}
.cd-btn-checkout:hover {
    background: #c2410c !important;
    border-color: #c2410c !important;
}

@media (max-width: 700px) {
    .cd-main { grid-template-columns: 1fr; }
}

.dimmed {
    color: #94a3b8;
    font-size: 0.9rem;
}

/* ===== Tabs ===== */
.tabs {
    display: flex;
    gap: 4px;
    margin-top: 18px;
    border-bottom: 2px solid #e2e8f0;
}
.tab {
    padding: 10px 20px;
    text-decoration: none;
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color .15s, border-color .15s;
}
.tab:hover { color: #1e293b; }
.tab-active {
    color: #1b3a8a;
    border-bottom-color: #1b3a8a;
}

/* ===== Project actions ===== */
.project-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}
.btn-action {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    color: #1e40af;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
}
.btn-action:hover {
    color: #fff;
    background: #1e40af;
    border-color: #1e40af;
}
.btn-archive {
    color: #b45309;
    background: #fef3c7;
    border-color: #fde68a;
}
.btn-archive:hover {
    color: #fff;
    background: #d97706;
    border-color: #d97706;
}

/* ===== Danger zone ===== */
.danger-zone {
    margin-top: 32px;
    padding: 20px;
    border: 2px solid #fecaca;
    border-radius: 12px;
    background: #fff;
}
.danger-zone h3 {
    margin: 0 0 14px;
    color: #b91c1c;
    font-size: 16px;
}
.danger-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 0;
    border-top: 1px solid #f1f5f9;
    flex-wrap: wrap;
}
.danger-item:first-of-type {
    border-top: none;
    padding-top: 0;
}
.danger-item strong {
    font-size: 14px;
}
.danger-item p {
    margin: 4px 0 0;
    font-size: 13px;
    color: #64748b;
}
.danger-btn {
    color: #b91c1c !important;
    border-color: #fca5a5 !important;
    background: #fee2e2 !important;
}
.danger-btn:hover {
    color: #fff !important;
    background: #dc2626 !important;
    border-color: #dc2626 !important;
}

/* ===== Modal overlay ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15,23,42,.45);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.modal-box {
    background: #fff;
    border-radius: 16px;
    padding: 28px 30px;
    width: min(480px, 90%);
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.15);
}
.modal-box h3 {
    margin: 0 0 16px;
    font-size: 17px;
}
.modal-body label {
    display: block;
    margin-top: 14px;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
    color: #334155;
}
.modal-body input,
.modal-body select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
}
.modal-body .req {
    color: #dc2626;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

.site-footer {
    background: #ffffff;
    padding: 16px 0;
    text-align: center;
}
.footer-org {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 2px;
}
.footer-sys {
    font-size: 12px;
    color: #94a3b8;
    margin: 0;
}

/* ===== Dashboard redesign ===== */
.db-page {
    padding: 20px 0;
}
.db-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}
.db-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    color: #0f172a;
}
.db-sub {
    margin: 4px 0 0;
    font-size: 14px;
    color: #64748b;
}
.db-time {
    font-size: 12px;
    color: #94a3b8;
}
.db-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}
.db-card {
    background: #fff;
    border-radius: 14px;
    padding: 16px 18px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 4px 12px rgba(15,23,42,.04);
}
.db-card-label {
    display: block;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 6px;
    font-weight: 500;
}
.db-card-num {
    display: block;
    font-size: 26px;
    font-weight: 700;
}
.db-card-total .db-card-num { color: #0f172a; }
.db-card-occ .db-card-num { color: #2563eb; }
.db-card-free .db-card-num { color: #16a34a; }
.db-card-res .db-card-num { color: #d97706; }
.db-card-dirty .db-card-num { color: #ea580c; }
.db-card-dis .db-card-num { color: #94a3b8; }
/* Clickable cards: look like entry buttons */
.db-card-link {
    text-decoration: none;
    cursor: pointer;
    display: block;
    position: relative;
    overflow: hidden;
    transition: border-color .2s, box-shadow .2s, transform .2s, background .2s;
}
.db-card-link::after {
    content: '→';
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 13px;
    color: #cbd5e1;
    transition: color .2s, transform .2s;
    line-height: 1;
}
.db-card-link:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(59,130,246,.15);
}
.db-card-link:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(59,130,246,.1);
}
.db-card-link:hover::after {
    color: #3b82f6;
    transform: translateX(3px);
}
.db-card-occ.db-card-link:hover {
    border-color: #2563eb;
    background: #f8faff;
}
.db-card-free.db-card-link:hover {
    border-color: #16a34a;
    background: #f8fef8;
}
.db-card-res.db-card-link:hover {
    border-color: #d97706;
    background: #fffdf5;
}
.db-card-dirty.db-card-link:hover {
    border-color: #ea580c;
    background: #fff8f5;
}
.db-card-dis.db-card-link:hover {
    border-color: #94a3b8;
    background: #fafbfc;
}
/* Non-clickable card (总笼位): no interactive cues */
.db-card-total {
    cursor: default;
}

/* ===== Cage list page (status filtered) ===== */
.cl-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
    margin-top: 14px;
    padding: 12px 18px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 13px;
    color: #475569;
}
.cl-summary strong { font-size: 16px; color: #0f172a; }
.cl-tabs {
    display: flex;
    gap: 6px;
    margin-top: 14px;
    flex-wrap: wrap;
}
.cl-tab {
    display: inline-block;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    color: #64748b;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: background .15s;
}
.cl-tab:hover { border-color: #93c5fd; }
.cl-tab-active {
    color: #1d4ed8;
    background: #eff6ff;
    border-color: #bfdbfe;
}
.cl-table-wrap {
    margin-top: 12px;
    overflow-x: auto;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}
.cl-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.cl-table thead th {
    background: #f8fafc;
    padding: 10px 12px;
    font-weight: 600;
    font-size: 12px;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
    text-align: left;
}
.cl-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.cl-table tbody tr:last-child td { border-bottom: none; }
.cl-table tbody tr:hover { background: #f8fafc; }
.cl-empty {
    margin-top: 14px;
    padding: 40px;
    text-align: center;
    color: #94a3b8;
    border: 1px dashed #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    background: #fff;
}
.cl-sub, .cg-info, .cg-qty {
    font-size: 11px;
    color: #94a3b8;
}

/* View toggle */
.cl-view-toggle {
    display: flex;
    gap: 4px;
    margin-top: 12px;
}
.cl-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    user-select: none;
    transition: background .15s, border-color .15s;
}
.cl-view-btn:hover { border-color: #93c5fd; }
.cl-view-active {
    color: #1d4ed8;
    background: #eff6ff;
    border-color: #bfdbfe;
}

/* Display mode bar */
.cl-display-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.cl-display-switch {
    display: flex;
    gap: 2px;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 2px;
}
.cl-mode-btn {
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    color: #64748b;
    transition: all .15s;
    user-select: none;
}
.cl-mode-btn.cl-mode-active {
    background: #fff;
    color: #1d4ed8;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.cl-proj-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}
.cl-proj-filter {
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
}
.cl-proj-config {
    font-size: 13px;
    color: #1d4ed8;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 6px;
    transition: background .15s;
}
.cl-proj-config:hover {
    background: #eff6ff;
}

/* Project legend */
.cl-legend {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 10px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    flex-wrap: wrap;
}
.cl-legend-title {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
    flex-shrink: 0;
}
.cl-legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.cl-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #475569;
}
.cl-legend-swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    display: inline-block;
    flex-shrink: 0;
}
.cl-legend-none {
    opacity: .5;
}

/* Project mode cell override */
.cg-mode-project {
    border-width: 2px !important;
    font-weight: 600;
}

/* Grid view - cinema seat style */
.cl-grid-options {
    margin-top: 12px;
    margin-bottom: 4px;
}
.cl-grid-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #64748b;
    cursor: pointer;
    user-select: none;
}
.cl-grid-toggle input {
    width: 16px;
    height: 16px;
    accent-color: #2563eb;
}

/* Floor cards with color bars */
.floor-card {
    margin-top: 20px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}
.floor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    cursor: pointer;
    user-select: none;
    transition: background .1s;
    border-bottom: 1px solid #f1f5f9;
}
.floor-header:hover {
    background: #f8fafc;
}
.floor-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.floor-color-bar {
    width: 4px;
    height: 24px;
    border-radius: 2px;
    flex-shrink: 0;
}
.floor-blue .floor-color-bar { background: #3b82f6; }
.floor-green .floor-color-bar { background: #16a34a; }
.floor-orange .floor-color-bar { background: #f59e0b; }
.floor-gray .floor-color-bar { background: #94a3b8; }

.floor-name {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
}
.floor-summary {
    font-size: 13px;
    color: #64748b;
}
.floor-summary strong {
    color: #0f172a;
}
.floor-toggle {
    font-size: 14px;
    color: #94a3b8;
    transition: transform .15s;
}
.floor-body {
    padding: 10px 18px 18px;
}
.cg-group {
    margin-top: 16px;
}
.cg-group-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}
.cg-group-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}
.cg-group-count {
    font-size: 12px;
    color: #64748b;
}
.cg-group-link {
    margin-left: auto;
    font-size: 12px;
    color: #1b3a8a;
    text-decoration: none;
    font-weight: 600;
}
.cg-group-link:hover { text-decoration: underline; }

.cg-layer-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.cg-layer-label {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 600;
    min-width: 28px;
    text-align: right;
    flex-shrink: 0;
}
.cg-side-label {
    font-size: 10px;
    color: #64748b;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
    flex-shrink: 0;
    background: #f1f5f9;
    border-radius: 4px;
    padding: 0 4px;
    line-height: 28px;
}
.cg-side-group {
    display: flex;
    align-items: center;
    gap: 6px;
}
.cg-side-tag {
    font-size: 10px;
    font-weight: 700;
    color: #3b82f6;
    background: #eff6ff;
    border-radius: 4px;
    padding: 0 5px;
    line-height: 22px;
    flex-shrink: 0;
    min-width: 16px;
    text-align: center;
}
.cg-side-divider {
    width: 1px;
    height: 28px;
    background: #e2e8f0;
    flex-shrink: 0;
    margin: 0 2px;
}
.cg-side-header {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    padding: 6px 12px;
    background: #f8fafc;
    border-radius: 6px;
    margin-bottom: 6px;
    border-left: 3px solid #3b82f6;
}
.cg-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}
.cg-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px 1px;
    min-height: 22px;
    border-radius: 3px;
    transition: transform .1s; border: 1px solid rgba(255,255,255,0.12);
    cursor: pointer;
    text-align: center;
}
.cg-cell:hover {
    transform: scale(1.4);
    z-index: 2;
    position: relative;
}
.cg-occupied {
    background: #2563eb;
    border-color: #1d4ed8;
    color: #fff;
}
.cg-free {
    background: #16a34a;
    border-color: #15803d;
    color: #fff;
}
.cg-dirty {
    background: #ea580c;
    border-color: #c2410c;
    color: #fff;
}
.cg-disabled {
    background: #94a3b8;
    border-color: #64748b;
    color: #fff;
}
.cg-reserved {
    background: #d97706;
    border-color: #b45309;
    color: #fff;
}
.cg-pos { font-size: 8px; font-weight: 600; border: none; }
.cl-code {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cl-nowrap { white-space: nowrap; }
.cl-btn {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    color: #1e40af;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    white-space: nowrap;
}
.cl-btn:hover { color: #fff; background: #1e40af; }
.cl-rem {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    background: #f1f5f9;
    color: #475569;
}
.cl-rem-over { background: #fee2e2; color: #b91c1c; }
.cl-rem-today { background: #fecaca; color: #dc2626; }
.cl-rem-soon { background: #fed7aa; color: #c2410c; }
.cl-rem-na { font-size: 12px; color: #94a3b8; }

/* Insight row */
.db-insight {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 14px;
    margin-top: 16px;
}
.db-insight-left {
    background: #fff;
    border-radius: 14px;
    padding: 18px 22px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 4px 12px rgba(15,23,42,.04);
}
.db-insight-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.db-insight-label {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}
.db-insight-pct {
    font-size: 20px;
    font-weight: 800;
    padding: 2px 12px;
    border-radius: 6px;
}
.db-insight-pct.progress-low { color: #15803d; background: #dcfce7; }
.db-insight-pct.progress-medium { color: #1d4ed8; background: #dbeafe; }
.db-insight-pct.progress-high { color: #b45309; background: #fef3c7; }
.db-insight-pct.progress-full { color: #b91c1c; background: #fee2e2; }
.db-insight-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    font-size: 13px;
    color: #64748b;
}
.db-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.db-badge-green { background: #dcfce7; color: #15803d; }
.db-badge-blue { background: #dbeafe; color: #1d4ed8; }
.db-badge-red { background: #fee2e2; color: #b91c1c; }

.db-insight-right {
    background: #fff;
    border-radius: 14px;
    padding: 18px 22px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 4px 12px rgba(15,23,42,.04);
}
.db-pending-title {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}
.db-pending-empty {
    margin: 0;
    font-size: 13px;
    color: #94a3b8;
}
.db-pending-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.db-pending-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #334155;
    padding: 6px 0;
}
.db-pending-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.dot-dirty { background: #ea580c; }
.dot-res { background: #d97706; }
.dot-dis { background: #94a3b8; }

/* Section titles */
.db-section-title {
    font-size: 17px;
    font-weight: 700;
    margin: 28px 0 14px;
    color: #1e293b;
}

/* Floor cards */
.db-floors {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.db-floor-card {
    background: #fff;
    border-radius: 14px;
    padding: 20px 22px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(15,23,42,.04);
}
.db-floor-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}
.db-floor-info {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}
.db-floor-name {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}
.db-floor-meta {
    font-size: 13px;
    color: #64748b;
}
.db-floor-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.db-fstatus {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.db-fstatus-occ { background: #dbeafe; color: #1d4ed8; }
.db-fstatus-dirty { background: #fed7aa; color: #c2410c; }
.db-fstatus-idle { background: #f1f5f9; color: #64748b; }
.db-floor-rate {
    font-size: 18px;
    font-weight: 800;
    padding: 2px 10px;
    border-radius: 6px;
}
.db-floor-rate.progress-low { color: #15803d; background: #dcfce7; }
.db-floor-rate.progress-medium { color: #1d4ed8; background: #dbeafe; }
.db-floor-rate.progress-high { color: #b45309; background: #fef3c7; }
.db-floor-rate.progress-full { color: #b91c1c; background: #fee2e2; }
.db-floor-link {
    font-size: 13px;
    color: #1b3a8a;
    text-decoration: none;
    font-weight: 600;
}
.db-floor-link:hover { text-decoration: underline; }

.db-floor-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.db-floor-progress .progress {
    flex: 1;
    height: 10px;
}
.db-floor-occnum {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
}

/* Room mini cards inside floor */
.db-floor-rooms {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}
.db-room-mini {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    text-decoration: none;
    min-width: 140px;
    flex: 1;
    transition: border-color .15s;
}
.db-room-mini:hover {
    border-color: #93c5fd;
}
.db-room-name {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}
.db-room-total {
    font-size: 12px;
    color: #64748b;
}
.db-room-occ, .db-room-free {
    font-size: 12px;
    color: #475569;
}

/* Floor status row */
.db-floor-status {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
    font-size: 13px;
    color: #475569;
}
.db-fs-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.db-fs-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Quick actions */
.db-quick {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
}
.db-quick-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 18px 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    text-decoration: none;
    transition: border-color .15s, box-shadow .15s;
    text-align: center;
}
.db-quick-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 4px 12px rgba(59,130,246,.08);
}
.db-qc-icon {
    font-size: 24px;
    line-height: 1;
}
.db-qc-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}
.db-qc-desc {
    font-size: 12px;
    color: #94a3b8;
}

@media (max-width: 700px) {
    .db-insight { grid-template-columns: 1fr; }
    .db-stats { grid-template-columns: repeat(3, 1fr); }
    .db-quick { grid-template-columns: repeat(3, 1fr); }
}

/* ===== Expiration / upcoming checkouts ===== */
.uc-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 12px;
}
.uc-card {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 14px;
    border-radius: 10px;
    text-decoration: none;
    border: 1px solid #e2e8f0;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.uc-card:hover { border-color: #93c5fd; box-shadow: 0 2px 8px rgba(59,130,246,.08); }
.uc-card-label { font-size: 11px; color: #64748b; font-weight: 500; }
.uc-card-num { font-size: 22px; font-weight: 700; }
.uc-card-sub { font-size: 11px; color: #94a3b8; }
.uc-card-overdue .uc-card-num { color: #dc2626; }
.uc-card-soon .uc-card-num { color: #ea580c; }
.uc-card-warn .uc-card-num { color: #d97706; }
.uc-card-amber .uc-card-num { color: #ca8a04; }
.uc-card-blue .uc-card-num { color: #2563eb; }
.uc-card-cyan .uc-card-num { color: #0891b2; }
.uc-card-gray .uc-card-num { color: #64748b; }
.uc-card-na .uc-card-num { color: #7c3aed; }

.uc-forecast {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 12px;
    padding: 10px 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 13px;
    color: #475569;
}
.uc-forecast-label { font-weight: 600; color: #334155; }
.uc-forecast-item strong { font-size: 15px; color: #0f172a; }
.uc-fsep { color: #cbd5e1; }

.uc-summary {
    margin-top: 14px;
    padding: 10px 16px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    font-size: 13px;
    color: #1e40af;
}
.uc-summary strong { font-weight: 700; }

.uc-toolbar {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
    align-items: center;
}
.uc-tab {
    display: inline-block;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    color: #64748b;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: background .15s, border-color .15s;
}
.uc-tab:hover { border-color: #93c5fd; }
.uc-tab-active {
    color: #1d4ed8;
    background: #eff6ff;
    border-color: #bfdbfe;
}
.uc-select, .uc-search {
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    background: #fff;
    height: 34px;
    box-sizing: border-box;
}
.uc-search { width: min(180px, 100%); }

.uc-table-wrap {
    margin-top: 14px;
    overflow-x: auto;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}
.uc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.uc-table thead th {
    background: #f8fafc;
    padding: 10px 12px;
    font-weight: 600;
    font-size: 12px;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
    text-align: left;
}
.uc-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.uc-table tbody tr:last-child td {
    border-bottom: none;
}
.uc-table tbody tr:hover {
    background: #f8fafc;
}
.uc-table tbody tr.uc-row-uc-date-over td {
    background: #fff5f5;
}
.uc-empty {
    text-align: center;
    color: #94a3b8;
    padding: 30px !important;
}
.uc-cell-nwrap {
    white-space: nowrap;
}
.uc-cell-box {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.uc-cell-sub {
    font-size: 11px;
    color: #94a3b8;
}

.uc-th-check { width: 36px; }
.uc-th-remain { width: 90px; }
.uc-th-date { width: 100px; white-space: nowrap; }
.uc-th-pos { min-width: 180px; }
.uc-th-box { min-width: 140px; }
.uc-th-animal { min-width: 100px; }
.uc-th-qty { width: 60px; }
.uc-th-op { width: 70px; }
.uc-th-proj { min-width: 100px; }
.uc-th-action { width: 60px; }

.uc-remaining {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.uc-date-over { background: #fee2e2; color: #b91c1c; }
.uc-date-today { background: #fecaca; color: #dc2626; }
.uc-date-soon { background: #fed7aa; color: #c2410c; }
.uc-date-warn { background: #fef3c7; color: #b45309; }
.uc-date-na { background: #f3e8ff; color: #7c3aed; }

.uc-checkbox, #ucCheckAll {
    width: 16px;
    height: 16px;
    accent-color: #2563eb;
    cursor: pointer;
    margin: 0;
}

.uc-btn-detail {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    color: #1e40af;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    white-space: nowrap;
    transition: background .15s;
}
.uc-btn-detail:hover {
    color: #fff;
    background: #1e40af;
    border-color: #1e40af;
}

/* Cage grid remaining days */
.cc-rem {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    text-align: center;
}
.cc-rem-over { background: #fee2e2; color: #b91c1c; }
.cc-rem-soon { background: #fed7aa; color: #c2410c; }
.cc-rem-warn { background: #fef3c7; color: #b45309; }
.cc-rem-na { background: #f3e8ff; color: #7c3aed; }

/* Dashboard expiration cards */
.uc-dash {
    margin-top: 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px 20px;
}
.uc-dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.uc-dash-title {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}
.uc-dash-link {
    font-size: 13px;
    color: #1b3a8a;
    text-decoration: none;
}
.uc-dash-link:hover { text-decoration: underline; }
.uc-dash-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.ucd-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 12px 8px;
    border-radius: 10px;
    text-decoration: none;
    border: 1px solid #f1f5f9;
    transition: border-color .15s;
}
.ucd-card:hover { border-color: #93c5fd; }
.ucd-label { font-size: 11px; color: #64748b; }
.ucd-num { font-size: 22px; font-weight: 700; }
.ucd-overdue .ucd-num { color: #dc2626; }
.ucd-soon .ucd-num { color: #ea580c; }
.ucd-warn .ucd-num { color: #d97706; }
.ucd-na .ucd-num { color: #7c3aed; }

/* ===== Room header / rack card grid ===== */
.rh-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 4px;
}
.rh-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: #0f172a;
}
.rh-sub {
    display: block;
    font-size: 13px;
    color: #64748b;
    margin-top: 2px;
}
.rh-summary {
    display: flex;
    align-items: center;
    gap: 16px 24px;
    flex-wrap: wrap;
    margin-top: 14px;
    padding: 14px 20px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}
.rhs-item {
    font-size: 12px;
    color: #64748b;
    text-align: center;
}
.rhs-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
}
.rhs-occ .rhs-num { color: #2563eb; }
.rhs-free .rhs-num { color: #16a34a; }
.rhs-dirty .rhs-num { color: #ea580c; }
.rhs-rate {}
.rhs-rate-pct {
    font-size: 18px;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 6px;
}
.rhs-rate-pct.progress-low { color: #15803d; background: #dcfce7; }
.rhs-rate-pct.progress-medium { color: #1d4ed8; background: #dbeafe; }
.rhs-rate-pct.progress-high { color: #b45309; background: #fef3c7; }
.rhs-rate-pct.progress-full { color: #b91c1c; background: #fee2e2; }

.rh-toolbar {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}
.rh-search {
    padding: 9px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    width: min(280px, 100%);
    box-sizing: border-box;
}
.rh-filter {
    padding: 9px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    box-sizing: border-box;
}
.rh-empty {
    margin-top: 24px;
    padding: 40px;
    text-align: center;
    color: #94a3b8;
    background: #fff;
    border: 1px dashed #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
}

.rack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
    margin-top: 16px;
}
.rack-card-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    text-decoration: none;
    color: #0f172a;
    transition: border-color .15s, box-shadow .15s;
    cursor: pointer;
    min-height: 380px;
}
.rack-card-item:hover {
    border-color: #93c5fd;
    box-shadow: 0 4px 14px rgba(59,130,246,.08);
}
.rci-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}
.rci-name {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}
.rci-code {
    display: block;
    font-size: 12px;
    color: #94a3b8;
    margin-top: 1px;
}
.rci-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}
.rktag-occ { background: #dbeafe; color: #1d4ed8; }
.rktag-res { background: #fef3c7; color: #b45309; }
.rktag-free { background: #f1f5f9; color: #64748b; }
.rktag-dirty { background: #fed7aa; color: #c2410c; }
.rktag-dis { background: #e2e8f0; color: #64748b; }

.rci-spec {
    font-size: 13px;
    color: #64748b;
}
/* Rack card flex layout for uniform height */
.rci-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Rack project occupancy block - fixed 2-line height */
.rci-proj {
    margin: 6px 0;
    min-height: 58px;
}
.rci-proj-label {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 2px;
    font-weight: 500;
}
.rci-proj-item {
    display: block;
    font-size: 12px;
    color: #475569;
    line-height: 22px;
    height: 22px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.rci-proj-num {
    font-weight: 600;
    color: #1d4ed8;
}
.rci-proj-more {
    color: #1d4ed8;
    font-weight: 600;
    cursor: pointer;
}
.rci-proj-none {
    color: #94a3b8;
}
.rci-proj-empty-line {
    color: #d1d5db;
}
.rci-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.rci-stat-row {
    display: flex;
    gap: 16px;
    font-size: 13px;
}
.rci-stat {
    display: flex;
    align-items: center;
    gap: 3px;
    color: #475569;
}
.rci-stat-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.rci-rate {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.rci-rate-label {
    font-size: 13px;
    color: #64748b;
}
.rci-rate-pct {
    font-size: 15px;
    font-weight: 800;
    padding: 1px 8px;
    border-radius: 4px;
}
.rci-rate-pct.progress-low { color: #15803d; background: #dcfce7; }
.rci-rate-pct.progress-medium { color: #1d4ed8; background: #dbeafe; }
.rci-rate-pct.progress-high { color: #b45309; background: #fef3c7; }
.rci-rate-pct.progress-full { color: #b91c1c; background: #fee2e2; }

.rci-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    padding-top: 8px;
}
.rci-actions .button.small,
.rci-actions .rci-more {
    padding: 7px 11px;
    font-size: 12px;
    line-height: 1.3;
    border-radius: 6px;
}
.rci-more {
    color: #64748b;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.rci-more:hover {
    background: #f1f5f9;
    color: #334155;
}

/* Context menu */
.rci-menu {
    position: fixed;
    z-index: 999;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(15,23,42,.12);
    padding: 6px;
    min-width: 150px;
}
.rci-menu button {
    display: block;
    width: 100%;
    padding: 9px 14px;
    border: none;
    background: none;
    text-align: left;
    font-size: 14px;
    color: #334155;
    cursor: pointer;
    border-radius: 6px;
}
.rci-menu button:hover {
    background: #f1f5f9;
}
.rci-menu-danger {
    color: #b91c1c !important;
}
.rci-menu-danger:hover {
    background: #fee2e2 !important;
}

.form-card {
    background: #fff;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 14px 30px rgba(15,23,42,.06);
    margin-top: 16px;
}
.form-card label {
    display: block;
    margin-top: 16px;
    margin-bottom: 8px;
    font-weight: 600;
    color: #334155;
}
.form-card input,
.form-card select,
.form-card textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
}
.form-card textarea {
    min-height: 120px;
}
.form-checkbox-row {
    display: flex !important;
    align-items: center;
    gap: 8px;
    margin-top: 18px !important;
    margin-bottom: 0 !important;
    font-weight: 500 !important;
    cursor: pointer;
}
.form-checkbox-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    accent-color: #1b3a8a;
}
.form-checkbox-hint {
    font-size: 12px;
    color: #94a3b8;
    margin: 6px 0 0;
    line-height: 1.5;
}
.form-card button {
    margin-top: 22px;
    padding: 14px 18px;
    border: none;
    border-radius: 12px;
    background: #1b3a8a;
    color: #fff;
    cursor: pointer;
}
.main-nav {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.main-nav a {
    color: #f8fafc;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 10px;
}
.main-nav a:hover {
    background: rgba(255,255,255,0.1);
}
