/* ============================================================
   GRAPPLER — Jiu-Jitsu Gameplan Builder
   Mobile-Native Design System v2
   "Tactical Dojo" — warm, purposeful, native-app feel.
   ============================================================ */

/* --- Design Tokens --- */
:root {
    /* Accent — warm amber, martial-arts-meets-modern */
    --accent: #d97706;
    --accent-hover: #b45309;
    --accent-light: #fef3c7;
    --accent-glow: rgba(217, 119, 6, 0.15);
    --accent-glow-strong: rgba(217, 119, 6, 0.25);

    /* Sidebar */
    --sidebar-bg: #1c1917;
    --sidebar-text: #a8a29e;
    --sidebar-active: #fafaf9;

    /* Surfaces */
    --bg-page: #f5f0eb;
    --bg-card: #ffffff;
    --bg-subtle: #faf8f5;
    --bg-hover: #fef7ed;

    /* Bottom bar */
    --bottom-bar-bg: rgba(255, 255, 255, 0.92);
    --bottom-bar-border: rgba(231, 226, 220, 0.8);
    --bottom-bar-height: 64px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);

    /* Borders */
    --border-default: #e7e2dc;
    --border-subtle: #f0ebe5;

    /* Typography colors */
    --text-primary: #1c1917;
    --text-secondary: #5c5652;
    --text-tertiary: #a8a29e;

    /* Radii — more rounded for mobile-native feel */
    --card-radius: 1rem;
    --btn-radius: 0.625rem;
    --input-radius: 0.625rem;
    --pill-radius: 9999px;

    /* Shadows — layered warmth */
    --shadow: 0 1px 3px rgba(28, 25, 23, 0.06), 0 1px 2px rgba(28, 25, 23, 0.04);
    --shadow-md: 0 4px 16px rgba(28, 25, 23, 0.08), 0 2px 4px rgba(28, 25, 23, 0.04);
    --shadow-lg: 0 12px 40px rgba(28, 25, 23, 0.10), 0 4px 12px rgba(28, 25, 23, 0.05);
    --shadow-bottom-bar: 0 -1px 0 var(--bottom-bar-border), 0 -4px 16px rgba(28, 25, 23, 0.06);

    /* Touch targets */
    --touch-min: 44px;

    /* Transitions */
    --transition-fast: 120ms ease;
    --transition-normal: 180ms ease;
}

/* --- Base --- */
* { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: 'Instrument Sans', system-ui, -apple-system, sans-serif;
    background: var(--bg-page);
    margin: 0;
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Prevent elastic scrolling bounce on iOS */
    overflow-x: hidden;
    width: 100%;
}

/* --- Typography Headings --- */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.015em;
}

h1 { font-size: 2rem; line-height: 1.15; }
h4 { font-size: 1.35rem; line-height: 1.25; }
h6 { font-size: 0.85rem; letter-spacing: 0.04em; }

.fw-bold {
    font-weight: 700 !important;
}

/* --- Links --- */
a {
    color: var(--accent);
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-hover);
}

/* --- Page Entrance Animations --- */
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-body > * {
    animation: fadeSlideUp 0.35s ease both;
}

.page-body > *:nth-child(1) { animation-delay: 0.0s; }
.page-body > *:nth-child(2) { animation-delay: 0.05s; }
.page-body > *:nth-child(3) { animation-delay: 0.1s; }
.page-body > *:nth-child(4) { animation-delay: 0.15s; }
.page-body > *:nth-child(5) { animation-delay: 0.2s; }

/* ============================================================
   APP SHELL LAYOUT
   ============================================================ */

.app-shell {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
}

/* --- Desktop Sidebar --- */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.08);
    z-index: 1050;
}

.sidebar .brand {
    padding: 1.5rem 1.25rem 0.5rem;
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #fafaf9;
    text-decoration: none;
    display: block;
    letter-spacing: -0.02em;
}

.sidebar hr {
    border-color: rgba(255, 255, 255, 0.07);
    margin: 0.5rem 1rem;
}

.sidebar .nav-link {
    color: var(--sidebar-text);
    padding: 0.65rem 0.85rem;
    border-radius: 0.5rem;
    margin-bottom: 0.15rem;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
}

.sidebar .nav-link:hover {
    color: var(--sidebar-active);
    background: rgba(255, 255, 255, 0.07);
}

.sidebar .nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity var(--transition-normal);
}

.sidebar .nav-link:hover .nav-icon,
.sidebar .nav-link.active .nav-icon {
    opacity: 1;
}

.sidebar .nav-link.active {
    background: rgba(217, 119, 6, 0.12);
    color: #fbbf24;
    font-weight: 600;
}

/* Admin dropdown in sidebar */
.sidebar .dropdown-menu {
    background: #292524;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.5rem;
    margin-top: 0.25rem;
    padding: 0.35rem;
    box-shadow: var(--shadow-lg);
}

.sidebar .dropdown-menu .dropdown-item {
    color: var(--sidebar-text);
    border-radius: 0.35rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    transition: all 0.15s ease;
}

.sidebar .dropdown-menu .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--sidebar-active);
}

.sidebar .dropdown-toggle::after {
    filter: brightness(2);
}

/* Sidebar footer (logout on desktop) */
.sidebar-footer {
    padding: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

/* --- Main Content --- */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
}

/* --- Page Body --- */
.page-body {
    flex: 1;
    padding: 1.25rem;
    max-width: 1200px;
    width: 100%;
    /* Critical: space for bottom tab bar on mobile */
    padding-bottom: calc(var(--bottom-bar-height) + var(--safe-bottom) + 1.25rem);
}

/* ============================================================
   MOBILE BOTTOM TAB BAR
   ============================================================ */

.bottom-bar {
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    height: calc(var(--bottom-bar-height) + var(--safe-bottom));
    background: var(--bottom-bar-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--bottom-bar-border);
    box-shadow: var(--shadow-bottom-bar);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    padding-bottom: var(--safe-bottom);
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 0.4rem 0.15rem;
    padding-bottom: calc(0.4rem + var(--safe-bottom));
    text-decoration: none;
    color: var(--text-tertiary);
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: color var(--transition-fast);
    position: relative;
    min-width: var(--touch-min);
    min-height: var(--touch-min);
    cursor: pointer;
    border: none;
    background: none;
    /* Touch feedback */
    -webkit-tap-highlight-color: transparent;
}

.tab-item:active {
    transform: scale(0.9);
}

.tab-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.tab-label {
    line-height: 1;
}

.tab-item.active {
    color: var(--accent);
}

.tab-item.active .tab-icon {
    transform: translateY(-1px);
}

/* Active indicator line */
.tab-item.active::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
}

.tab-item:hover:not(.active) {
    color: var(--text-secondary);
}

/* Badge on tab (notification count) */
.tab-badge {
    position: absolute;
    top: 2px;
    right: calc(50% - 16px);
    background: #dc2626;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 15px;
    height: 15px;
    border-radius: 7.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3.5px;
    line-height: 1;
    border: 2px solid var(--bottom-bar-bg);
}

.tab-badge:empty {
    display: none;
}

/* "More" popup menu */
.bottom-more-menu {
    position: fixed;
    bottom: calc(var(--bottom-bar-height) + var(--safe-bottom) + 8px);
    right: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-lg);
    padding: 0.35rem;
    min-width: 180px;
    z-index: 1060;
    display: none;
    animation: moreFadeIn 0.15s ease;
}

.bottom-more-menu.show {
    display: block;
}

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

.more-menu-item {
    display: block;
    border-radius: 0.5rem;
    padding: 0.6rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    transition: all var(--transition-fast);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    min-height: var(--touch-min);
    display: flex;
    align-items: center;
}

.more-menu-item:hover,
.more-menu-item:focus {
    background: var(--bg-hover);
    color: var(--accent);
}

.more-divider {
    margin: 0.25rem 0;
    border: none;
    border-top: 1px solid var(--border-subtle);
}

.more-menu-form {
    margin: 0;
}

/* ============================================================
   COMPONENTS
   ============================================================ */

/* --- Cards --- */
.card {
    border: 1px solid var(--border-subtle);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow);
    background: var(--bg-card);
    transition: box-shadow var(--transition-normal);
    overflow: hidden;
}

/* --- Buttons --- */
.btn {
    font-family: 'Instrument Sans', sans-serif;
    font-weight: 600;
    border-radius: var(--btn-radius);
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    /* Touch-friendly minimum height */
    min-height: var(--touch-min);
    padding: 0.5rem 1.25rem;
    /* Touch feedback */
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
}

/* Haptic-like press effect */
.btn:active {
    transform: scale(0.97);
}

.btn-accent {
    background: var(--accent);
    color: #fff;
    border: none;
    box-shadow: 0 1px 3px rgba(217, 119, 6, 0.2);
}

.btn-accent:hover {
    background: var(--accent-hover);
    color: #fff;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.25);
    transform: translateY(-1px);
}

.btn-accent:active {
    transform: scale(0.97) translateY(0);
}

.btn-accent-outline {
    background: transparent;
    color: var(--accent);
    border: 1.5px solid var(--accent);
}

.btn-accent-outline:hover {
    background: var(--accent-light);
    color: var(--accent-hover);
    box-shadow: 0 2px 8px var(--accent-glow);
}

/* Bootstrap secondary button restyle */
.btn-outline-secondary {
    border-color: var(--border-default);
    color: var(--text-secondary);
    background: var(--bg-subtle);
    font-weight: 500;
    border-radius: var(--btn-radius);
}

.btn-outline-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--bg-hover);
}

.btn-outline-secondary.active,
.btn-outline-secondary:active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.btn-outline-secondary:active:not(.active) {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

/* Small button touch-friendly */
.btn-sm {
    min-height: 36px;
    padding: 0.4rem 0.85rem;
    font-size: 0.82rem;
    border-radius: calc(var(--btn-radius) - 2px);
}

.btn-lg {
    padding: 0.7rem 1.75rem;
    font-size: 1rem;
    border-radius: calc(var(--btn-radius) + 2px);
    min-height: 52px;
}

/* Link-style button (for logout etc.) */
.btn-link {
    text-decoration: none;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.btn-link:hover {
    color: var(--accent);
}

/* --- Bootstrap Alert restyle --- */
.alert {
    border-radius: var(--card-radius);
    border: 1px solid var(--border-default);
    font-size: 0.9rem;
}

.alert-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.alert-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

/* ============================================================
   TABLES
   ============================================================ */

.table thead th {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    border-bottom: 2px solid var(--border-default);
    background: transparent;
    padding: 0.85rem 1rem;
    font-family: 'Instrument Sans', sans-serif;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-size: 0.925rem;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover {
    background: var(--bg-hover);
}

/* Tags stack */
.tags-stack {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.table tbody td a.text-decoration-none {
    color: var(--text-primary);
    font-weight: 500;
    transition: color var(--transition-fast);
    position: relative;
}

.table tbody td a.text-decoration-none:hover {
    color: var(--accent);
}

/* --- Equal-width action buttons --- */
.list-actions {
    display: flex;
    gap: 0.5rem;
}

.list-actions .btn-sm {
    flex: 1;
    text-align: center;
}

.list-action-form {
    display: inline;
    flex: 1;
}

.list-action-form .btn-sm {
    width: 100%;
}

/* --- Badges --- */
.badge-domain {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.3em 0.7em;
    border-radius: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-variation {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.25em 0.6em;
    border-radius: 0.35rem;
    background: var(--bg-page);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

/* Badge alignment in mobile card view */
.table-responsive-card tbody td .badge {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    padding: 0.25em 0.55em;
    line-height: 1.3;
}

/* --- Domain badge color coding --- */
.badge-domain.domain-grip { background: #fef3c7; color: #92400e; }
.badge-domain.domain-takedown { background: #dbeafe; color: #1e40af; }
.badge-domain.domain-guard { background: #dcfce7; color: #166534; }
.badge-domain.domain-mount { background: #fce7f3; color: #9d174d; }
.badge-domain.domain-back { background: #e0e7ff; color: #3730a3; }
.badge-domain.domain-side { background: #f3e8ff; color: #6b21a8; }
.badge-domain.domain-neutral { background: #f1f5f9; color: #475569; }

/* Fallback for unmapped domains */
.badge-domain.bg-light {
    background: #f5f0eb !important;
    color: #5c5652 !important;
    border: 1px solid var(--border-subtle);
}

/* --- Orientation arrows --- */
.orientation-arrow {
    color: var(--text-tertiary);
    font-size: 0.9rem;
    margin: 0 0.25rem;
}

/* ============================================================
   FORMS
   ============================================================ */

.form-label {
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-control,
.form-select {
    border: 1.5px solid var(--border-default);
    border-radius: var(--input-radius);
    padding: 0.6rem 0.9rem;
    font-size: 0.925rem;
    color: var(--text-primary);
    background: var(--bg-card);
    transition: all var(--transition-fast);
    min-height: var(--touch-min);
}

.form-control:hover,
.form-select:hover {
    border-color: #d4cdc4;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-control::placeholder {
    color: var(--text-tertiary);
}

.form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

/* Required field indicator */
.text-danger {
    color: #dc2626 !important;
    font-size: 0.75em;
}

.form-text {
    font-size: 0.78rem;
    color: var(--text-tertiary);
}

/* ============================================================
   SEARCH BAR
   ============================================================ */

.search-bar {
    background: var(--bg-card);
    border-radius: var(--card-radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow);
    position: relative;
    z-index: 100;
}

/* -- Custom Dropdown Select (replaces native select for stacking) -- */
.custom-select {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    border: 1.5px solid var(--border-default);
    border-radius: var(--input-radius);
    padding: 0.6rem 2rem 0.6rem 0.9rem;
    font-size: 0.925rem;
    color: var(--text-primary);
    background: var(--bg-card);
    min-height: var(--touch-min);
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    user-select: none;
}

.custom-select-trigger::after {
    content: '';
    position: absolute;
    right: 0.75rem;
    top: 50%;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--text-tertiary);
    transition: transform var(--transition-fast);
}

.custom-select-trigger[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

.custom-select-trigger:hover {
    border-color: #d4cdc4;
}

.custom-select-trigger[aria-expanded="true"] {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.custom-select-options {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1.5px solid var(--accent);
    border-radius: var(--input-radius);
    box-shadow: 0 0 0 3px var(--accent-glow), var(--shadow-lg);
    max-height: 220px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.custom-select-options.open {
    display: block;
}

.custom-select-options.flip-up {
    top: auto;
    bottom: calc(100% + 4px);
}

.custom-select-option {
    padding: 0.55rem 0.9rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    min-height: 40px;
    display: flex;
    align-items: center;
}

.custom-select-option:hover {
    background: var(--bg-hover);
    color: var(--accent);
}

.custom-select-option.selected {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 600;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-tertiary);
    background: var(--bg-card);
    border: 2px dashed var(--border-subtle);
    border-radius: var(--card-radius);
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.empty-state h5 {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-tertiary);
    font-size: 0.925rem;
}

/* ============================================================
   DETAIL PAGE
   ============================================================ */

.detail-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    margin-bottom: 0.25rem;
}

.detail-value {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    line-height: 1.65;
}

.detail-section {
    margin-bottom: 2rem;
}

/* ============================================================
   TOAST
   ============================================================ */

.toast-container {
    position: fixed;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    z-index: 9999;
    animation: slideInTop 0.3s ease;
}

@keyframes slideInTop {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ============================================================
   PAGINATION
   ============================================================ */

.pagination .page-link {
    color: var(--text-secondary);
    border-radius: var(--btn-radius);
    margin: 0 0.15rem;
    border: 1.5px solid var(--border-default);
    padding: 0.45rem 0.85rem;
    font-weight: 500;
    font-size: 0.875rem;
    background: var(--bg-card);
    transition: all var(--transition-fast);
    min-height: var(--touch-min);
    min-width: var(--touch-min);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pagination .page-link:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
    color: var(--accent);
}

.pagination .page-item.active .page-link {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 2px 8px var(--accent-glow);
}

.pagination .page-item.disabled .page-link {
    opacity: 0.4;
    pointer-events: none;
}

/* ============================================================
   GAME PLAN TECHNIQUE LIST
   ============================================================ */

.technique-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.technique-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    padding-bottom: 2.5rem;
    border: 1.5px solid var(--border-subtle);
    border-radius: 0.875rem;
    background: #fff;
    transition: all var(--transition-normal);
    cursor: grab;
    position: relative;
}

.technique-item:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    background: var(--bg-hover);
}

.technique-item.dragging {
    opacity: 0.5;
    border-color: var(--accent);
    background: var(--accent-light);
}

.technique-item.drag-over {
    border-top: 3px solid var(--accent);
}

.technique-item:active { cursor: grabbing; }

.technique-item-drag-handle {
    color: var(--border-default);
    cursor: grab;
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    padding-top: 0.25rem;
    transition: color var(--transition-fast);
}

.technique-item:hover .technique-item-drag-handle {
    color: var(--text-tertiary);
}

/* Body: header row + fields row */
.technique-item-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Header row: technique name + delete button */
.technique-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.technique-item-name {
    flex: 1;
    min-width: 0;
    word-break: break-word;
    font-weight: 600;
    color: var(--text-primary);
}

.technique-item-orientation {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.technique-item-notes {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    font-style: italic;
}

/* Fields row */
.technique-item-fields {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-subtle);
}

.technique-field {
    flex: 1;
    min-width: 0;
}

.technique-notes-input {
    width: 100%;
}

.technique-confidence-select {
    max-width: 100%;
}

/* Domain badge floating bottom-right */
.technique-item-domain {
    position: absolute;
    bottom: 0.65rem;
    right: 0.75rem;
    font-size: 0.68rem;
    opacity: 0.65;
    pointer-events: none;
}

/* Delete button */
.technique-delete-btn {
    color: var(--border-default);
    padding: 0.5rem;
    transition: color var(--transition-fast);
    flex-shrink: 0;
    min-width: var(--touch-min);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.technique-delete-btn:hover { color: #ef4444; }

/* Legacy technique-item-actions */
.technique-item-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.technique-item-actions .notes-input {
    font-size: 0.82rem;
    padding: 0.3rem 0.5rem;
}

.technique-item-actions .notes-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.technique-item-actions .btn {
    color: var(--border-default);
    padding: 0.5rem;
    transition: color var(--transition-fast);
    min-width: var(--touch-min);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.technique-item-actions .btn:hover { color: #ef4444; }

/* Notes input focus */
.technique-notes-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

/* ============================================================
   TECHNIQUE DETAIL ROWS
   ============================================================ */

.technique-row {
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-subtle);
    position: relative;
}

.technique-row:last-child { border-bottom: none; }

.technique-row-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.technique-row-name {
    min-width: 0;
    word-break: break-word;
    font-weight: 600;
    color: var(--text-primary);
}

.technique-row-name a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.technique-row-name a:hover {
    color: var(--accent);
}

.technique-row-badges {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

.technique-row-notes {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 0.35rem;
    width: 100%;
}

.technique-row-confidence {
    margin-top: 0.25rem;
}

.technique-row-domain {
    position: absolute;
    bottom: 0.5rem;
    right: 0;
    font-size: 0.68rem;
    opacity: 0.65;
    pointer-events: none;
}

/* Technique row video thumbnail (game plan detail) */
.technique-row-thumb-link {
    display: inline-block;
    width: 100%;
    max-width: 280px;
    margin-bottom: 0.5rem;
}

.technique-row-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--card-radius, 0.5rem);
    overflow: hidden;
    background: var(--bg-page, #f5f0eb);
}

.technique-row-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--transition-normal, 200ms);
}

.technique-row-thumb-link:hover .technique-row-thumb img {
    transform: scale(1.03);
}

.technique-row-thumb .technique-thumb-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.technique-row-thumb .video-thumb-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 150ms;
}

.technique-row-thumb-link:hover .video-thumb-play-overlay {
    opacity: 1;
}

.technique-row-thumb .video-thumb-play-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
}

@media (max-width: 575.98px) {
    .technique-row-thumb-link {
        max-width: 200px;
    }
}

.technique-notes {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-left: auto;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================================
   TECHNIQUE PICKER
   ============================================================ */

.picker-search input {
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
}

.picker-results {
    border: 1px solid var(--border-default);
    border-radius: 0.75rem;
    background: #fff;
}

.picker-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--transition-fast);
    min-height: var(--touch-min);
}

.picker-item:last-child { border-bottom: none; }
.picker-item:hover { background: var(--bg-hover); }

.picker-item.disabled {
    opacity: 0.6;
    cursor: default;
}

.picker-item.disabled button { display: none; }

.picker-item-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.picker-item-info .badge { flex-shrink: 0; }

.picker-orientation {
    font-size: 0.78rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

/* ============================================================
   ORIENTATION FLOW
   ============================================================ */

.orientation-flow {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.orientation-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.orientation-dot.primary { background: var(--accent); }
.orientation-dot.secondary { background: var(--border-default); }

/* ============================================================
   STICKY SIDEBAR (Edit page)
   ============================================================ */

.sticky-top-gameplan {
    position: sticky;
    top: 1rem;
    align-self: start;
}

/* ============================================================
   TECHNIQUE SEARCH MODAL
   ============================================================ */

.technique-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    z-index: 1040;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.technique-search-modal {
    background: #fff;
    border-radius: var(--card-radius) var(--card-radius) 0 0;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: sheetSlideUp 0.3s ease;
}

@keyframes sheetSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.technique-search-modal .modal-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.technique-search-modal .modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1;
}

.technique-search-modal .modal-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border-subtle);
}

/* ============================================================
   GAME PLAN SECTION CARDS
   ============================================================ */

/* Override .card's overflow:hidden so custom-select dropdowns can escape the card bounds */
.gp-section-card {
    overflow: visible;
}

/* ============================================================
   GROUP MODAL (Add / Rename)
   ============================================================ */

.gp-group-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    z-index: 1040;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.gp-group-modal {
    background: var(--bg-card);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 480px;
    border: 1px solid var(--border-default);
    animation: modalScaleIn 0.2s ease;
}

@keyframes modalScaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.gp-group-modal-header {
    border-bottom: 1px solid var(--border-subtle);
}

.gp-group-modal-body {
    padding-top: 0.5rem;
}

.gp-group-modal-footer {
    border-top: 1px solid var(--border-subtle);
    padding-top: 0.75rem;
}

/* ============================================================
   SPINNER
   ============================================================ */

.spinner-border {
    color: var(--accent);
}

/* ============================================================
   HR DIVIDER
   ============================================================ */

hr {
    border-color: var(--border-subtle);
    opacity: 1;
}

.card hr {
    margin: 1.5rem 0;
}

/* Override Bootstrap reboot margin on header separator hr elements */
.page-body > hr {
    margin: 0;
}

/* Copy button pinned inside share URL input */
.copy-share-url-btn {
    position: absolute;
    top: 50%;
    right: 1px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2rem;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 0 var(--input-radius) var(--input-radius) 0;
}

.copy-share-url-btn:hover {
    color: var(--accent);
}

/* ============================================================
   DROPDOWN MENU (General)
   ============================================================ */

.dropdown-menu {
    border: 1px solid var(--border-subtle);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-lg);
    padding: 0.35rem;
    background: #fff;
    z-index: 9999;
}

.dropdown-menu .dropdown-item {
    border-radius: 0.5rem;
    font-size: 0.875rem;
    padding: 0.55rem 0.75rem;
    transition: all var(--transition-fast);
    color: var(--text-primary);
}

.dropdown-menu .dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--accent);
}

.dropdown-menu .dropdown-item-text {
    padding: 0.45rem 0.75rem;
    font-size: 0.82rem;
}

.dropdown-divider {
    margin: 0.25rem 0;
    border-color: var(--border-subtle);
}

.dropdown-header {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    font-weight: 600;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */

.login-page-bg {
    background: linear-gradient(160deg, #1c1917 0%, #292524 40%, #3d3630 100%);
}

.login-brand {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 2rem;
    font-weight: 700;
    color: #fafaf9;
    letter-spacing: -0.02em;
}

.login-subtitle {
    color: var(--sidebar-text);
    font-size: 0.95rem;
}

.login-card {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-lg);
}

/* ============================================================
   HOME PAGE HERO
   ============================================================ */

.hero-section {
    text-align: center;
    padding: 2rem 1rem;
}

.hero-title {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 520px;
    margin: 0 auto 2rem;
    line-height: 1.65;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.hero-actions .btn {
    flex: 1 1 auto;
    max-width: 280px;
    text-align: center;
}

/* ============================================================
   PAGE HEADER (Title + CTA)
   ============================================================ */

.page-header {
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.page-title {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    margin: 0;
    color: var(--text-primary);
}

/* ============================================================
   TECHNIQUE CARD GRID (Browse page with thumbnails)
   ============================================================ */

.techniques-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.technique-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: box-shadow var(--transition-normal), transform var(--transition-fast);
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.technique-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.technique-thumb-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--bg-page);
    overflow: hidden;
}

.technique-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--transition-normal);
}

.technique-card:hover .technique-thumb {
    transform: scale(1.03);
}

.technique-thumb-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-page) 0%, var(--bg-subtle) 100%);
    color: var(--text-tertiary);
    font-size: 2rem;
}

.technique-thumb-fallback svg {
    width: 48px;
    height: 48px;
    opacity: 0.4;
}

.technique-card-body {
    padding: 1rem 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    flex: 1;
}

.technique-card-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    text-decoration: none;
    display: block;
    line-height: 1.35;
    transition: color var(--transition-fast);
}

.technique-card-name:hover {
    color: var(--accent);
}

.technique-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.technique-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.5rem;
}

.technique-card-actions .btn-sm {
    flex: 1;
    text-align: center;
}

/* Video host badge on fallback placeholder */
.video-host-badge {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.15em 0.5em;
    border-radius: 0.25rem;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
}

/* ============================================================
   DETAIL PAGE — Video Thumbnail Preview
   ============================================================ */

.video-thumb-preview {
    position: relative;
    width: 100%;
    max-width: 640px;
    aspect-ratio: 16 / 9;
    border-radius: var(--card-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    margin-bottom: 1rem;
    cursor: pointer;
}

.video-thumb-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--transition-normal), filter var(--transition-normal);
}

.video-thumb-preview:hover img {
    transform: scale(1.03);
    filter: brightness(0.85);
}

.video-thumb-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.15);
    transition: background var(--transition-normal);
}

.video-thumb-preview:hover .video-thumb-play-overlay {
    background: rgba(0, 0, 0, 0.25);
}

.video-thumb-play-icon {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    transition: transform var(--transition-fast);
}

.video-thumb-preview:hover .video-thumb-play-icon {
    transform: scale(1.1);
}

.video-thumb-play-icon svg {
    width: 28px;
    height: 28px;
    color: var(--accent);
    margin-left: 3px;
}

/* ============================================================
   NOTIFICATIONS
   ============================================================ */

.notification-unread {
    background: var(--accent-light) !important;
    border-left: 3px solid var(--accent);
}

/* Notification card-style items */
.notification-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.notification-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--card-radius);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow);
    transition: box-shadow var(--transition-normal);
}

.notification-card:hover {
    box-shadow: var(--shadow-md);
}

.notification-type-badge {
    font-size: 1.1rem;
    line-height: 1;
}

/* Bell badge for unread count (sidebar version) */
.notification-badge-count {
    background: #dc2626;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.15em 0.45em;
    border-radius: 9999px;
    margin-left: 0.25rem;
    line-height: 1;
    vertical-align: middle;
}

.notification-badge-count:empty {
    display: none;
}

/* ============================================================
   SELECTION
   ============================================================ */

::selection {
    background: var(--accent-light);
    color: var(--text-primary);
}

/* ============================================================
   GAMEPLAN DETAIL — Header with Back + Actions
   ============================================================ */

.gameplan-detail-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.detail-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--touch-min);
    height: var(--touch-min);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 50%;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    min-width: 0;
}

.detail-back-btn:hover {
    color: var(--accent);
    background: var(--bg-hover);
}

.detail-back-btn:active {
    transform: scale(0.92);
}

.detail-back-btn svg {
    width: 20px;
    height: 20px;
}

.detail-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

.detail-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--touch-min);
    height: var(--touch-min);
    color: var(--text-secondary);
    background: none;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 0;
    -webkit-tap-highlight-color: transparent;
}

.detail-action-btn:hover {
    color: var(--accent);
    background: var(--bg-hover);
}

.detail-action-btn:active {
    transform: scale(0.92);
}

.detail-action-btn svg {
    width: 20px;
    height: 20px;
}

/* ============================================================
   TRAINING LOG — Rating Badges
   ============================================================ */

.rating-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.82rem;
    font-weight: 500;
    padding: 0.25em 0.6em;
    border-radius: 0.35rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
}

/* ============================================================
   TRAINING SESSIONS — Filter Row
   ============================================================ */

.filter-row {
    flex-wrap: nowrap;
    position: relative;
    z-index: 100;
}

.filter-mobile .form-select {
    width: 100%;
    font-size: 16px;
}

/* ============================================================
   TRAINING ANALYTICS — Monthly Chart
   ============================================================ */

.monthly-chart {
    display: flex;
    align-items: flex-end;
    gap: 0.25rem;
    height: 200px;
    padding: 0 0.5rem;
    overflow-x: auto;
}

.month-bar-wrapper {
    flex: 1;
    min-width: 32px;
    max-width: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    gap: 0.25rem;
}

.month-bar {
    width: 100%;
    min-height: 4px;
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-hover) 100%);
    border-radius: 0.25rem 0.25rem 0 0;
    position: relative;
    transition: background var(--transition-fast);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 4px;
}

.month-bar:hover {
    background: linear-gradient(180deg, var(--accent-hover) 0%, #92400e 100%);
}

.month-bar-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
}

.month-label {
    font-size: 0.68rem;
    color: var(--text-tertiary);
    text-align: center;
    white-space: nowrap;
    margin-top: 0.25rem;
}

/* ============================================================
   DASHBOARD — Home Page
   ============================================================ */

/* Summary cards (compact cards for dashboard) */
.dashboard-summary-card {
    border: 1px solid var(--border-subtle);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow);
    background: var(--bg-card);
    transition: box-shadow var(--transition-normal);
}

.dashboard-summary-card:hover {
    box-shadow: var(--shadow-md);
}

.dashboard-summary-value {
    font-size: 1.75rem;
    font-family: 'Fraunces', Georgia, serif;
    line-height: 1.2;
}

.dashboard-summary-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    margin-top: 0.15rem;
}

/* Spotlight card (most practiced this week) */
.dashboard-spotlight-card {
    border: 1px solid var(--accent);
    border-left: 4px solid var(--accent);
    background: var(--accent-light);
}

.dashboard-spotlight-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
}

.dashboard-spotlight-name {
    font-size: 1.25rem;
    font-weight: 700;
    font-family: 'Fraunces', Georgia, serif;
    color: var(--text-primary);
    display: block;
    line-height: 1.3;
    transition: color var(--transition-fast);
}

.dashboard-spotlight-name:hover {
    color: var(--accent);
}

.dashboard-spotlight-count {
    color: var(--text-secondary);
}

/* Recent techniques list items */
.dashboard-recent-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    color: var(--text-primary);
    transition: background var(--transition-fast);
    border-bottom: 1px solid var(--border-subtle);
    gap: 0.75rem;
}

.dashboard-recent-item:last-child {
    border-bottom: none;
}

.dashboard-recent-item:hover {
    background: var(--bg-hover);
}

.dashboard-recent-name {
    font-weight: 500;
    font-size: 0.925rem;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Responsive tweaks for dashboard cards */
@media (max-width: 575.98px) {
    .dashboard-summary-value {
        font-size: 1.5rem;
    }

    .dashboard-greeting h1.page-title {
        font-size: 1.5rem;
    }

    .monthly-chart {
        height: 160px;
    }
}

*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

*:focus {
    outline: none;
}

/* ============================================================
   RESPONSIVE: Mobile First — Tablet and Desktop
   ============================================================ */

@media (min-width: 576px) {
    h1 { font-size: 2.25rem; }
    h4 { font-size: 1.5rem; }

    .page-body {
        padding: 1.5rem;
        padding-bottom: calc(var(--bottom-bar-height) + var(--safe-bottom) + 1.5rem);
    }

    .techniques-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .technique-search-modal {
        border-radius: var(--card-radius);
        margin: 1rem auto;
        align-self: center;
    }

    .technique-search-overlay {
        align-items: center;
    }

    .search-bar {
        padding: 1.5rem;
    }

    .hero-section {
        padding: 3rem 1.5rem;
    }

    .hero-title {
        font-size: 2.75rem;
    }

    .hero-subtitle {
        font-size: 1.15rem;
    }
}

@media (min-width: 769px) {
    /* Hide bottom tab bar on desktop */
    .bottom-bar {
        display: none !important;
    }

    /* Remove extra bottom padding from page body on desktop */
    .page-body {
        padding: 2rem;
        padding-bottom: 2rem;
    }

    .techniques-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.25rem;
    }

    .toast-container {
        top: 5rem;
        right: 1.5rem;
        left: auto;
    }
}

/* ============================================================
   RESPONSIVE: Small phones (max-width: 400px)
   ============================================================ */

@media (max-width: 400px) {
    .page-body {
        padding: 0.75rem;
        padding-bottom: calc(var(--bottom-bar-height) + var(--safe-bottom) + 0.75rem);
    }

    .page-title {
        font-size: 1.3rem;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .search-bar {
        padding: 1rem;
    }

    .empty-state {
        padding: 2rem 1rem;
    }

    .pagination .page-link {
        padding: 0.35rem 0.6rem;
        font-size: 0.8rem;
        min-width: 40px;
        min-height: 40px;
    }
}

/* ============================================================
   UTILITY HELPERS
   ============================================================ */

/* Full-width buttons on mobile */
@media (max-width: 768px) {
    /* Hide desktop sidebar on mobile — bottom tab bar replaces it */
    .sidebar {
        display: none !important;
    }

    .mobile-full-width {
        width: 100% !important;
        text-align: center;
    }

    /* Stack flex children on mobile */
    .mobile-stack > * {
        flex-basis: 100% !important;
        max-width: 100% !important;
    }

    /* Filter row — dropdown fills available space on mobile */
    .filter-row {
        gap: 0.5rem;
    }

    .filter-mobile .form-select {
        flex: 1 1 auto;
        min-width: 0;
    }

    /* Table card mode on mobile */
    .table-responsive-card thead {
        display: none;
    }

    .table-responsive-card tbody tr {
        display: block;
        padding: 1rem;
        margin-bottom: 0.5rem;
        border: 1px solid var(--border-subtle);
        border-radius: var(--card-radius);
        background: #fff;
        box-shadow: var(--shadow);
    }

    .table-responsive-card tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.6rem 0;
        border-bottom: 1px solid var(--border-subtle);
    }

    .table-responsive-card tbody td:last-child {
        border-bottom: none;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .table-responsive-card tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: var(--text-tertiary);
        min-width: 80px;
    }

    /* Card padding on mobile */
    .card.p-4,
    .card.p-md-5 {
        padding: 1.25rem !important;
    }

    /* Technique item layout on mobile */
    .technique-item {
        flex-wrap: wrap;
    }

    .technique-item-body {
        width: 100%;
    }

    .technique-item-header {
        width: 100%;
    }

    .technique-item-fields {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .technique-row {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .technique-notes {
        max-width: 100%;
        margin-left: 0;
        margin-top: 0.25rem;
    }

    .sticky-top-gameplan {
        position: static !important;
    }

    .edit-page-main {
        width: 100%;
        min-width: 0;
    }

    .edit-page-sidebar {
        width: 100%;
        flex-basis: 100% !important;
    }

    /* Form labels bigger on mobile for readability */
    .form-label {
        font-size: 0.85rem;
    }

    /* Prevent iOS zoom on input focus */
    .form-control,
    .form-select {
        font-size: 16px !important;
    }

    .d-flex.gap-2 > * {
        flex: 1 1 0;
    }
}

/* --- Section Title in Cards --- */
.card-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 1rem;
}

/* --- Share URL success card --- */
.share-success-card {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.share-success-text {
    color: #166534;
}

/* --- Admin badge --- */
.badge-admin {
    background: #fef2f2;
    color: #991b1b;
}

/* --- Pre-wrapped text (for descriptions etc.) --- */
.text-pre-wrap {
    white-space: pre-wrap;
}

/* --- Video player embed wrapper --- */
.video-player-wrapper {
    border-radius: var(--card-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.video-player-wrapper.hidden-player {
    display: none;
}

/* --- Section position badge --- */
.section-position-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.3em 0.7em;
    border-radius: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--bg-subtle);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

/* --- Description text (pre-wrap for detail pages) --- */
.description-text {
    white-space: pre-wrap;
    line-height: 1.65;
}

/* --- Small icon for compact buttons --- */
.icon-sm {
    width: 14px;
    height: 14px;
}

/* --- Medium icon for modals etc. --- */
.icon-md {
    width: 16px;
    height: 16px;
}

/* --- Accent text color utility (replaces Bootstrap text-primary) --- */
.text-accent {
    color: var(--accent) !important;
}

/* --- Shared Utility Classes --- */

/* Detail header row — replaces inline "display: flex; align-items: center; width: 100%;" */
.detail-header-row {
    display: flex;
    align-items: center;
    width: 100%;
}

/* Card max-width constraints — replaces inline style="max-width: ..." */
.card-max-md {
    max-width: 700px;
}

.card-max-sm {
    max-width: 600px;
}

/* Notes table cell — replaces inline style="max-width: 200px;" */
.notes-cell {
    max-width: 200px;
}

/* Smooth scroll globally */
html {
    scroll-behavior: smooth;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
}
