:root  {
    --blue:#2563eb;
    --line:#dce3ea;
    --muted:#64748b;
    --bg:#f4f7fb
}

body  {
    margin:0;
    background:var(--bg);
    color:#1f2937;
    font:15px/1.55 "Yu Gothic","Meiryo",sans-serif
}
.layout  {
    display:flex;
    min-height:100vh
}
.main  {
    flex:1;
    min-width:0;
    padding:26px
}
h1  {
    font-size:27px;
    margin:0 0 6px;
    color:#172b42
}
h2  {
    font-size:19px;
    margin:0 0 12px
}
.sub  {
    color:var(--muted);
    margin:0 0 22px
}
.panel  {
    background:#fff;
    border:1px solid var(--line);
    border-radius:12px;
    padding:19px;
    margin-bottom:18px;
    box-shadow:0 2px 8px #1e293b08
}
.toolbar  {
    display:flex;
    align-items:center;
    gap:8px;
    flex-wrap:wrap;
    margin-bottom:14px
}
.spacer  {
    flex:1
}
button  {
    border:1px solid #cbd5e1;
    background:#fff;
    color:#24364b;
    padding:9px 12px;
    border-radius:8px;
    font-size:14px;
    cursor:pointer;
    font-weight:600
}
button.primary  {
    background:var(--blue);
    color:#fff;
    border-color:var(--blue)
}
.primary-link {
    display: inline-block;
    padding: 9px 12px;
    border: 1px solid var(--blue);
    border-radius: 8px;
    background: var(--blue);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}
input,select,textarea  {
    font:inherit;
    border:1px solid #cbd5e1;
    border-radius:8px;
    padding:9px 10px;
    background:#fff;
    width:100%
}
.stats  {
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:12px;
    margin-bottom:18px
}
.stat  {
    background:#fff;
    border:1px solid var(--line);
    border-radius:10px;
    padding:14px
}
.stat-label,.muted  {
    color:var(--muted);
    font-size:13px
}
.stat-number  {
    
    font-weight:800;
    margin-top:3px
}
.stat-number .stat-unit {
    font-size:16px;
    font-weight:600;
    margin-left:4px
}
.status  {
    display:inline-block;
    padding:4px 8px;
    border-radius:6px;
    font-size:12px;
    font-weight:700;
    white-space:nowrap
}
.available  {
    background:#dcfce7;
    color:#166534
}
.rented  {
    background:#dbeafe;
    color:#1d4ed8
}
.maintenance  {
    background:#fef3c7;
    color:#92400e
}
.returned  {
    background:#e2e8f0;
    color:#475569
}
.table-wrap,.week-wrap  {
    overflow-x:auto
}
table  {
    width:100%;
    border-collapse:collapse;
    min-width:720px
}
th,td  {
    padding:10px;
    border-bottom:1px solid var(--line);
    text-align:left;
    vertical-align:middle
}
th  {
    background:#f8fafc;
    color:#475569;
    font-size:13px
}
.filterbar  {
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    margin-bottom:12px
}
.filterbar select  {
    width:auto;
    min-width:145px
}
.filterbar input  {
    width:auto;
    min-width:200px
}
.week  {
    width:100%;
    min-width:850px;
    table-layout:fixed;
    border:1px solid var(--line);
    border-spacing:0;
    border-radius:8px;
    overflow:hidden
}
.week th  {
    text-align:center;
    padding:9px 5px
}
.week th:first-child  {
    width:145px
}
.week td  {
    height:65px;
    padding:5px;
    border-right:1px solid var(--line);
    vertical-align:top
}
.week td:last-child,.week th:last-child  {
    border-right:0
}
.car-cell  {
    font-weight:700;
    background:#f8fafc
}
.inspection-alert {
    display:inline-block;
    margin-top:5px;
    padding:3px 6px;
    border:1px solid #efb3b3;
    border-radius:5px;
    background:#fff0f0;
    color:#b42323;
    font-size:11px;
    font-weight:800;
    line-height:1.4;
    white-space:normal;
}
.inspection-alert.expired {
    background:#b42323;
    border-color:#b42323;
    color:#fff;
}
.booking  {
    display:block;
    width:100%;
    padding:5px;
    border:0;
    border-radius:5px;
    background:#dbeafe;
    color:#1d4ed8;
    font-size:12px;
    text-align:left;
    margin:2px 0;
    white-space:normal
}
.booking.service  {
    background:#fef3c7;
    color:#92400e
}
.notice  {
    font-size:13px;
    color:#64748b;
    background:#f8fafc;
    border-radius:8px;
    padding:10px 12px;
    margin-top:12px
}
.form-grid  {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px
}
.field label  {
    display:block;
    font-size:13px;
    font-weight:700;
    margin-bottom:5px
}
.field.full  {
    grid-column:1/-1
}
.backdrop  {
    display:none;
    position:fixed;
    inset:0;
    background:#0f172a88;
    z-index:100;
    align-items:center;
    justify-content:center;
    padding:16px
}
.backdrop.show  {
    display:flex
}
.modal  {
    background:#fff;
    border-radius:14px;
    padding:22px;
    width:min(650px,100%);
    max-height:90vh;
    overflow:auto;
    box-shadow:0 20px 50px #0003
}
.modal-head  {
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin-bottom:15px
}
.alert  {
    padding:10px 12px;
    border-radius:8px;
    background:#fff7ed;
    color:#9a3412;
    font-size:13px;
    margin:12px 0
}
.empty  {
    text-align:center;
    color:var(--muted);
    padding:22px
}
@media(max-width:900px)  {
    .main  {
        padding:17px
    }
    .stats  {
        grid-template-columns:repeat(2,minmax(0,1fr))
    }
}
@media(max-width:600px)  {
    .main  {
        padding:12px
    }
    h1  {
        font-size:23px
    }
    .panel  {
        padding:12px
    }
    .stat  {
        padding:10px
    }
    .stat-number  {
        }
    .form-grid  {
        grid-template-columns:1fr
    }
    .field.full  {
        grid-column:auto
    }
}
@media(max-width:760px) {
    .stat-number { }
}
@media(max-width:420px) {
    .stat-number { }
}

/* Requests-style count typography; keep after page media queries. */
.stat-number {font-size:var(--dashboard-count-size);font-family:var(--dashboard-count-font, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", Meiryo, sans-serif);line-height:1.3}
.stat-number .stat-unit{font-size:var(--dashboard-count-unit-size);font-weight:400}
@media(max-width:760px){.stat-number{font-size:var(--dashboard-count-size-mobile)}}

/* Topbar spans the full main width; content retains original spacing. */
.main { padding: 0; }
.loaner-content { padding: 26px; }
@media (max-width: 900px) { .main { padding: 0; } .loaner-content { padding: 17px; } }
@media (max-width: 600px) { .main { padding: 0; } .loaner-content { padding: 12px; } }

/* KPI typography only; page header/layout remains page-specific */
.stats .stat-label{font-size:14px;line-height:1.5;}

.stats .stat .muted{font-size:13px;line-height:1.6;margin-top:6px;}
