:root {
    color-scheme: light;
    --primary: #2563eb;
    --border: #d9dce1;
    --text: #1f2430;
    --muted: #6b7280;
    --bg: #f5f6f8;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
    color: var(--text);
    background: var(--bg);
}

.hidden {
    display: none !important;
}

.notice {
    background: #fff7ed;
    border: 1px solid #fdba74;
    color: #9a3412;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
}

.error {
    color: #b91c1c;
    font-size: 14px;
}

/* 로그인 화면 */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-box {
    width: 320px;
    background: #fff;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.login-box h1 {
    margin: 0 0 4px;
    color: var(--primary);
}

.login-box .subtitle {
    margin: 0 0 24px;
    color: var(--muted);
    font-size: 14px;
}

.login-box form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.login-box label {
    font-size: 13px;
    color: var(--muted);
    margin-top: 8px;
}

.login-box input[type="text"],
.login-box input[type="password"] {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
}

.login-box .remember {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text);
    margin-top: 4px;
}

/* 공통 레이아웃 */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #fff;
    border-bottom: 1px solid var(--border);
}

.top-bar h1 {
    font-size: 18px;
    margin: 0;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--muted);
}

.content {
    padding: 20px;
    max-width: 640px;
    margin: 0 auto;
}

.btn {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-link {
    background: none;
    color: var(--primary);
    padding: 0;
}

.inline-form {
    display: inline;
}

/* 목록 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.data-table th,
.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 14px;
}

.data-table th {
    background: #f0f2f5;
    color: var(--muted);
    font-weight: 600;
}

.empty {
    color: var(--muted);
    text-align: center;
    margin-top: 40px;
}

/* 치수 입력 폼 */
.measurement-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.field-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.field-row label {
    font-size: 13px;
    color: var(--muted);
}

.field-row input[type="text"],
.field-row textarea {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 18px;
}

.field-error {
    color: #b91c1c;
    font-size: 13px;
    margin: -6px 0 0;
}

.voice-field {
    flex-direction: row;
    align-items: flex-end;
    gap: 8px;
    position: relative;
}

.voice-field label {
    flex: 0 0 auto;
    width: 110px;
    align-self: center;
}

.voice-field input {
    flex: 1;
}

.mic-btn {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: #fff;
    font-size: 20px;
    cursor: pointer;
}

.mic-btn.listening {
    background: #fee2e2;
    border-color: #ef4444;
    animation: pulse 1s infinite;
}

.mic-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.mic-heard {
    position: absolute;
    left: 118px;
    bottom: -18px;
    font-size: 12px;
    color: var(--muted);
}

@media (max-width: 480px) {
    .voice-field {
        flex-wrap: wrap;
    }
    .voice-field label {
        width: 100%;
    }
    .mic-heard {
        position: static;
        display: block;
        margin-top: 4px;
    }
}
