:root {
    --bg: #fff8fb;
    --pink-1: #f9e5ec;
    --pink-2: #f0d6df;
    --pink-3: #ddb4c2;
    --pink-4: #ba8f9d;
    --ink: #53434b;
    --muted: #8f7c84;
    --white: rgba(255,255,255,0.84);
    --border: rgba(194, 153, 168, 0.18);
    --shadow: 0 18px 40px rgba(140, 101, 117, 0.08);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Noto Sans KR', sans-serif;
    background: linear-gradient(180deg, #fffafb 0%, #fdf5f8 100%);
    color: var(--ink);
    overflow-x: hidden;
}

.scene {
    position: fixed;
    z-index: 0;
    pointer-events: none;
    opacity: 0.14;
}
.scene-left {
    width: 440px;
    height: 340px;
    top: -20px;
    left: -40px;
    background:
        radial-gradient(circle at 55px 80px, rgba(242, 185, 208, .55) 0 14px, transparent 15px),
        radial-gradient(circle at 105px 125px, rgba(242, 185, 208, .45) 0 12px, transparent 13px),
        radial-gradient(circle at 140px 100px, rgba(242, 185, 208, .45) 0 10px, transparent 11px),
        radial-gradient(circle at 180px 145px, rgba(242, 185, 208, .42) 0 14px, transparent 15px),
        radial-gradient(circle at 220px 105px, rgba(242, 185, 208, .35) 0 10px, transparent 11px),
        linear-gradient(110deg, transparent 0 34%, rgba(165, 118, 131, .22) 34% 35%, transparent 35%),
        linear-gradient(128deg, transparent 0 52%, rgba(165, 118, 131, .18) 52% 53%, transparent 53%),
        linear-gradient(148deg, transparent 0 64%, rgba(165, 118, 131, .15) 64% 65%, transparent 65%);
    filter: blur(1px);
}
.scene-right {
    width: 380px;
    height: 300px;
    bottom: 10px;
    right: -30px;
    background:
        radial-gradient(circle at 70px 145px, rgba(242, 185, 208, .42) 0 13px, transparent 14px),
        radial-gradient(circle at 130px 115px, rgba(242, 185, 208, .38) 0 10px, transparent 11px),
        radial-gradient(circle at 190px 165px, rgba(242, 185, 208, .36) 0 12px, transparent 13px),
        linear-gradient(35deg, transparent 0 42%, rgba(165, 118, 131, .18) 42% 43%, transparent 43%),
        linear-gradient(18deg, transparent 0 58%, rgba(165, 118, 131, .14) 58% 59%, transparent 59%);
    filter: blur(1px);
}

.petal-wrap {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
/*
 * Petals
 *
 * The falling petals are enlarged and slowed down to create a more gentle,
 * immersive effect.  Width and height have been increased while keeping
 * the same rounded shape and soft colouring.  Animation durations have
 * been extended for a slower fall.
 */
.falling-petal {
    position: absolute;
    top: -40px;
    width: 24px;
    height: 16px;
    background: rgba(245, 193, 214, 0.55);
    border-radius: 12px 12px 0 12px;
    box-shadow: inset -1px -1px 1px rgba(255,255,255,.55);
    animation: petals-fall linear infinite;
}
/* Adjusted animation durations for slower fall */
.p1 { left: 6%; animation-duration: 22s; animation-delay: -2s; }
.p2 { left: 14%; animation-duration: 24s; animation-delay: -12s; }
.p3 { left: 25%; animation-duration: 20s; animation-delay: -5s; }
.p4 { left: 36%; animation-duration: 26s; animation-delay: -9s; }
.p5 { left: 48%; animation-duration: 25s; animation-delay: -3s; }
.p6 { left: 58%; animation-duration: 21s; animation-delay: -15s; }
.p7 { left: 66%; animation-duration: 24s; animation-delay: -4s; }
.p8 { left: 74%; animation-duration: 25s; animation-delay: -18s; }
.p9 { left: 82%; animation-duration: 22s; animation-delay: -7s; }
.p10 { left: 89%; animation-duration: 27s; animation-delay: -11s; }
.p11 { left: 52%; animation-duration: 21.5s; animation-delay: -1s; }
.p12 { left: 30%; animation-duration: 25.5s; animation-delay: -20s; }

@keyframes petals-fall {
    0% { transform: translate3d(0, -10vh, 0) rotate(0deg); opacity: 0; }
    10% { opacity: .8; }
    50% { transform: translate3d(40px, 45vh, 0) rotate(160deg); }
    100% { transform: translate3d(-65px, 110vh, 0) rotate(340deg); opacity: .15; }
}

.layout {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.sidebar {
    padding: 18px;
    background: rgba(255, 249, 251, 0.87);
    border-right: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

.brand-card, .sidebar-note, .panel, .stat-card, .flash {
    background: var(--white);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    border-radius: 24px;
}
.brand-card {
    display: flex;
    gap: 14px;
    padding: 18px;
    align-items: center;
    margin-bottom: 24px;
}
.brand-logo-box {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    overflow: hidden;
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(233, 185, 200, .35);
    display: flex;
    align-items: center;
    justify-content: center;
}
.brand-logo-img {
    width: 92%;
    height: 92%;
    object-fit: contain;
    opacity: .92;
}
.brand-top { font-size: 12px; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; }
.brand-card h1 { margin: 4px 0 4px; font-size: 24px; }
.brand-card p { margin: 0; color: var(--muted); font-size: 14px; }

/* Text-based logo for brand */
.brand-logo-text {
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 800;
    font-size: 30px;
    color: var(--rose-dark);
    line-height: 1;
}

/* Logout button fills the width of sidebar card */
.logout-form .btn {
    width: 100%;
    margin-top: 8px;
}

/* Photo grid styling for before/after images */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 12px;
}
.photo-item {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: var(--shadow);
}
.photo-item img {
    display: block;
    width: 100%;
    height: auto;
}
.photo-stage {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.85);
    padding: 2px 6px;
    font-size: 12px;
    border-radius: 8px;
    color: var(--rose-dark);
}
.photo-upload-form {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}
.photo-upload-form input[type="file"] {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px;
    background: var(--white);
    font-size: 14px;
}
.photo-upload-form .btn {
    margin: 0;
}

/* Quick add button inside calendar cells */
.add-appt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
    background: rgba(255, 255, 255, 0.8);
    color: var(--rose-dark);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    transition: background .2s;
}
.add-appt-btn:hover {
    background: rgba(255, 255, 255, 1);
}

/* Login page styling */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 120px);
}
.login-card {
    background: rgba(255, 249, 251, 0.95);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    border-radius: 24px;
    padding: 40px;
    width: 380px;
    text-align: center;
}
.login-title {
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 700;
    color: var(--rose-dark);
}
.login-form label {
    display: block;
    margin-bottom: 14px;
    text-align: left;
    font-weight: 500;
    color: var(--rose-dark);
}
.login-form input[type="password"] {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--white);
    font-size: 16px;
    margin-top: 6px;
}
.login-form .btn.primary.full-width {
    width: 100%;
    margin-top: 12px;
}
.nav-menu { display: grid; gap: 10px; }
.nav-link {
    padding: 14px 16px;
    border-radius: 16px;
    text-decoration: none;
    color: var(--ink);
    transition: .2s;
}
.nav-link:hover { background: #fff4f7; }
.nav-link.active {
    background: linear-gradient(135deg, #f3d7e1, #fff5f8);
    font-weight: 700;
}
.sidebar-note { margin-top: 24px; padding: 18px; }
.note-title { font-weight: 800; margin-bottom: 8px; }
.sidebar-note p { margin: 0; color: var(--muted); line-height: 1.8; }

.main { padding: 22px; }
.topbar {
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    margin-bottom: 18px;
}
.small-title { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.topbar h2 { margin: 0; font-size: 36px; }
.topbar-badge {
    padding: 11px 16px; border-radius: 999px; background: rgba(255,255,255,.86); border: 1px solid var(--border); color: var(--muted); font-size: 14px;
}

.card-grid { display: grid; gap: 16px; }
.stats-grid { grid-template-columns: repeat(4, 1fr); margin-bottom: 18px; }
.customer-summary-grid { grid-template-columns: repeat(3, 1fr); margin-bottom: 18px; }
.stat-card { padding: 22px; }
.stat-label { color: var(--muted); font-size: 14px; }
.stat-value { font-size: 32px; font-weight: 800; margin: 8px 0; }
.stat-sub { color: var(--muted); font-size: 13px; }
.soft-pink { background: linear-gradient(135deg, rgba(249,229,236,.84), rgba(252,243,246,.84)); }
.soft-white { background: linear-gradient(135deg, rgba(255,255,255,.86), rgba(251,246,248,.82)); }
.soft-blush { background: linear-gradient(135deg, rgba(250,240,244,.85), rgba(244,227,233,.83)); }
.soft-rose { background: linear-gradient(135deg, rgba(255,244,248,.87), rgba(247,226,234,.84)); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.two-col.wide-left { grid-template-columns: 1.55fr .95fr; }
.stack-col { display: grid; gap: 18px; }
.panel { padding: 18px; overflow: hidden; }
.panel-head {
    display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 14px;
}
.panel-head.with-nav { align-items: flex-start; }
.panel h3 { margin: 0; font-size: 22px; }
.panel-tag {
    padding: 8px 12px; border-radius: 999px; background: #fff5f8; border: 1px solid var(--border); color: var(--muted); font-size: 13px;
}

.calendar-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.dow { text-align: center; font-weight: 700; color: var(--muted); padding: 8px 0; }
.dow.sunday, .calendar-day.sunday { color: #d36582; }
.dow.saturday, .calendar-day.saturday { color: #5e7cc7; }
.calendar-cell {
    min-height: 132px; border: 1px solid var(--border); border-radius: 16px; background: rgba(255,255,255,.72); padding: 10px;
}
.calendar-cell.dim { opacity: .35; }
.calendar-cell.today { outline: 2px solid #edbdcb; background: linear-gradient(180deg, #fffafc 0%, #fff1f6 100%); }
.calendar-day { font-weight: 800; margin-bottom: 8px; }
.calendar-appointments { display: grid; gap: 7px; }
.appt-chip {
    background: rgba(255, 243, 246, .94); border: 1px solid rgba(204, 142, 164, 0.16); border-radius: 12px; padding: 7px;
}
.appt-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.appt-time { font-weight: 700; font-size: 12px; }
.status-mini { font-size: 11px; color: var(--muted); }
.appt-chip strong { display: block; font-size: 13px; }
.appt-service { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.mini-link {
    margin-top: 4px; padding: 0; border: 0; background: none; font-size: 12px; color: var(--muted); cursor: pointer;
}
.mini-link.danger { color: #bf6281; }

.sales-list, .care-list { list-style: none; padding: 0; margin: 0; }
.sales-list li, .care-list li {
    display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid rgba(204, 142, 164, 0.14);
}
.sales-list li:last-child, .care-list li:last-child { border-bottom: none; }
.care-list strong { display: block; }
.care-list span, .care-list small, .sales-list span { color: var(--muted); }
.sales-list strong { font-size: 15px; }

.customer-card-list {
    display: grid;
    gap: 14px;
}
.customer-card {
    border: 1px solid rgba(194, 153, 168, 0.18);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255,255,255,.72), rgba(255,250,252,.88));
    padding: 18px;
}
.customer-topline {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}
.customer-name-box {
    display: flex;
    align-items: center;
    gap: 10px;
}
.customer-name {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: .02em;
}
.customer-meta {
    color: var(--muted);
    font-size: 14px;
    margin-top: 8px;
}
.data-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}
.data-chip {
    padding: 8px 12px;
    border-radius: 999px;
    background: #fff6f8;
    border: 1px solid rgba(204,142,164,.16);
    font-size: 13px;
    color: var(--ink);
}
.customer-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.customer-notes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 18px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(204, 142, 164, 0.12);
}
.note-item { display: grid; gap: 4px; }
.note-item strong { font-size: 13px; color: var(--muted); }
.note-item span { line-height: 1.6; }
.note-item.full { grid-column: 1 / -1; }

.membership-card-list { display: grid; gap: 12px; }
.membership-card {
    padding: 16px;
    border: 1px solid rgba(194, 153, 168, 0.18);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255,255,255,.72), rgba(255,250,252,.88));
}
.membership-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}
.membership-meta { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.progress-bar {
    width: 100%; height: 9px; border-radius: 999px; background: #f6e6ec; overflow: hidden;
}
.progress-bar span {
    display: block; height: 100%; background: linear-gradient(90deg, #e5b9c8, #d69aaa);
}

.empty-box {
    padding: 24px;
    text-align: center;
    color: var(--muted);
    border: 1px dashed rgba(194,153,168,.28);
    border-radius: 18px;
    background: rgba(255,255,255,.55);
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 10px; text-align: left; border-bottom: 1px solid rgba(204, 142, 164, 0.14); font-size: 14px; vertical-align: top; }
thead th { font-size: 13px; color: var(--muted); font-weight: 700; }
.actions { display: flex; align-items: center; gap: 8px; }
.status-chip {
    display: inline-block; padding: 6px 10px; border-radius: 999px; background: #fff1f6; border: 1px solid var(--border); font-size: 12px;
}

.toolbar { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 16px; align-items: center; }
.search-form { display: flex; gap: 10px; flex: 1; }
.search-form input { flex: 1; }

input, select, textarea, button { font: inherit; }
input, select, textarea {
    width: 100%; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border); background: rgba(255,255,255,.9); color: var(--ink);
}
textarea { resize: vertical; }
label { display: flex; flex-direction: column; gap: 8px; font-weight: 500; color: var(--ink); }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; padding: 11px 15px; border-radius: 14px; border: 1px solid var(--border); background: rgba(255,255,255,.8); color: var(--ink); cursor: pointer; text-decoration: none;
}
.btn.primary { background: linear-gradient(135deg, #efc3d3, #ffeef4); color: #603f4f; }
.btn.secondary { background: #fff; }
.btn.tiny { padding: 6px 10px; font-size: 12px; }
.btn.danger { background: #fff2f5; color: #a24766; }

.flash { padding: 14px 18px; margin-bottom: 18px; }
.flash.success { background: #fff6f9; }

.message-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.message-card {
    background: linear-gradient(180deg, #fff8fb 0%, #fff1f5 100%); border: 1px solid var(--border); border-radius: 18px; padding: 18px;
}
.message-title { font-weight: 800; margin-bottom: 10px; }
.message-card p { line-height: 1.8; min-height: 115px; }

@media (max-width: 1240px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar { border-right: 0; border-bottom: 1px solid var(--border); }
    .stats-grid, .customer-summary-grid { grid-template-columns: repeat(2, 1fr); }
    .two-col, .two-col.wide-left, .message-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .topbar { flex-direction: column; align-items: flex-start; }
    .stats-grid, .customer-summary-grid { grid-template-columns: 1fr; }
    .toolbar, .search-form { flex-direction: column; }
    .form-grid, .customer-notes { grid-template-columns: 1fr; }
    .calendar-grid { gap: 6px; }
    .calendar-cell { min-height: 110px; padding: 8px; }
    .customer-topline { flex-direction: column; }
}
