/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    color-scheme: light;
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --input-bg: #f8fafc;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

[data-theme="dark"] {
    color-scheme: dark;
    --primary-color: #60a5fa;
    --secondary-color: #94a3b8;
    --success-color: #34d399;
    --warning-color: #fbbf24;
    --danger-color: #f87171;
    --info-color: #60a5fa;
    --bg-color: #0b1120;
    --card-bg: #111827;
    --input-bg: #1e293b;
    --text-color: #e5e7eb;
    --text-muted: #94a3b8;
    --border-color: #1f2937;
    --shadow: 0 1px 3px 0 rgb(15 23 42 / 0.45), 0 1px 2px -1px rgb(15 23 42 / 0.45);
    --shadow-lg: 0 10px 15px -3px rgb(15 23 42 / 0.45), 0 4px 6px -4px rgb(15 23 42 / 0.45);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Header */
.main-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.logo span {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.main-nav {
    display: flex;
    gap: 1rem;
    flex: 1;
    justify-content: center;
    align-items: center;
}

.nav-group {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-group-toggle {
    display: inline-flex;
    align-items: center;
    line-height: 1;
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    color: var(--text-color);
    cursor: pointer;
    font: inherit;
    transition: all 0.2s;
}

.nav-group-toggle:hover {
    background-color: var(--bg-color);
    color: var(--primary-color);
}

.nav-group-toggle.active {
    background-color: var(--primary-color);
    color: white;
}

.nav-group-menu {
    position: absolute;
    top: 100%;
    left: 0;
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 200px;
    padding: 0.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    z-index: 200;
}

.nav-group-menu a {
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
}

.nav-group:hover .nav-group-menu,
.nav-group:focus-within .nav-group-menu {
    display: flex;
}

.nav-wrap {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex: 1;
    justify-content: space-between;
    width: 100%;
}

.burger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: #fff;
    cursor: pointer;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    cursor: pointer;
    box-shadow: var(--shadow);
}

.theme-toggle:hover {
    color: var(--primary-color);
}

.theme-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
}

.theme-icon svg {
    width: 100%;
    height: 100%;
}

.theme-icon-moon {
    display: none;
}

[data-theme="dark"] .theme-icon-sun {
    display: none;
}

[data-theme="dark"] .theme-icon-moon {
    display: inline-flex;
}

.burger-btn span {
    display: block;
    height: 2px;
    width: 20px;
    background: var(--text-color);
    border-radius: 2px;
    margin: 0 auto;
}

.main-nav a {
    display: inline-flex;
    align-items: center;
    line-height: 1;
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--text-color);
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.main-nav a:hover {
    background-color: var(--bg-color);
    color: var(--primary-color);
}

.main-nav a.active {
    background-color: var(--primary-color);
    color: white;
}

.main-nav .main-nav-theme {
    flex-shrink: 0;
    align-self: center;
    margin-left: 0.35rem;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Container */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
}

.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--text-muted);
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 1.25rem;
}

.card-body {
    padding: 1.5rem;
}

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-content h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-content p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.stat-card.stat-success { border-left: 4px solid var(--success-color); }
.stat-card.stat-warning { border-left: 4px solid var(--warning-color); }
.stat-card.stat-danger { border-left: 4px solid var(--danger-color); }
.stat-card.stat-info { border-left: 4px solid var(--info-color); }

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 2rem;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background-color: var(--bg-color);
}

.table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table td {
    padding: 0.75rem;
    border-top: 1px solid var(--border-color);
}

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

.table a {
    color: var(--primary-color);
    text-decoration: none;
}

.table a:hover {
    text-decoration: underline;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-draft { background-color: #e2e8f0; color: #475569; }
.badge-sent { background-color: #dbeafe; color: #1e40af; }
.badge-paid { background-color: #d1fae5; color: #065f46; }
.badge-overdue { background-color: #fee2e2; color: #991b1b; }
.badge-cancelled { background-color: #f1f5f9; color: #64748b; }
.badge-pending { background-color: #fef3c7; color: #92400e; }
.badge-warning { background-color: #fef3c7; color: #92400e; }
.badge-info { background-color: #dbeafe; color: #1e40af; }
.badge-paused { background-color: #fef3c7; color: #92400e; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff !important;
}

.btn-primary:hover {
    background-color: #1d4ed8;
    color: #fff !important;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

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

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

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: border-color 0.2s;
    background: var(--input-bg);
    color: var(--text-color);
}

/* Global: all bare inputs/selects/textareas respect the theme */
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
select,
textarea {
    background: var(--input-bg);
    color: var(--text-color);
    border-color: var(--border-color);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Hike Tracker portal — password reveal + clearer form errors */
.ht-pw-wrap {
    position: relative;
    display: block;
    width: 100%;
}
.ht-pw-wrap > input {
    padding-right: 2.85rem;
    width: 100%;
    box-sizing: border-box;
    min-height: 3.15rem;
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
    padding-left: 1rem;
    font-size: 1rem;
    border-radius: 12px;
}
.ht-pw-toggle {
    position: absolute;
    right: 0.3rem;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.85rem;
    height: 2.85rem;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    line-height: 0;
}
.ht-pw-toggle:hover {
    background: rgba(148, 163, 184, 0.2);
    color: #334155;
}
.ht-pw-toggle:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 1px;
}
.ht-pw-toggle .ht-pw-icon-hide {
    display: none;
}
.ht-pw-toggle.is-revealed .ht-pw-icon-show {
    display: none;
}
.ht-pw-toggle.is-revealed .ht-pw-icon-hide {
    display: block;
}
.alert-error.ht-form-errors {
    border-width: 2px;
    border-color: #f87171;
    font-size: 0.95rem;
    line-height: 1.5;
    box-shadow: 0 4px 14px rgba(153, 27, 27, 0.12);
}
.ht-form-errors-title {
    font-weight: 700;
    margin: 0 0 0.55rem;
    font-size: 0.98rem;
    color: #7f1d1d;
}
.ht-error-list {
    margin: 0;
    padding-left: 1.2rem;
    color: #991b1b;
}
.ht-error-list li + li {
    margin-top: 0.4rem;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.login-box {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
}

.login-box h1 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.login-box h2 {
    text-align: center;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: normal;
    margin-bottom: 2rem;
}

/* Footer */
.main-footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 2rem;
    margin-top: 4rem;
    text-align: center;
    color: var(--text-muted);
}

/* Public Homepage */
.public-hero {
    background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 55%),
        linear-gradient(120deg, #0f172a, #1e293b);
    padding: 5rem 0 4rem;
    color: #f8fafc;
}

.hero-content {
    max-width: 720px;
}

.hero-kicker {
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    font-weight: 700;
    color: rgba(248, 250, 252, 0.7);
    margin-bottom: 0.75rem;
}

.hero-content h1 {
    font-size: 3rem;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

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

.public-hero .btn-outline {
    border-color: rgba(248, 250, 252, 0.5);
    color: #f8fafc;
}

.public-hero .btn-outline:hover {
    background: rgba(248, 250, 252, 0.1);
}

.section {
    padding: 3rem 0;
}

.section-muted {
    background: var(--bg-color);
}

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

.section-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--text-muted);
}

.design-grid,
.capability-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.design-card,
.capability-card,
.contact-card {
    background: var(--card-bg);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: inherit;
}

.design-card h3,
.capability-card h3 {
    margin-bottom: 0.5rem;
}

.design-card p,
.capability-card p {
    color: var(--text-muted);
}

.design-thumb {
    height: 200px;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(15, 118, 110, 0.15));
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.design-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.design-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.contact-card {
    display: grid;
    gap: 0.75rem;
    font-size: 0.95rem;
    background: #0f172a;
    color: #f8fafc;
    border-color: rgba(148, 163, 184, 0.3);
}

/* Notes board (Google Keep–style) */
.notes-page {
    padding-bottom: 3rem;
}

.notes-composer {
    max-width: 720px;
    margin: 0 auto 1.75rem;
    padding: 1rem 1.25rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
}

.notes-composer label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.notes-composer textarea {
    width: 100%;
    min-height: 4.5rem;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--input-bg);
    color: var(--text-color);
    font: inherit;
    resize: vertical;
}

.notes-composer textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 1px;
}

.notes-composer-extras {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.notes-composer-link-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.notes-input-inline {
    flex: 1;
    min-width: 12rem;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background: var(--input-bg);
    color: var(--text-color);
    font: inherit;
}

.notes-composer-files {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.notes-pending-list {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.notes-pending-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 0.85rem;
    word-break: break-all;
}

.notes-pending-remove {
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0 0.25rem;
}

.notes-pending-remove:hover {
    color: var(--danger-color);
}

.notes-file-input-hidden {
    position: absolute;
    width: 0.01px;
    height: 0.01px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

.notes-composer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.notes-color-palette {
    display: grid;
    grid-template-columns: repeat(6, 1.5rem);
    gap: 0.35rem;
}

.notes-color-swatch {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.12);
    transition: transform .12s ease, box-shadow .12s ease;
}

.notes-color-swatch:hover {
    transform: scale(1.18);
    box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.18), 0 2px 6px rgb(0 0 0 / 0.15);
}

.notes-color-swatch.selected,
.notes-color-swatch:focus-visible {
    border-color: var(--text-color);
    outline: none;
    transform: scale(1.12);
}

.notes-board {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-rows: 48px;
    grid-auto-flow: dense;
    gap: 0.65rem;
    align-items: stretch;
    max-width: 980px;
    margin: 0 auto;
}

/* Metro-style tiles: small ≈ 1 unit, large ≈ 2×2 of small (Keep-like mix) */
.notes-card--tile-sm {
    grid-column: span 3;
    grid-row: span 4;
}

.notes-card--tile-lg {
    grid-column: span 6;
    grid-row: span 8;
}

.notes-card {
    border-radius: 0.5rem;
    padding: 0.55rem 0.55rem 2.15rem;
    min-height: 0;
    box-shadow: var(--shadow);
    position: relative;
    border: 1px solid rgb(0 0 0 / 0.08);
    transition: box-shadow 0.15s ease, transform 0.12s ease;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.notes-card--tile-lg {
    padding: 0.75rem 0.75rem 2.35rem;
    border-radius: 0.6rem;
}

[data-theme="dark"] .notes-card {
    border-color: rgb(255 255 255 / 0.08);
}

.notes-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.notes-att-item {
    position: relative;
    margin-bottom: 0.65rem;
}

.notes-att-img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 0.375rem;
    vertical-align: middle;
}

.notes-card--tile-sm .notes-att-img {
    max-height: 92px;
    width: 100%;
    object-fit: cover;
}

.notes-att-video {
    width: 100%;
    max-height: 220px;
    border-radius: 0.375rem;
    background: rgb(0 0 0 / 0.08);
}

.notes-card--tile-sm .notes-att-video {
    max-height: 96px;
}

.notes-card--tile-sm .notes-embed-youtube {
    padding-bottom: 50%;
}

.notes-embed-youtube {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 0.375rem;
    background: rgb(0 0 0 / 0.08);
}

.notes-embed-youtube iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.notes-link-line,
.notes-file-line {
    margin: 0;
    font-size: 0.875rem;
    word-break: break-all;
}

.notes-link-line a {
    color: #1d4ed8;
}

[data-theme="dark"] .notes-link-line a {
    color: #93c5fd;
}

.notes-att-remove {
    position: absolute;
    top: 0.2rem;
    right: 0.2rem;
    z-index: 6;
    width: 1.65rem;
    height: 1.65rem;
    border: none;
    border-radius: 0.25rem;
    background: rgb(255 255 255 / 0.85);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    box-shadow: var(--shadow);
}

[data-theme="dark"] .notes-att-remove {
    background: rgb(15 23 42 / 0.75);
    color: #e5e7eb;
}

.notes-att-remove:hover {
    color: var(--danger-color);
}

.notes-card-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.5rem 0 0.35rem;
    flex-shrink: 0;
}

.notes-card-toolbtn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.notes-card textarea {
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    border: none;
    background: transparent;
    color: #1e293b;
    font: inherit;
    line-height: 1.45;
    resize: none;
}

.notes-card--tile-sm textarea {
    min-height: 2.75rem;
}

.notes-card--tile-lg textarea {
    min-height: 5rem;
}

[data-theme="dark"] .notes-card textarea {
    color: #0f172a;
}

.notes-card-delete {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 0.375rem;
    background: rgb(0 0 0 / 0.06);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}

.notes-card-delete:hover {
    background: rgb(239 68 68 / 0.2);
    color: var(--danger-color);
}

.notes-card-colors {
    display: grid;
    grid-template-columns: repeat(6, 1.25rem);
    gap: 0.22rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgb(0 0 0 / 0.08);
    flex-shrink: 0;
}

.notes-card-colors .notes-color-swatch {
    width: 1.25rem;
    height: 1.25rem;
}

.notes-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

body.notes-img-modal-open {
    overflow: hidden;
}

.notes-img-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.notes-img-modal[hidden] {
    display: none !important;
}

.notes-img-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgb(0 0 0 / 0.45);
}

.notes-img-modal-panel {
    position: relative;
    z-index: 1;
    width: min(96vw, 720px);
    max-height: 92vh;
    overflow: auto;
    padding: 1.25rem 1.5rem;
    background: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
}

.notes-img-modal-title {
    font-size: 1.15rem;
    margin: 0 0 0.35rem;
}

.notes-img-modal-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 0 1rem;
}

.notes-img-editor-wrap {
    max-height: min(55vh, 480px);
    margin-bottom: 1rem;
    background: var(--bg-color);
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.notes-img-editor-img {
    display: block;
    max-width: 100%;
    max-height: min(55vh, 480px);
}

.notes-img-editor-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    margin-bottom: 1rem;
}

.notes-img-editor-label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.notes-img-editor-label .notes-input-inline {
    min-width: 8rem;
}

.notes-img-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.notes-att-edit {
    position: absolute;
    top: 0.2rem;
    left: 0.2rem;
    z-index: 6;
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 0.375rem;
    background: rgb(255 255 255 / 0.9);
    color: var(--text-color);
    cursor: pointer;
    box-shadow: var(--shadow);
    padding: 0;
}

[data-theme="dark"] .notes-att-edit {
    background: rgb(15 23 42 / 0.85);
    color: #e5e7eb;
}

.notes-att-edit:hover {
    color: var(--primary-color);
}

.notes-pending-chip-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.notes-pending-thumb {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 0.35rem;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
}

.notes-pending-label {
    flex: 1;
    min-width: 0;
    font-size: 0.85rem;
    word-break: break-all;
}

.notes-pending-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
    }
    
    .main-nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        width: 100%;
    }

    .nav-group {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .nav-group-toggle {
        padding-left: 0;
    }

    .nav-group-menu {
        position: static;
        display: flex;
        width: 100%;
        padding: 0.25rem 0 0.25rem 0.5rem;
        border: none;
        box-shadow: none;
        background: transparent;
    }

    .nav-wrap {
        display: none;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        width: 100%;
        padding-top: 0.75rem;
        border-top: 1px solid var(--border-color);
    }

    .nav-wrap.open {
        display: flex;
    }

    .user-menu {
        width: 100%;
        justify-content: space-between;
    }

    .burger-btn {
        display: flex;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 1rem;
    }

    .hero-content h1 {
        font-size: 2.25rem;
    }

    .notes-board {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        grid-auto-rows: 44px;
        gap: 0.5rem;
    }

    .notes-card--tile-sm {
        grid-column: span 3;
        grid-row: span 5;
    }

    .notes-card--tile-lg {
        grid-column: span 6;
        grid-row: span 9;
    }
}

/* ── Hike Tracker portal (hike-tracker.com / /hike_tracker) blue theme ── */
body.ht-portal-site {
    background: linear-gradient(165deg, #dbeafe 0%, #eff6ff 42%, #f8fafc 100%);
    color: #0f172a;
    min-height: 100vh;
    font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.ht-portal-header {
    background: linear-gradient(180deg, #1e3a8a 0%, #1d4ed8 50%, #1e40af 100%);
    border-bottom: 1px solid rgba(15, 23, 42, 0.25);
    box-shadow: 0 8px 28px rgba(30, 58, 138, 0.35);
    margin: 0 calc(50% - 50vw);
    width: 100vw;
    max-width: 100vw;
    box-sizing: border-box;
}

.ht-portal-header .container {
    max-width: 1120px;
    margin: 0 auto;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    box-sizing: border-box;
}

.ht-portal-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1.15rem;
    padding: 0.95rem 0;
    border-bottom: none;
    margin-bottom: 0;
}

.ht-portal-brand {
    font-weight: 800;
    margin-right: auto;
    letter-spacing: -0.02em;
}

.ht-portal-brand a {
    color: #fff !important;
    text-decoration: none !important;
    font-size: 1.05rem;
}

.ht-portal-brand a:hover {
    color: #bfdbfe !important;
}

.ht-portal-tagline {
    font-size: 0.78rem;
    width: 100%;
    margin: -0.2rem 0 0.15rem;
    line-height: 1.4;
    color: rgba(191, 219, 254, 0.95) !important;
}

.ht-portal-nav > a:not(.ht-nav-cta):not(.ht-nav-secondary) {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.92) !important;
    text-decoration: none;
    font-weight: 500;
}

.ht-portal-nav > a:not(.ht-nav-cta):not(.ht-nav-secondary):hover {
    color: #fff !important;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ht-portal-nav a.ht-nav-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.88rem;
    background: #fff !important;
    color: #1e40af !important;
    text-decoration: none !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.ht-portal-nav a.ht-nav-cta:hover {
    filter: brightness(1.04);
    text-decoration: none !important;
}

.ht-portal-nav a.ht-nav-secondary {
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    color: #fff !important;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
    text-decoration: none !important;
}

.ht-portal-nav a.ht-nav-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.65);
    color: #fff !important;
}

.ht-portal-nav .ht-portal-nav-spacer {
    margin-left: auto;
}

body.ht-portal-site .ht-auth-page {
    max-width: 28rem;
    margin: 0 auto;
    padding: 2.25rem 1rem 2.75rem;
    box-sizing: content-box;
}

@media (min-width: 480px) {
    body.ht-portal-site .ht-auth-page {
        max-width: 30rem;
        padding-top: 2.75rem;
    }
}

body.ht-portal-site .ht-auth-card {
    position: relative;
    padding: 2.35rem 1.85rem 2rem;
    border-radius: 1.35rem;
    background: linear-gradient(165deg, #ffffff 0%, #f4f9ff 42%, #eaf3ff 100%);
    border: 1px solid rgba(37, 99, 235, 0.32);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 22px 56px rgba(30, 64, 175, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
    overflow: hidden;
}

@media (max-width: 480px) {
    body.ht-portal-site .ht-auth-card {
        padding: 2rem 1.25rem 1.65rem;
        border-radius: 1.15rem;
    }
}

body.ht-portal-site .ht-auth-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1e40af, #3b82f6, #38bdf8, #6366f1);
}

body.ht-portal-site .ht-auth-card h1 {
    font-size: clamp(1.5rem, 2.6vw, 1.9rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.2;
    color: #0c1e3a;
    margin: 0 0 0.5rem;
}

body.ht-portal-site .ht-auth-card .sub {
    margin: 0 0 1.5rem;
    font-size: 0.96rem;
    line-height: 1.55;
    font-weight: 500;
    color: #475569;
}

body.ht-portal-site .ht-auth-card .ht-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem 0.85rem;
}

@media (max-width: 520px) {
    body.ht-portal-site .ht-auth-card .ht-row {
        grid-template-columns: 1fr;
    }
}

body.ht-portal-site .ht-auth-card label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    color: #1e3a8a;
    margin: 0.85rem 0 0.32rem;
}

body.ht-portal-site .ht-auth-card .ht-row label {
    margin-top: 0.45rem;
}

body.ht-portal-site .ht-auth-card .ht-row:first-of-type label:first-of-type {
    margin-top: 0.35rem;
}

body.ht-portal-site .ht-auth-card input[type="email"],
body.ht-portal-site .ht-auth-card input[type="text"],
body.ht-portal-site .ht-auth-card input[type="tel"] {
    width: 100%;
    box-sizing: border-box;
    min-height: 3.1rem;
    padding: 0.8rem 1rem;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-family: inherit;
    border: 2px solid #2563eb !important;
    background: #fff !important;
    color: #0f172a !important;
    box-shadow: inset 0 1px 2px rgba(37, 99, 235, 0.07);
}

body.ht-portal-site .ht-auth-card .ht-pw-wrap > input {
    width: 100%;
    box-sizing: border-box;
    min-height: 3.1rem;
    padding: 0.8rem 2.85rem 0.8rem 1rem;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-family: inherit;
    border: 2px solid #2563eb !important;
    background: #fff !important;
    color: #0f172a !important;
    box-shadow: inset 0 1px 2px rgba(37, 99, 235, 0.07);
}

body.ht-portal-site .ht-auth-card input:focus,
body.ht-portal-site .ht-pw-wrap > input:focus {
    outline: 3px solid rgba(59, 130, 246, 0.45);
    outline-offset: 0;
    border-color: #1d4ed8 !important;
}

body.ht-portal-site .ht-auth-hint {
    color: #1e40af !important;
    font-weight: 500;
}

body.ht-portal-site .ht-pw-toggle {
    color: #1e40af;
}

body.ht-portal-site .ht-auth-card .btn-primary {
    width: 100%;
    margin-top: 1.25rem;
    border: none;
    border-radius: 999px;
    padding: 0.88rem 1.2rem;
    font-weight: 700;
    font-size: 1rem;
    font-family: inherit;
    letter-spacing: -0.02em;
    background: linear-gradient(165deg, #2563eb 0%, #1d4ed8 48%, #1e40af 100%);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.38);
    transition: filter 0.15s ease, box-shadow 0.15s ease;
}

body.ht-portal-site .ht-auth-card .btn-primary:hover {
    filter: brightness(1.05);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.42);
}

body.ht-portal-site .ht-auth-card .ht-auth-foot {
    margin-top: 1.35rem;
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.55;
    color: #64748b;
}

body.ht-portal-site .ht-auth-card .ht-auth-foot a {
    color: #1d4ed8;
    font-weight: 600;
    text-decoration: none;
}

body.ht-portal-site .ht-auth-card .ht-auth-foot a:hover {
    color: #1e40af;
    text-decoration: underline;
    text-underline-offset: 2px;
}

body.ht-portal-site .ht-auth-card .alert-error.ht-form-errors {
    border: 1px solid rgba(220, 38, 38, 0.4);
    background: rgba(254, 242, 242, 0.97);
    border-radius: 0.75rem;
    margin-bottom: 1rem;
}

body.ht-portal-site .ht-auth-card .alert-success {
    border: 1px solid rgba(22, 163, 74, 0.35);
    background: rgba(240, 253, 244, 0.97);
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

body.ht-portal-site .ht-pw-toggle:hover {
    background: rgba(59, 130, 246, 0.15);
    color: #172554;
}

.ht-portal-footer {
    background: linear-gradient(180deg, #1e3a8a 0%, #172554 100%);
    color: #e2e8f0;
    margin: 0 calc(50% - 50vw);
    width: 100vw;
    max-width: 100vw;
    box-sizing: border-box;
    padding: 1.75rem 0 2.5rem;
    border-top: 1px solid rgba(30, 58, 138, 0.6);
    margin-top: 3rem;
}

.ht-portal-footer .container {
    max-width: 1120px;
    margin: 0 auto;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.ht-portal-footer-copy {
    font-size: 0.88rem;
    margin: 0 0 0.65rem;
    color: rgba(226, 232, 240, 0.92);
}

.ht-portal-footer-links {
    font-size: 0.88rem;
    margin: 0;
}

.ht-portal-footer-links a {
    color: #93c5fd;
    font-weight: 600;
    text-decoration: none;
}

.ht-portal-footer-links a:hover {
    color: #bfdbfe;
    text-decoration: underline;
    text-underline-offset: 3px;
}

body.ht-portal-site .cookie-bar {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-top: 2px solid #334155;
    color: #e2e8f0;
}

body.ht-portal-site .cookie-bar a {
    color: #7dd3fc;
}

body.ht-portal-site .ht-legal h1,
body.ht-portal-site .ht-legal h2 {
    color: #172554;
}

body.ht-portal-site .ht-legal p {
    color: #1e293b;
}

/* Landing signup card (hero): stronger field edges on blue-tinted page */
body.ht-portal-site .ht-signup-card input,
body.ht-portal-site .ht-signup-card .ht-pw-wrap > input {
    border: 2px solid rgba(96, 165, 250, 0.95) !important;
    box-shadow: 0 0 0 1px rgba(30, 64, 175, 0.25), inset 0 1px 2px rgba(15, 23, 42, 0.06);
}

body.ht-portal-site .ht-signup-card input:focus,
body.ht-portal-site .ht-signup-card .ht-pw-wrap > input:focus {
    border-color: #38bdf8 !important;
    outline: 2px solid rgba(56, 189, 248, 0.5);
    outline-offset: 1px;
}

/* Portal: logged-in tracker UI (developer/hike_tracker.php) */
body.ht-portal-site .hike-wrap {
    padding-bottom: 1rem;
}

body.ht-portal-site .hike-wrap > h1 {
    color: #0c1e3a;
    font-weight: 700;
    letter-spacing: -0.03em;
}

body.ht-portal-site .hike-card {
    background: linear-gradient(165deg, #ffffff 0%, #f4f9ff 100%);
    border: 1px solid rgba(37, 99, 235, 0.25);
    box-shadow: 0 10px 32px rgba(30, 64, 175, 0.1);
}

body.ht-portal-site .hike-wrap .text-muted,
body.ht-portal-site .hike-muted {
    color: #475569 !important;
}

/* Migration / setup cards use .ht-auth-card outside .ht-auth-page */
body.ht-portal-site .ht-migrate-wrap .ht-auth-card h1 {
    font-size: clamp(1.35rem, 2.4vw, 1.65rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #0c1e3a;
    margin: 0 0 0.5rem;
}

body.ht-portal-site .ht-migrate-wrap .ht-auth-card .sub a {
    color: #1d4ed8;
    font-weight: 600;
}
