:root {
    --green: #6B705C;
    --green-dark: #555A49;
    --green-deep: #44493B;
    --green-soft: #EEF0E8;
    --beige: #F2EFE8;
    --beige-light: #F8F6F1;
    --sand: #DDD5C8;
    --ink: #1D211A;
    --muted: #6D7169;
    --line: #DDDCD6;
    --line-dark: #CBCBC4;
    --white: #FFFFFF;
    --danger-bg: #F7E9E6;
    --danger-border: #E6C9C2;
    --danger: #7A3E34;
    --shadow-soft: 0 10px 30px rgba(29, 33, 26, 0.04);
}

* { box-sizing: border-box; }

html {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #F7F7F4;
    color: var(--ink);
}

body { margin: 0; min-height: 100vh; }
button, input, select, textarea { font: inherit; }
a { color: var(--green-dark); text-decoration: none; }
a:hover, a:focus { color: var(--green-deep); text-decoration: underline; }

.shell { width: min(1100px, calc(100% - 40px)); margin: 0 auto; }
.topbar { background: var(--white); border-bottom: 1px solid var(--line); }
.topbar-inner { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.eyebrow { font-size: 12px; letter-spacing: 0.12em; color: var(--green); font-weight: 700; }
.brand { font-size: 22px; font-weight: 750; margin-top: 3px; }
.userbox { display: flex; gap: 18px; align-items: center; font-size: 14px; }
.userbox a { color: var(--green-dark); text-decoration: none; }
.userbox a:hover { color: var(--green-deep); text-decoration: underline; }
.main-space { padding: 34px 0 60px; }

.hero-card, .card, .login-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 14px;
}

.hero-card { padding: 30px 32px; margin-bottom: 18px; border-left: 5px solid var(--green); }
.hero-card h1, .login-card h1 { margin: 10px 0 6px; font-size: 30px; }
.hero-card p, .card p, .muted { color: var(--muted); margin: 0; line-height: 1.5; }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 999px;
    background: var(--green-soft);
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.badge.neutral { background: var(--beige); color: #645D50; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.card { padding: 24px; }
.card strong { display: block; font-size: 30px; margin: 9px 0 3px; }
.card small { color: var(--muted); }
.label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; }

.wide-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.wide-card h2 { margin: 8px 0 6px; }
.title-with-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.title-with-status h2 { margin: 8px 0 6px; }
.amazon-card-copy { min-width: 0; }

.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 40px;
    border: 0;
    border-radius: 9px;
    padding: 10px 16px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.btn:hover { text-decoration: none; }
.btn-primary,
.btn-secondary-action,
.btn-muted {
    background: var(--green);
    color: var(--beige);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-secondary-action:hover,
.btn-secondary-action:focus,
.btn-muted:hover,
.btn-muted:focus {
    background: var(--green-dark);
    color: var(--beige);
    text-decoration: none;
}

.btn-primary { width: 100%; }
.btn-auto { width: auto; min-width: 126px; }
.btn-secondary-action { min-width: 132px; flex: 0 0 auto; }

.login-page {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--beige), var(--beige-light));
    padding: 30px 0;
}

.login-wrap { width: min(680px, calc(100% - 36px)); margin: 0 auto; }
.login-card { padding: 38px 42px 40px; box-shadow: var(--shadow-soft); }
.login-mark {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--green);
    color: var(--beige);
    display: grid;
    place-items: center;
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 20px;
}

.login-card h1 { margin-top: 10px; margin-bottom: 6px; }
.login-form { display: grid; gap: 16px; margin-top: 26px; }
.login-card label, .settings-form label { display: grid; gap: 7px; font-size: 13px; font-weight: 700; color: var(--ink); }
.login-card input, .settings-form input, .settings-form select {
    width: 100%;
    height: 44px;
    border: 1px solid var(--line-dark);
    border-radius: 9px;
    padding: 10px 13px;
    background: var(--white);
    color: var(--ink);
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.login-card input:hover, .settings-form input:hover, .settings-form select:hover { border-color: #B8BAAF; }
.login-card input:focus, .settings-form input:focus, .settings-form select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(107, 112, 92, .14); }

.password-field { position: relative; width: 100%; }
.password-field input { padding-right: 48px; }
.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #777B70;
    display: grid;
    place-items: center;
    cursor: pointer;
}
.password-toggle:hover { color: var(--green-dark); background: var(--green-soft); }
.password-toggle:focus-visible { outline: 2px solid #CED2C3; outline-offset: 1px; }
.password-toggle svg { display: block; }
.login-help { display: flex; justify-content: flex-end; margin-top: -5px; }
.login-help a { color: var(--green-dark); font-size: 13px; font-weight: 500; text-decoration: none; }
.login-help a:hover, .login-help a:focus { color: var(--green-deep); text-decoration: underline; }

.alert { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); border-radius: 9px; padding: 11px 12px; margin-top: 18px; font-size: 13px; line-height: 1.45; }
.notice, .success-banner { border-radius: 9px; padding: 12px 14px; margin-top: 18px; font-size: 13px; line-height: 1.5; }
.notice { background: var(--beige-light); border: 1px solid var(--line); color: var(--muted); }
.success-banner { background: var(--green-soft); border: 1px solid #D7DDCA; color: var(--green-dark); margin-bottom: 18px; }

.compact-hero h1 { margin-bottom: 6px; }
.settings-card { margin-bottom: 16px; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-heading h2 { margin: 7px 0 0; }
.settings-form { display: grid; gap: 18px; }
.form-grid.two { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    padding-top: 4px;
}

.fixed-info {
    display: grid;
    grid-template-columns: 100px minmax(320px, 1.7fr) 90px minmax(160px, .7fr);
    gap: 10px 16px;
    padding: 14px;
    border-radius: 10px;
    background: var(--beige-light);
    border: 1px solid var(--line);
    font-size: 13px;
    align-items: center;
}
.fixed-info span { color: var(--muted); }
.fixed-info strong {
    font-weight: 650;
    word-break: normal;
    overflow-wrap: normal;
}
.fixed-info strong:first-of-type {
    white-space: nowrap;
    font-size: 16px;
    letter-spacing: -0.01em;
}
.status-actions { display: flex; align-items: center; gap: 12px; }

@media (max-width: 760px) {
    .grid-3, .form-grid.two { grid-template-columns: 1fr; }
    .wide-card, .status-actions { align-items: flex-start; flex-direction: column; }
    .shell { width: min(100% - 24px, 1100px); }
    .topbar-inner { min-height: auto; padding: 18px 0; }
    .userbox span { display: none; }
    .login-wrap { width: min(100% - 24px, 680px); }
    .login-card { padding: 30px 26px 32px; }
    .fixed-info { grid-template-columns: 1fr; }
    .fixed-info strong:first-of-type { white-space: normal; overflow-wrap: anywhere; }
    .btn-secondary-action { width: 100%; }
    .form-actions { justify-content: flex-end; }
    .form-actions .btn-auto { width: auto; }
}

@media (max-width: 480px) {
    .login-page { place-items: start center; padding-top: 26px; }
    .login-card { padding: 26px 20px 28px; }
    .login-card h1 { font-size: 27px; }
}
