* { box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    background: #f5f7fb;
    color: #222;
    line-height: 1.5;
}
.container {
    max-width: 1100px;
    margin: 20px auto;
    padding: 24px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,.05);
}
h1 { margin-top: 0; color: #1f6feb; }
h2, h3 { color: #333; }

label { display: block; margin: 12px 0 4px; font-weight: 500; }
select, input, textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
}
select:focus, input:focus, textarea:focus {
    outline: none;
    border-color: #1f6feb;
    box-shadow: 0 0 0 3px rgba(31,111,235,.15);
}

button {
    background: #1f6feb;
    color: #fff;
    border: 0;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-family: inherit;
    transition: background .15s;
}
button:hover { background: #195bc7; }
button.secondary { background: #eaeef2; color: #222; }
button.secondary:hover { background: #dfe3e8; }
button.danger { background: #d73a49; }
button.danger:hover { background: #b62d3d; }
button.success { background: #2ea043; }
button.success:hover { background: #268a39; }

.slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
    margin-top: 10px;
}
.slot {
    padding: 10px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    transition: all .15s;
}
.slot.free:hover { background: #e6f0ff; border-color: #1f6feb; }
.slot.busy { background: #f0f0f0; color: #999; cursor: not-allowed; text-decoration: line-through; }
.slot.selected { background: #1f6feb; color: #fff; border-color: #1f6feb; }

.appt-list { display: flex; flex-direction: column; gap: 10px; }
.appt {
    display: grid;
    grid-template-columns: 80px 1fr auto auto;
    gap: 12px;
    padding: 12px;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    align-items: center;
}
.appt .time { font-weight: 600; color: #1f6feb; }
.appt .name { font-weight: 500; }
.appt .svc { color: #666; font-size: 14px; }

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}
.badge.booked { background: #e6f0ff; color: #1f6feb; }
.badge.completed { background: #e6ffed; color: #2ea043; }
.badge.no_show { background: #ffeef0; color: #d73a49; }
.badge.cancelled { background: #f0f0f0; color: #666; }

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin: 20px 0;
}
.stat-card {
    background: #f5f7fb;
    padding: 16px;
    border-radius: 10px;
}
.stat-card .v { font-size: 28px; font-weight: 700; color: #1f6feb; }
.stat-card .l { color: #666; font-size: 13px; }

table { width: 100%; border-collapse: collapse; margin: 10px 0; }
th, td { padding: 10px; text-align: left; border-bottom: 1px solid #eee; }
th { background: #f5f7fb; font-weight: 600; }

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}
.topbar .user { color: #666; font-size: 14px; }
.topbar .user b { color: #1f6feb; }

.login-wrap {
    max-width: 380px;
    margin: 80px auto;
    padding: 40px 30px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,.08);
    text-align: center;
}
.login-wrap h1 { font-size: 22px; margin-bottom: 24px; }
.login-wrap .error {
    background: #ffeef0;
    color: #d73a49;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: none;
}
.login-wrap input { margin-bottom: 12px; }
.login-wrap button { width: 100%; margin-top: 8px; }
.login-wrap .hint { color: #888; font-size: 13px; margin-top: 16px; }

.nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 20px 0;
}
.nav a {
    display: block;
    flex: 1;
    min-width: 200px;
    padding: 20px;
    background: #f5f7fb;
    border: 1px solid #e1e4e8;
    border-radius: 10px;
    text-decoration: none;
    color: #222;
    text-align: center;
    transition: all .15s;
}
.nav a:hover { background: #e6f0ff; border-color: #1f6feb; }
.nav a h3 { margin: 0 0 8px; color: #1f6feb; }
.nav a p { margin: 0; color: #666; font-size: 14px; }

@media (max-width: 600px) {
    .appt { grid-template-columns: 1fr; }
    .appt > div:last-child { display: flex; gap: 8px; flex-wrap: wrap; }
}