/* ============================================================
   RemindHub — World-Class Reminder App UI
   Aesthetic: Midnight Premium / Dark-Luxury with Light surfaces
   Font: Plus Jakarta Sans + Fraunces display
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700;9..144,800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* === Core Palette === */
    --indigo:      #5B73FF;
    --indigo-lt:   #EDF0FF;
    --indigo-dk:   #3A52E0;
    --violet:      #8B5CF6;
    --violet-lt:   #F3EFFE;
    --emerald:     #0BAB76;
    --emerald-lt:  #E6FAF4;
    --amber:       #F59E0B;
    --amber-lt:    #FEF8EC;
    --rose:        #F43F5E;
    --rose-lt:     #FFF0F3;
    --sky:         #0EA5E9;
    --sky-lt:      #E0F5FE;
    --teal:        #14B8A6;

    /* === Neutral Scale === */
    --n-0:   #FFFFFF;
    --n-25:  #FAFBFD;
    --n-50:  #F4F6FA;
    --n-100: #EAECF4;
    --n-200: #D8DBE9;
    --n-300: #B3B9D0;
    --n-400: #8A91AD;
    --n-500: #636B8A;
    --n-600: #454C6C;
    --n-700: #2D3350;
    --n-800: #1C2038;
    --n-900: #0E1124;

    /* === Semantic tokens === */
    --bg:         var(--n-25);
    --bg-2:       var(--n-0);
    --bg-3:       var(--n-50);
    --surface:    var(--n-0);
    --border:     var(--n-100);
    --border-2:   var(--n-200);
    --text:       var(--n-800);
    --text-2:     var(--n-500);
    --text-3:     var(--n-300);
    --text-inv:   var(--n-0);

    /* === Primaries === */
    --primary:    var(--indigo);
    --primary-lt: var(--indigo-lt);
    --primary-dk: var(--indigo-dk);

    /* === Layout === */
    --sidebar-w:  272px;
    --header-h:   64px;
    --radius-xs:  6px;
    --radius-sm:  10px;
    --radius:     14px;
    --radius-lg:  20px;
    --radius-xl:  28px;

    /* === Shadows === */
    --shadow-xs: 0 1px 3px rgba(14,17,36,.06);
    --shadow-sm: 0 2px 8px rgba(14,17,36,.08), 0 1px 2px rgba(14,17,36,.04);
    --shadow:    0 4px 20px rgba(14,17,36,.09), 0 1px 4px rgba(14,17,36,.05);
    --shadow-md: 0 8px 36px rgba(14,17,36,.13), 0 2px 8px rgba(14,17,36,.07);
    --shadow-lg: 0 20px 60px rgba(14,17,36,.18), 0 4px 16px rgba(14,17,36,.09);
    --shadow-glow: 0 0 0 3px rgba(91,115,255,.18);

    /* === Typography === */
    --font-display: 'Fraunces', serif;
    --font-body:    'Plus Jakarta Sans', sans-serif;
    --font-mono:    'JetBrains Mono', monospace;

    /* === Motion === */
    --ease:   cubic-bezier(.22,.68,0,1.2);
    --ease-2: cubic-bezier(.4,0,.2,1);
    --ease-3: cubic-bezier(.34,1.56,.64,1);
}

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 14.5px;
    line-height: 1.6;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   APP SHELL
   ============================================================ */
.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    grid-template-rows: var(--header-h) 1fr;
    min-height: 100dvh;
}

/* ============================================================
   HEADER
   ============================================================ */
.app-header {
    grid-column: 1 / -1;
    background: rgba(255,255,255,.88);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 14px;
    position: sticky;
    top: 0;
    z-index: 200;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.logo {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--n-800);
    letter-spacing: -.5px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--indigo) 0%, var(--violet) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(91,115,255,.4);
}
.logo-icon svg { width: 20px; height: 20px; }

.logo-sub {
    font-size: 10px;
    font-weight: 500;
    font-family: var(--font-body);
    color: var(--text-2);
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-top: -2px;
    display: block;
}

.header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* WS status */
.ws-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-3);
    padding: 5px 11px;
    border-radius: 20px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    transition: all .3s;
}
.ws-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--n-300);
    transition: all .3s;
    flex-shrink: 0;
}
.ws-status.connected { color: var(--emerald); background: var(--emerald-lt); border-color: rgba(11,171,118,.2); }
.ws-status.connected .ws-dot { background: var(--emerald); box-shadow: 0 0 0 3px rgba(11,171,118,.25); animation: livePulse 2s infinite; }
.ws-status.connecting .ws-dot { background: var(--amber); animation: pulse 1s infinite; }
.ws-status.error { color: var(--rose); background: var(--rose-lt); border-color: rgba(244,63,94,.2); }
.ws-status.error .ws-dot { background: var(--rose); }

@keyframes pulse { 0%,100% { opacity:1 } 50% { opacity:.35 } }
@keyframes livePulse { 0%,100%{ box-shadow:0 0 0 0 rgba(11,171,118,.5); } 70%{ box-shadow:0 0 0 5px rgba(11,171,118,0); } }

.header-user {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
}

.header-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--indigo), var(--violet));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: white;
    letter-spacing: 0;
    flex-shrink: 0;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all .18s var(--ease-2);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(91,115,255,.35);
}
.btn-primary:hover { background: var(--indigo-dk); box-shadow: 0 4px 14px rgba(91,115,255,.5); transform: translateY(-1px); }

.btn-secondary {
    background: var(--bg-3);
    color: var(--text-2);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--n-100); color: var(--text); }

.btn-ghost {
    background: transparent;
    color: var(--text-2);
}
.btn-ghost:hover { background: var(--bg-3); color: var(--text); }

.btn-danger {
    background: var(--rose-lt);
    color: var(--rose);
    border: 1px solid rgba(244,63,94,.2);
}
.btn-danger:hover { background: var(--rose); color: white; }

.btn-sm { padding: 6px 14px; font-size: 12.5px; border-radius: var(--radius-xs); }
.btn-xs { padding: 4px 10px; font-size: 11.5px; border-radius: var(--radius-xs); }

.btn-icon {
    width: 34px; height: 34px;
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-3);
    cursor: pointer;
    font-size: 14px;
    transition: all .15s;
    flex-shrink: 0;
}
.btn-icon:hover { background: var(--bg-3); color: var(--text); }
.btn-icon.danger:hover { background: var(--rose-lt); color: var(--rose); }

.w-full { width: 100%; justify-content: center; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 20px 12px 100px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--n-100) transparent;
}

.sidebar-section {
    font-family: var(--font-body);
    font-size: 10px;
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: .12em;
    padding: 20px 10px 7px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-2);
    cursor: pointer;
    border: none;
    background: none;
    text-align: left;
    width: 100%;
    transition: all .15s var(--ease-2);
}
.nav-item:hover { background: var(--bg-3); color: var(--text); }
.nav-item.active { background: var(--indigo-lt); color: var(--indigo); font-weight: 600; }

.nav-icon {
    width: 28px; height: 28px;
    border-radius: 8px;
    background: var(--bg-3);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
    transition: background .15s;
}
.nav-item.active .nav-icon { background: rgba(91,115,255,.15); }

.cat-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.badge {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    padding: 2px 7px;
    border-radius: 20px;
    margin-left: auto;
    background: var(--n-100);
    color: var(--text-2);
}
.nav-item.active .badge { background: rgba(91,115,255,.18); color: var(--indigo); }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
    padding: 28px 32px;
    overflow-y: auto;
    background: var(--bg);
}

/* ============================================================
   STATS BAR
   ============================================================ */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    position: relative;
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--accent, var(--indigo));
    border-radius: 3px 3px 0 0;
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

.stat-number {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -.5px;
    margin-bottom: 5px;
}
.stat-label {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: .08em;
}

/* ============================================================
   CATEGORY SHOWCASE — International Level
   ============================================================ */
.category-showcase {
    margin-bottom: 28px;
}
.category-showcase-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.category-showcase-title {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -.2px;
}

.category-cards-row {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: none;
}
.category-cards-row::-webkit-scrollbar { display: none; }

.category-mini-card {
    flex-shrink: 0;
    min-width: 130px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 14px;
    cursor: pointer;
    transition: all .2s var(--ease);
    position: relative;
    overflow: hidden;
}
.category-mini-card::before {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 100%;
    background: linear-gradient(180deg, transparent 40%, color-mix(in srgb, var(--cat-color, var(--indigo)) 8%, transparent) 100%);
    pointer-events: none;
}
.category-mini-card:hover {
    border-color: var(--cat-color, var(--indigo));
    box-shadow: 0 6px 20px color-mix(in srgb, var(--cat-color, var(--indigo)) 20%, transparent);
    transform: translateY(-3px);
}
.category-mini-card.active {
    border-color: var(--cat-color, var(--indigo));
    background: color-mix(in srgb, var(--cat-color, var(--indigo)) 7%, white);
    box-shadow: 0 4px 16px color-mix(in srgb, var(--cat-color, var(--indigo)) 25%, transparent);
}

.cat-mini-icon {
    font-size: 22px;
    display: block;
    margin-bottom: 8px;
}
.cat-mini-name {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 3px;
}
.cat-mini-count {
    font-size: 11px;
    color: var(--text-3);
    font-weight: 500;
}
.cat-mini-bar {
    height: 3px;
    border-radius: 2px;
    background: color-mix(in srgb, var(--cat-color, var(--indigo)) 30%, transparent);
    margin-top: 10px;
    overflow: hidden;
}
.cat-mini-bar-fill {
    height: 100%;
    border-radius: 2px;
    background: var(--cat-color, var(--indigo));
    transition: width .5s var(--ease-2);
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}
.page-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -.4px;
}

/* ============================================================
   REMINDER GRID
   ============================================================ */
.reminder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.reminder-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    overflow: hidden;
    transition: box-shadow .2s, transform .2s, border-color .2s;
    animation: cardIn .35s var(--ease-2) both;
    cursor: default;
    position: relative;
}
.reminder-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--n-200); }
.reminder-card.inactive { opacity: .55; }
.reminder-card.overdue { border-color: rgba(244,63,94,.25); }
.reminder-card.overdue::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 0 0 1.5px rgba(244,63,94,.2);
}

.cat-strip {
    width: 4px;
    flex-shrink: 0;
    background: var(--indigo);
    border-radius: 0;
}

.reminder-body {
    flex: 1;
    padding: 14px 16px;
    cursor: pointer;
    min-width: 0;
}

.reminder-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reminder-msg {
    font-size: 12.5px;
    color: var(--text-2);
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

.reminder-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

.reminder-time {
    font-size: 11.5px;
    font-family: var(--font-mono);
    color: var(--text-3);
    font-weight: 500;
}

.pill {
    font-size: 10.5px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    letter-spacing: .01em;
    white-space: nowrap;
}
.pill-repeat { background: var(--sky-lt); color: var(--sky); }
.pill-overdue { background: var(--rose-lt); color: var(--rose); animation: pillBlink 2s infinite; }
.pill-private { background: var(--n-100); color: var(--n-500); }
.pill-voice { background: var(--violet-lt); color: var(--violet); }

@keyframes pillBlink { 0%,100%{ opacity:1 } 50%{ opacity:.6 } }

.reminder-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 8px 8px 8px 4px;
    gap: 2px;
    opacity: 0;
    transition: opacity .15s;
}
.reminder-card:hover .reminder-actions { opacity: 1; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    grid-column: 1 / -1;
    padding: 70px 24px;
    text-align: center;
    color: var(--text-3);
}
.empty-state svg {
    width: 56px; height: 56px;
    margin: 0 auto 16px;
    display: block;
    opacity: .4;
}
.empty-state p { font-size: 15px; color: var(--text-2); line-height: 1.8; }
.empty-icon-wrap {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: var(--n-50);
    border: 2px dashed var(--n-200);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
}

/* ============================================================
   FAB
   ============================================================ */
.fab {
    position: fixed;
    bottom: 76px;
    right: 20px;
    width: 54px; height: 54px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--indigo), var(--violet));
    color: white;
    border: none;
    font-size: 26px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(91,115,255,.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: all .22s var(--ease);
}
.fab:hover { transform: scale(1.08) rotate(90deg); box-shadow: 0 8px 28px rgba(91,115,255,.55); }

/* ============================================================
   MODAL
   ============================================================ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(14,17,36,.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 16px;
}
.modal-backdrop.open { opacity: 1; pointer-events: all; }

.modal {
    background: var(--surface);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 540px;
    max-height: 90dvh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    transform: translateY(28px) scale(.96);
    transition: transform .32s var(--ease);
    overflow: hidden;
}
.modal-backdrop.open .modal { transform: translateY(0) scale(1); }

.modal-header {
    padding: 22px 24px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.modal-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    flex: 1;
    letter-spacing: -.3px;
    color: var(--text);
}
.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 22px 24px;
    scrollbar-width: thin;
    scrollbar-color: var(--n-100) transparent;
}
.modal-footer {
    padding: 16px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--bg-3);
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 18px; }

.form-group label {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-2);
    margin-bottom: 7px;
    letter-spacing: .06em;
    text-transform: uppercase;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="datetime-local"],
input[type="file"],
textarea,
select {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text);
    transition: border-color .18s, box-shadow .18s;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}
input:focus, textarea:focus, select:focus {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
    background: var(--n-0);
}
textarea { resize: vertical; min-height: 82px; line-height: 1.6; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Category chips in form */
.cat-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.cat-chip {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: all .15s var(--ease);
}
.cat-chip.selected { border-color: currentColor; box-shadow: 0 2px 8px rgba(0,0,0,.1); }

/* Sound grid */
.sound-grid { display: grid; grid-template-columns: repeat(6,1fr); gap: 8px; }
.sound-option {
    display: flex; flex-direction: column;
    align-items: center; gap: 4px;
    padding: 10px 4px;
    border-radius: var(--radius-sm);
    background: var(--bg-3);
    border: 1.5px solid var(--border);
    cursor: pointer;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-2);
    transition: all .15s;
    text-align: center;
}
.sound-option:hover { border-color: var(--primary); color: var(--primary); }
.sound-option.selected { border-color: var(--primary); background: var(--indigo-lt); color: var(--primary); }

/* Toggle */
.toggle-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 13px 0;
    border-top: 1px solid var(--border);
}
.toggle { position: relative; width: 44px; height: 25px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; inset: 0;
    background: var(--n-200);
    border-radius: 25px;
    cursor: pointer;
    transition: background .22s;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 19px; height: 19px;
    left: 3px; top: 3px;
    background: white;
    border-radius: 50%;
    transition: transform .22s var(--ease);
    box-shadow: 0 1px 5px rgba(0,0,0,.15);
}
input:checked + .toggle-slider { background: var(--primary); }
input:checked + .toggle-slider::before { transform: translateX(19px); }

/* Voice recorder */
.voice-recorder {
    background: var(--bg-3);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: border-color .2s, background .2s;
}
.voice-recorder.recording { border-color: var(--rose); background: var(--rose-lt); }
.record-btn {
    width: 50px; height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--indigo), var(--violet));
    color: white;
    font-size: 20px;
    border: none;
    cursor: pointer;
    transition: all .2s var(--ease);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 3px 12px rgba(91,115,255,.35);
}
.record-btn:hover { transform: scale(1.1); }
.record-btn.active { background: linear-gradient(135deg, var(--rose), #FF6B6B); animation: recPulse 1s infinite; }
@keyframes recPulse { 0%,100%{ box-shadow: 0 0 0 0 rgba(244,63,94,.4); } 50%{ box-shadow: 0 0 0 10px rgba(244,63,94,0); } }

/* ============================================================
   TOAST
   ============================================================ */
.toast-container {
    position: fixed;
    bottom: 24px; left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex; flex-direction: column;
    gap: 8px; align-items: center;
    pointer-events: none;
}
.toast {
    background: var(--n-800);
    color: var(--n-0);
    padding: 10px 20px;
    border-radius: 22px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    animation: toastIn .3s var(--ease) both, toastOut .3s var(--ease) 2.8s both;
    pointer-events: none;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}
.toast::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.5); }
.toast.success { background: linear-gradient(135deg, var(--emerald), #0bc88e); }
.toast.error { background: linear-gradient(135deg, var(--rose), #ff5e7a); }

@keyframes toastIn { from{ opacity:0; transform:translateY(14px); } to{ opacity:1; transform:translateY(0); } }
@keyframes toastOut { from{ opacity:1; } to{ opacity:0; transform:translateY(-10px); } }

/* ============================================================
   LIVE BANNER
   ============================================================ */
.live-banner {
    position: fixed;
    top: var(--header-h);
    top: calc(var(--header-h) + 12px);
    right: 20px;
    max-width: 360px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: var(--shadow-md);
    z-index: 500;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    animation: bannerIn .35s var(--ease) both;
}
@keyframes bannerIn { from{ opacity:0; transform:translateX(30px); } to{ opacity:1; transform:translateX(0); } }
.live-banner-icon {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: var(--indigo-lt);
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; flex-shrink: 0;
}
.live-banner-body { flex: 1; min-width: 0; }
.live-banner-title { font-family: var(--font-display); font-size: 13.5px; font-weight: 700; margin-bottom: 2px; }
.live-banner-msg { font-size: 12px; color: var(--text-2); line-height: 1.5; }
.live-banner-time { font-size: 10px; color: var(--text-3); font-family: var(--font-mono); margin-top: 4px; }

/* ============================================================
   MOBILE NAV
   ============================================================ */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 64px;
    background: rgba(255,255,255,.95);
    border-top: 1px solid var(--border);
    z-index: 150;
    padding: 0 8px 4px;
    align-items: center;
    justify-content: space-around;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
.mobile-nav-item {
    display: flex; flex-direction: column;
    align-items: center; gap: 3px;
    padding: 6px 14px;
    border: none; background: none;
    color: var(--text-3);
    font-family: var(--font-body);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: color .15s;
    min-width: 52px;
}
.mobile-nav-item svg { width: 22px; height: 22px; }
.mobile-nav-item.active { color: var(--primary); }
.mobile-nav-item.add-btn {
    width: 48px; height: 48px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--indigo), var(--violet));
    color: white;
    box-shadow: 0 4px 14px rgba(91,115,255,.4);
    justify-content: center;
    font-size: 22px;
    padding: 0;
}

/* ============================================================
   AUTH PAGE
   ============================================================ */
.auth-page {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 24px;
    position: relative;
    overflow: hidden;
}
.auth-page::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -15%;
    width: 70%;
    aspect-ratio: 1;
    background: radial-gradient(circle, rgba(91,115,255,.07) 0%, transparent 70%);
    pointer-events: none;
}
.auth-page::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -10%;
    width: 55%;
    aspect-ratio: 1;
    background: radial-gradient(circle, rgba(139,92,246,.05) 0%, transparent 70%);
    pointer-events: none;
}
.auth-card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 44px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
    border: 1px solid var(--border);
}
.auth-logo {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 6px;
}
.auth-logo-icon {
    width: 44px; height: 44px;
    background: linear-gradient(135deg, var(--indigo), var(--violet));
    border-radius: 13px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 14px rgba(91,115,255,.35);
    color: white;
    font-size: 20px;
}
.auth-logo-text {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -.3px;
}
.auth-headline {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    margin: 22px 0 6px;
    letter-spacing: -.4px;
}
.auth-sub { font-size: 14px; color: var(--text-2); margin-bottom: 28px; }
.auth-tab-group {
    display: flex;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px;
    margin-bottom: 24px;
    gap: 4px;
}
.auth-tab {
    flex: 1;
    text-align: center;
    padding: 8px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all .18s;
    color: var(--text-3);
}
.auth-tab.active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}
.form-error {
    background: var(--rose-lt);
    color: var(--rose);
    border: 1px solid rgba(244,63,94,.2);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============================================================
   UTILS
   ============================================================ */
.text-sm { font-size: 13px; }

/* ============================================================
   RESPONSIVE — MOBILE
   ============================================================ */
@media (max-width: 768px) {
    .app-shell {
        grid-template-columns: 1fr;
        grid-template-rows: var(--header-h) 1fr;
    }
    .sidebar {
        display: none;
        position: fixed;
        top: var(--header-h); bottom: 64px; left: 0;
        width: 280px;
        z-index: 100;
        box-shadow: var(--shadow-lg);
    }
    .sidebar.open { display: flex; }
    .mobile-nav { display: flex; }
    .main-content { padding: 16px; padding-bottom: 84px; }
    .stats-bar { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
    .stat-card { padding: 14px; }
    .stat-number { font-size: 26px; }
    .reminder-grid { grid-template-columns: 1fr; gap: 10px; }
    .fab { display: flex; }
    .form-row { grid-template-columns: 1fr; }
    .modal-backdrop { align-items: flex-end; padding: 0; }
    .modal { max-width: 100%; border-radius: var(--radius-xl) var(--radius-xl) 0 0; max-height: 93dvh; }
    .sound-grid { grid-template-columns: repeat(3,1fr); }
    .header-user { display: none; }
    .ws-status span:last-child { display: none; }
    .reminder-actions { opacity: 1; }
}

@media (max-width: 480px) {
    .stats-bar { gap: 8px; }
    .stat-card { padding: 12px; }
    .stat-number { font-size: 22px; }
    .auth-card { padding: 32px 24px; }
    .category-mini-card { min-width: 120px; }
    .page-title { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
