/**
 * HobbyEdge CSS
 * Purpose: Early landing/login/app styling.
 * Usage: Loaded by public and authenticated HobbyEdge pages.
 * Dependencies: None.
 * Key Blocks:
 * - SECTION: Theme
 * - SECTION: Base Layout
 * - SECTION: Cards
 * - SECTION: Typography
 * - SECTION: Buttons
 * - SECTION: Forms
 * - SECTION: Alerts
 * - SECTION: Shared Navigation
 * - SECTION: Action Cards
 * - SECTION: Page Header
 * - SECTION: Tables
 * - SECTION: Empty States
 * - SECTION: Mobile Layout
 */

/* SECTION: Theme */

:root {
    --he-bg: #0f172a;
    --he-card: #111827;
    --he-text: #f8fafc;
    --he-muted: #94a3b8;
    --he-border: #1f2937;
    --he-primary: #7c3aed;
    --he-primary-hover: #6d28d9;
    --he-alert: #7f1d1d;
}

/* SECTION: Base Layout */

* {
    box-sizing: border-box;
}

body {
    background: radial-gradient(circle at top, #1e1b4b, var(--he-bg));
    color: var(--he-text);
    font-family: Arial, sans-serif;
    margin: 0;
}

.he-page {
    margin: 0 auto;
    max-width: 1440px;
    min-height: calc(100vh - 72px);
    padding: 32px 28px;
    width: 100%;
}

/* SECTION: Cards */

.he-card {
    background: rgba(17, 24, 39, 0.92);
    border: 1px solid var(--he-border);
    border-radius: 24px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
    padding: 42px;
    width: 100%;
}

.he-login-card {
    margin: 10vh auto 0;
    max-width: 440px;
}

/* SECTION: Typography */

.he-logo {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 24px;
}

h1 {
    font-size: 42px;
    line-height: 1.05;
    margin: 0 0 18px;
}

p {
    font-size: 18px;
    line-height: 1.5;
}

.he-muted {
    color: var(--he-muted);
    font-size: 14px;
}

.he-eyebrow {
    color: rgba(226, 232, 240, 0.68);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    margin: 0 0 10px;
    text-transform: uppercase;
}

.he-sr-only {
    height: 1px;
    left: -9999px;
    overflow: hidden;
    position: absolute;
    top: auto;
    width: 1px;
}

/* SECTION: Buttons */

.he-actions {
    align-items: center;
    display: flex;
    gap: 18px;
    margin-top: 32px;
}

.he-btn {
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    display: inline-block;
    font-weight: 700;
    padding: 13px 20px;
    text-decoration: none;
}

.he-btn-primary {
    background: var(--he-primary);
    color: #ffffff;
}

.he-btn-primary:hover {
    background: var(--he-primary-hover);
}

.he-button {
    align-items: center;
    border-radius: 12px;
    border: 0;
    cursor: pointer;
    display: inline-flex;
    font-size: 14px;
    font-weight: 750;
    justify-content: center;
    line-height: 1;
    min-height: 42px;
    padding: 0 16px;
    text-decoration: none;
}

.he-button--secondary {
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

.he-button--secondary:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

/* SECTION: Forms */

.he-form {
    display: grid;
    gap: 18px;
}

.he-form label {
    color: var(--he-muted);
    display: grid;
    font-size: 14px;
    gap: 8px;
}

.he-form input {
    background: #020617;
    border: 1px solid var(--he-border);
    border-radius: 12px;
    color: var(--he-text);
    font-size: 16px;
    padding: 13px 14px;
    width: 100%;
}

.he-inline-form {
    align-items: center;
    display: flex;
    gap: 10px;
}

.he-input {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    color: #ffffff;
    font: inherit;
    font-size: 14px;
    min-height: 42px;
    min-width: 220px;
    outline: none;
    padding: 0 14px;
}

.he-input::placeholder {
    color: rgba(226, 232, 240, 0.55);
}

.he-input:focus {
    border-color: rgba(129, 140, 248, 0.75);
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.18);
}

/* SECTION: Alerts */

.he-alert {
    border-radius: 14px;
    display: grid;
    gap: 6px;
    margin-top: 24px;
    padding: 16px;
}

.he-alert strong {
    color: #ffffff;
}

.he-alert--error {
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(248, 113, 113, 0.30);
    color: #fecaca;
}

.he-alert--success {
    background: rgba(34, 197, 94, 0.14);
    border: 1px solid rgba(74, 222, 128, 0.30);
    color: #bbf7d0;
}

/* SECTION: Shared Navigation */

.he-app-nav {
    background: #101827;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: #ffffff;
    position: sticky;
    top: 0;
    z-index: 100;
}

.he-app-nav__inner {
    align-items: center;
    display: flex;
    gap: 24px;
    justify-content: space-between;
    margin: 0 auto;
    max-width: 1440px;
    padding: 14px 28px;
}

.he-app-nav__brand {
    color: #ffffff;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.03em;
    text-decoration: none;
}

.he-app-nav__links {
    align-items: center;
    display: flex;
    gap: 8px;
}

.he-app-nav__link,
.he-app-nav__dropdown-button {
    background: transparent;
    border: 0;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.78);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 14px;
    font-weight: 650;
    padding: 9px 12px;
    text-decoration: none;
}

.he-app-nav__link:hover,
.he-app-nav__dropdown-button:hover,
.he-app-nav__link.is-active,
.he-app-nav__dropdown.is-active > .he-app-nav__dropdown-button {
    background: rgba(255, 255, 255, 0.10);
    color: #ffffff;
}

.he-app-nav__dropdown {
    position: relative;
}

.he-app-nav__dropdown-menu {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
    display: none;
    min-width: 210px;
    padding: 8px;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 200;
}

.he-app-nav__dropdown.is-open .he-app-nav__dropdown-menu {
    display: block;
}

.he-app-nav__dropdown-link {
    border-radius: 10px;
    color: #172033;
    display: block;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 12px;
    text-decoration: none;
}

.he-app-nav__dropdown-link:hover,
.he-app-nav__dropdown-link.is-active {
    background: #f1f5f9;
    color: #0f172a;
}

/* SECTION: Action Cards */

.he-action-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 28px;
}

.he-action-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 18px;
    color: #ffffff;
    display: block;
    padding: 24px;
    text-decoration: none;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.he-action-card:hover,
.he-action-card:focus {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    transform: translateY(-2px);
}

.he-action-card h2 {
    color: #ffffff;
    font-size: 24px;
    line-height: 1.15;
    margin: 0 0 10px;
}

.he-action-card p {
    color: rgba(226, 232, 240, 0.78);
    font-size: 16px;
    line-height: 1.5;
    margin: 0;
}

/* SECTION: Page Header */

.he-page-header {
    align-items: flex-start;
    display: flex;
    gap: 20px;
    justify-content: space-between;
}

.he-page-header__actions {
    flex: 0 0 auto;
    padding-top: 10px;
}

/* SECTION: Tables */

.he-table-wrap {
    margin-top: 28px;
    overflow-x: visible;
}

.he-table {
    border-collapse: collapse;
    width: 100%;
}

.he-table th {
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
    color: rgba(226, 232, 240, 0.72);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 12px 14px;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.he-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(226, 232, 240, 0.88);
    padding: 15px 14px;
    vertical-align: middle;
}

.he-table td strong {
    color: #ffffff;
}

.he-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.045);
}

/* SECTION: Empty States */

.he-empty-state {
    background: rgba(255, 255, 255, 0.06);
    border: 1px dashed rgba(255, 255, 255, 0.18);
    border-radius: 18px;
    margin-top: 28px;
    padding: 28px;
}

.he-empty-state h2 {
    color: #ffffff;
    font-size: 22px;
    margin: 0 0 8px;
}

.he-empty-state p {
    color: rgba(226, 232, 240, 0.78);
    line-height: 1.5;
    margin: 0;
}

/* SECTION: Mobile Layout */

@media (max-width: 760px) {
    .he-page {
        min-height: calc(100vh - 120px);
        padding: 20px 14px;
    }

    .he-card {
        border-radius: 18px;
        padding: 22px 16px;
    }

    .he-login-card {
        margin-top: 6vh;
        max-width: 440px;
    }

    h1 {
        font-size: 34px;
    }

    p {
        font-size: 16px;
    }

    .he-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .he-app-nav__inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
        padding: 14px;
    }

    .he-app-nav__links {
        align-items: stretch;
        flex-wrap: wrap;
        width: 100%;
    }

    .he-app-nav__dropdown-menu {
        left: 0;
        right: auto;
    }

    .he-action-grid {
        grid-template-columns: 1fr;
    }

    .he-action-card {
        padding: 20px;
    }

    .he-action-card h2 {
        font-size: 22px;
    }

    .he-page-header {
        display: block;
    }

    .he-page-header__actions {
        padding-top: 18px;
    }

    .he-button {
        width: 100%;
    }

    .he-inline-form {
        align-items: stretch;
        flex-direction: column;
    }

    .he-input {
        min-width: 0;
        width: 100%;
    }

    .he-table-wrap {
        overflow-x: auto;
    }

    .he-table {
        min-width: 720px;
    }
}
/* SECTION: Global App Width Overrides
   Purpose: Force authenticated app pages to use full dashboard width on desktop.
   Notes: Keep this at the bottom so it wins over earlier layout rules.
*/

.he-page {
    align-items: stretch !important;
    display: block !important;
    justify-content: flex-start !important;
    margin: 0 auto !important;
    max-width: 1440px !important;
    min-height: calc(100vh - 72px) !important;
    padding: 48px 32px !important;
    width: 100% !important;
}

.he-card {
    margin: 0 auto !important;
    max-width: 1180px !important;
    width: 100% !important;
}

.he-table-wrap {
    overflow-x: visible !important;
    width: 100% !important;
}

.he-table {
    min-width: 0 !important;
    width: 100% !important;
}

@media (max-width: 760px) {
    .he-page {
        padding: 20px 14px !important;
    }

    .he-card {
        max-width: none !important;
        width: 100% !important;
    }

    .he-table-wrap {
        overflow-x: auto !important;
    }

    .he-table {
        min-width: 720px !important;
    }
}
/* SECTION: Table Forms */

.he-table-form {
    align-items: center;
    display: flex;
    gap: 8px;
}

.he-input--compact {
    min-height: 36px;
    min-width: 180px;
    padding: 0 10px;
}

.he-button--mini {
    font-size: 12px;
    min-height: 36px;
    padding: 0 12px;
}

@media (max-width: 760px) {
    .he-table-form {
        align-items: stretch;
        flex-direction: column;
    }

    .he-input--compact {
        min-width: 0;
        width: 100%;
    }
}
/* SECTION: Danger Buttons and Table Actions */

.he-table-actions {
    display: grid;
    gap: 8px;
}

.he-button--danger {
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(248, 113, 113, 0.34);
    color: #fecaca;
}

.he-button--danger:hover {
    background: rgba(239, 68, 68, 0.24);
    color: #ffffff;
}
/* SECTION: Tabs */

.he-tabs {
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    gap: 8px;
    margin-top: 28px;
}

.he-tab {
    border-bottom: 2px solid transparent;
    color: rgba(226, 232, 240, 0.70);
    font-size: 14px;
    font-weight: 750;
    padding: 12px 14px;
    text-decoration: none;
}

.he-tab:hover {
    color: #ffffff;
}

.he-tab.is-active {
    border-bottom-color: #a78bfa;
    color: #ffffff;
}

@media (max-width: 760px) {
    .he-tabs {
        overflow-x: auto;
    }

    .he-tab {
        white-space: nowrap;
    }
}
/* SECTION: Nav User */

.he-app-nav__user {
    color: rgba(226, 232, 240, 0.78);
    flex: 0 0 auto;
    font-size: 14px;
    font-weight: 650;
    white-space: nowrap;
}

@media (max-width: 760px) {
    .he-app-nav__user {
        font-size: 13px;
        width: 100%;
    }
}
/* SECTION: Batch Forms */
/* SECTION: Compact Form Fields */

.he-field-mini {
    color: rgba(226, 232, 240, 0.72);
    display: grid;
    font-size: 12px;
    font-weight: 750;
    gap: 6px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.he-field-mini .he-input {
    letter-spacing: normal;
    text-transform: none;
}

/* SECTION: Compact Inputs */

.he-input--small {
    min-width: 110px;
    width: 110px;
}

.he-input--compact {
    min-height: 36px;
    min-width: 180px;
    padding: 0 10px;
}

/* SECTION: Mini Buttons */

.he-button--mini {
    font-size: 12px;
    min-height: 36px;
    padding: 0 12px;
}

/* SECTION: Create Panels */

.he-create-panel {
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 18px;
    margin-top: 24px;
    padding: 18px;
}

.he-create-panel .he-inline-form {
    align-items: end;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-start;
}

.he-create-panel .he-button {
    align-self: end;
}

/* SECTION: Toolbars */

.he-toolbar {
    align-items: end;
    display: flex;
    gap: 24px;
    justify-content: space-between;
    margin-top: 24px;
}

.he-toolbar__left {
    flex: 0 1 340px;
}

.he-toolbar__right {
    flex: 0 0 auto;
}

.he-toolbar__left,
.he-toolbar__right {
    align-items: end;
    display: flex;
    gap: 12px;
}

.he-toolbar__left .he-field-mini {
    width: 100%;
}

.he-toolbar__left .he-input {
    width: 320px;
}

.he-toolbar__right .he-inline-form {
    align-items: end;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 10px;
    justify-content: flex-end;
}

.he-toolbar__right .he-button {
    align-self: end;
    flex: 0 0 auto;
}

/* SECTION: Table Forms */

.he-table-form {
    align-items: center;
    display: flex;
    gap: 8px;
}

.he-table-actions {
    display: grid;
    gap: 8px;
}

/* SECTION: Danger Buttons */

.he-button--danger {
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(248, 113, 113, 0.34);
    color: #fecaca;
}

.he-button--danger:hover {
    background: rgba(239, 68, 68, 0.24);
    color: #ffffff;
}

/* SECTION: Tabs */

.he-tabs {
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    gap: 8px;
    margin-top: 28px;
}

.he-tab {
    border-bottom: 2px solid transparent;
    color: rgba(226, 232, 240, 0.70);
    font-size: 14px;
    font-weight: 750;
    padding: 12px 14px;
    text-decoration: none;
}

.he-tab:hover {
    color: #ffffff;
}

.he-tab.is-active {
    border-bottom-color: #a78bfa;
    color: #ffffff;
}

/* SECTION: Nav User */

.he-app-nav__user {
    color: rgba(226, 232, 240, 0.78);
    flex: 0 0 auto;
    font-size: 14px;
    font-weight: 650;
    white-space: nowrap;
}

/* SECTION: Mobile Overrides for App Controls */

@media (max-width: 760px) {
    .he-field-mini {
        width: 100%;
    }

    .he-input--small,
    .he-input--compact {
        min-width: 0;
        width: 100%;
    }

    .he-create-panel .he-inline-form,
    .he-toolbar,
    .he-toolbar__left,
    .he-toolbar__right,
    .he-toolbar__right .he-inline-form,
    .he-table-form {
        align-items: stretch;
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    .he-create-panel .he-button,
    .he-toolbar__right .he-button {
        align-self: stretch;
    }

    .he-toolbar__left .he-input {
        width: 100%;
    }

    .he-tabs {
        overflow-x: auto;
    }

    .he-tab {
        white-space: nowrap;
    }

    .he-app-nav__user {
        font-size: 13px;
        width: 100%;
    }
}
/* SECTION: Tiny Inputs */

.he-input--tiny {
    min-height: 36px;
    min-width: 76px;
    padding: 0 10px;
    width: 76px;
}

@media (max-width: 760px) {
    .he-input--tiny {
        min-width: 0;
        width: 100%;
    }
}
/* SECTION: Editable Table Rows */

.he-editable-row .he-row-edit,
.he-editable-row .he-save-row-button {
    display: none;
}

.he-editable-row[data-editing="true"] .he-row-view,
.he-editable-row[data-editing="true"] .he-edit-row-button {
    display: none;
}

.he-editable-row[data-editing="true"] .he-row-edit,
.he-editable-row[data-editing="true"] .he-save-row-button {
    display: inline-flex;
}

.he-input--table {
    font-size: 13px;
    min-height: 34px;
    min-width: 0;
    padding: 0 10px;
    width: 100%;
}

.he-table {
    font-size: 14px;
}

.he-table th {
    font-size: 11px;
    padding: 10px 10px;
}

.he-table td {
    padding: 12px 10px;
}

.he-table td:nth-child(1) {
    min-width: 150px;
    width: 180px;
}

.he-table td:nth-child(2),
.he-table td:nth-child(3) {
    width: 110px;
}

.he-table td:nth-child(4),
.he-table td:nth-child(5),
.he-table td:nth-child(6),
.he-table td:nth-child(7) {
    width: 85px;
}

.he-table td:nth-child(8) {
    width: 95px;
}

.he-table td:nth-child(9) {
    width: 130px;
}

.he-table td:nth-child(10) {
    width: 90px;
}
/* SECTION: Alert Actions */

.he-alert__actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}
/* SECTION: Logo Navigation */

.he-app-nav__brand--logo {
    align-items: center;
    display: inline-flex;
    padding: 0;
}

.he-app-nav__logo {
    display: block;
    height: 34px;
    max-width: 220px;
    object-fit: contain;
    width: auto;
}

@media (max-width: 760px) {
    .he-app-nav__logo {
        height: 32px;
        max-width: 200px;
    }
}
