/* ============================================================
   Reine Bot Dashboard — theme sakura (khớp vibe yuusocuti.xyz)
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@300;400;500;600;700&family=Poppins:wght@400;500;600;700;800&family=M+PLUS+Rounded+1c:wght@400;500;700&display=swap');

:root {
    --sakura-pink: #ffb7c5;
    --sakura-light: #ffe4e9;
    --sakura-dark: #ff7b9d;
    --sakura-accent: #ff6b9d;
    --sakura-bg: #fff5f7;
    --sakura-white: #ffffff;
    --sakura-text: #4a4a4a;
    --sakura-text-light: #8b8b8b;
    --radius: 18px;
    --shadow: 0 8px 30px rgba(255, 123, 157, 0.12);
    --shadow-hover: 0 12px 40px rgba(255, 123, 157, 0.22);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Quicksand', 'M PLUS Rounded 1c', sans-serif;
    color: var(--sakura-text);
    background: var(--sakura-bg);
    background-image:
        radial-gradient(circle at 20% 50%, rgba(255, 183, 197, 0.10) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 228, 233, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(255, 183, 197, 0.08) 0%, transparent 40%);
    background-attachment: fixed;
    min-height: 100vh;
}

h1, h2, h3, h4 { font-family: 'M PLUS Rounded 1c', 'Quicksand', sans-serif; color: var(--sakura-text); }
a { color: var(--sakura-accent); text-decoration: none; }

/* ---------- Topbar ---------- */
.topbar {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 24px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--sakura-light);
    position: sticky; top: 0; z-index: 50;
}
.topbar .brand { font-weight: 700; font-size: 1.25rem; color: var(--sakura-accent); display: flex; align-items: center; gap: 8px; }
.topbar .spacer { flex: 1; }
.topbar .user { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.topbar .user img { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--sakura-pink); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 22px; border: none; border-radius: 999px;
    font-family: inherit; font-weight: 600; font-size: .95rem; cursor: pointer;
    background: linear-gradient(135deg, var(--sakura-accent), var(--sakura-dark));
    color: #fff; box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease, opacity .15s; }
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn.ghost { background: var(--sakura-white); color: var(--sakura-accent); border: 1.5px solid var(--sakura-pink); box-shadow: none; }
.btn.discord { background: #5865F2; }
.btn.sm { padding: 7px 14px; font-size: .85rem; }

/* ---------- Layout containers ---------- */
.container { max-width: 1100px; margin: 0 auto; padding: 28px 20px; }
.center-screen { min-height: calc(100vh - 64px); display: flex; align-items: center; justify-content: center; padding: 20px; }

.card {
    background: var(--sakura-white); border-radius: var(--radius);
    box-shadow: var(--shadow); border: 1px solid var(--sakura-light); padding: 24px; }

/* ---------- Landing hero ---------- */
.hero { text-align: center; max-width: 460px; }
.hero .logo { font-size: 3.2rem; }
.hero h1 { font-size: 2rem; margin: 12px 0 6px; }
.hero p { color: var(--sakura-text-light); margin: 0 0 22px; line-height: 1.6; }

/* ---------- Servers grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.server-card {
    background: var(--sakura-white); border-radius: var(--radius); border: 1px solid var(--sakura-light);
    box-shadow: var(--shadow); padding: 20px; text-align: center; transition: transform .15s, box-shadow .15s; }
.server-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.server-card .icon, .server-card .icon-fallback {
    width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 12px; object-fit: cover;
    border: 3px solid var(--sakura-light); }
.server-card .icon-fallback {
    display: flex; align-items: center; justify-content: center;
    background: var(--sakura-light); color: var(--sakura-accent); font-size: 1.6rem; font-weight: 700; }
.server-card .name { font-weight: 700; margin-bottom: 14px; word-break: break-word; }
.muted { color: var(--sakura-text-light); }

/* ---------- Settings page ---------- */
.dash-layout { display: grid; grid-template-columns: 230px 1fr; gap: 24px; align-items: start; }
.sidebar { background: var(--sakura-white); border-radius: var(--radius); box-shadow: var(--shadow);
    border: 1px solid var(--sakura-light); padding: 14px; position: sticky; top: 84px; }
.sidebar .guild { display: flex; align-items: center; gap: 10px; padding: 6px 8px 14px; border-bottom: 1px solid var(--sakura-light); margin-bottom: 10px; }
.sidebar .guild img, .sidebar .guild .gi { width: 38px; height: 38px; border-radius: 50%; }
.sidebar .guild .gi { background: var(--sakura-light); color: var(--sakura-accent); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.sidebar .guild b { font-size: .95rem; word-break: break-word; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px;
    cursor: pointer; font-weight: 600; color: var(--sakura-text); transition: background .15s, color .15s; }
.nav-item:hover { background: var(--sakura-bg); }
.nav-item.active { background: linear-gradient(135deg, var(--sakura-accent), var(--sakura-dark)); color: #fff; }
.nav-item i { width: 18px; text-align: center; }

.panel { display: none; }
.panel.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.panel h2 { margin-top: 0; }
.field { margin-bottom: 20px; }
.field label { display: block; font-weight: 600; margin-bottom: 7px; }
.field .hint { font-weight: 400; color: var(--sakura-text-light); font-size: .85rem; margin-left: 6px; }
.input, select, textarea {
    width: 100%; padding: 11px 14px; border: 1.5px solid var(--sakura-light); border-radius: 12px;
    font-family: inherit; font-size: .95rem; color: var(--sakura-text); background: #fffafb; transition: border-color .15s; }
.input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sakura-pink); }
textarea { min-height: 90px; resize: vertical; }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > .field { flex: 1; min-width: 160px; }

/* Toggle switch */
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 16px; background: #fffafb; border: 1.5px solid var(--sakura-light); border-radius: 14px; margin-bottom: 12px; }
.toggle .t-label b { display: block; }
.toggle .t-label span { color: var(--sakura-text-light); font-size: .85rem; }
.switch { position: relative; width: 50px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: #e6c6cf; border-radius: 999px; transition: .25s; cursor: pointer; }
.slider::before { content: ''; position: absolute; height: 22px; width: 22px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .25s; }
.switch input:checked + .slider { background: linear-gradient(135deg, var(--sakura-accent), var(--sakura-dark)); }
.switch input:checked + .slider::before { transform: translateX(22px); }

.save-bar { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.tag { display: inline-block; background: var(--sakura-light); color: var(--sakura-accent); border-radius: 999px; padding: 4px 12px; margin: 0 6px 6px 0; font-size: .85rem; font-weight: 600; }
.stat-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.stat { flex: 1; min-width: 130px; background: #fffafb; border: 1.5px solid var(--sakura-light); border-radius: 14px; padding: 14px; text-align: center; }
.stat .num { font-size: 1.6rem; font-weight: 700; color: var(--sakura-accent); }
.stat .lbl { color: var(--sakura-text-light); font-size: .85rem; }
.lb-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--sakura-light); }
.lb-item .rank { width: 26px; height: 26px; border-radius: 50%; background: var(--sakura-light); color: var(--sakura-accent); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; }

/* ---------- Sakura branch (cành hoa trang trí, port từ sakura-theme.css) ---------- */
@keyframes branch-sway {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(2deg); }
}
.sakura-branch {
    position: fixed;
    pointer-events: none;
    z-index: 1;
    opacity: 0.85;
}
.sakura-branch img {
    width: 100%;
    height: 100%;
    display: block;
    filter: drop-shadow(0 4px 12px rgba(139, 69, 19, 0.25));
}
.sakura-branch-top-left {
    top: -30px;
    left: -30px;
    width: 500px;
    height: auto;
    transform-origin: top left;
    animation: branch-sway 6s ease-in-out infinite;
}
@media (max-width: 760px) {
    .sakura-branch-top-left { width: 280px; opacity: 0.6; }
}

/* Reaction roles */
.role-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin-bottom: 14px; }
.role-check { display: flex; align-items: center; gap: 8px; padding: 8px 11px; background: #fffafb;
    border: 1.5px solid var(--sakura-light); border-radius: 10px; cursor: pointer; font-size: .9rem; }
.role-check input { accent-color: var(--sakura-accent); width: 16px; height: 16px; }
.rr-panel { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #fffafb;
    border: 1.5px solid var(--sakura-light); border-radius: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.rr-panel .pname { font-weight: 700; }
.rr-panel .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.rr-panel .dot.on { background: #5fcf7d; }
.rr-panel .dot.off { background: #d9b7c1; }
.rr-role-row { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; align-items: center; }
.rr-role-row select { flex: 2; min-width: 130px; }
.rr-role-row .em { flex: 0 0 70px; }
.rr-role-row .lb { flex: 1.5; min-width: 110px; }
.rr-role-row .ds { flex: 2; min-width: 130px; }
.rr-role-row .del { flex: none; background: #ffe0e6; color: var(--sakura-dark); border: none; border-radius: 8px; width: 36px; height: 38px; cursor: pointer; }

.loading { text-align: center; padding: 60px 20px; color: var(--sakura-text-light); }
.loading i { font-size: 2rem; color: var(--sakura-pink); }

@media (max-width: 760px) {
    .dash-layout { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .nav { display: flex; overflow-x: auto; gap: 6px; }
    .nav-item { white-space: nowrap; }
}
