/* ============================================================
   Fuse Portfolio - Stylesheet
   Brand: navy #0e2240, League Spartan wordmark, Inter body
   ============================================================ */

:root {
    --navy:        #0e2240;
    --navy-light:  #1a3560;
    --navy-dark:   #091629;
    --accent:      #d4920f;
    --green:       #1f7a3d;
    --red:         #b91c1c;
    --grey-50:     #f8f9fb;
    --grey-100:    #f1f3f6;
    --grey-200:    #e5e8ed;
    --grey-300:    #d3d8e0;
    --grey-500:    #6b7280;
    --grey-700:    #374151;
    --text:        #1f2937;
    --radius:      8px;
    --shadow:      0 1px 3px rgba(14, 34, 64, 0.08), 0 1px 2px rgba(14, 34, 64, 0.04);
    --shadow-lg:   0 10px 25px -5px rgba(14, 34, 64, 0.12), 0 4px 10px -3px rgba(14, 34, 64, 0.08);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 16px;
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--navy);
    text-decoration: none;
}
a:hover { text-decoration: underline; }

/* =========  Fuse wordmark  ========= */
.fuse-wordmark {
    font-family: 'League Spartan', sans-serif;
    font-weight: 800;
    color: var(--navy);
    letter-spacing: -0.06em;
    text-transform: lowercase;
    line-height: 1;
    display: inline-block;
}
.fuse-wordmark::first-letter { letter-spacing: -0.12em; }  /* fu tightening */

/* =========  AUTH (login/signup) layout  ========= */
.auth-body {
    background: linear-gradient(135deg, var(--grey-50) 0%, var(--grey-100) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.auth-brand {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}
.auth-brand .fuse-wordmark { font-size: 3.5rem; }
.auth-brand-sub {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--navy);
    letter-spacing: 0.02em;
}

.auth-card {
    background: white;
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow-lg);
    text-align: left;
}

.auth-heading {
    font-size: 1.625rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: var(--navy);
    letter-spacing: -0.01em;
}
.auth-sub {
    color: var(--grey-500);
    margin: 0 0 1.75rem;
    font-size: 0.9375rem;
}

.auth-links {
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--grey-500);
    text-align: center;
}
.auth-link-divider {
    margin: 0 0.5rem;
    color: var(--grey-300);
}
.auth-footer {
    margin-top: 1.5rem;
    font-size: 0.8125rem;
    color: var(--grey-500);
}

/* =========  Forms  ========= */
.form-field {
    margin-bottom: 1.25rem;
}
.form-field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--grey-700);
    margin-bottom: 0.4rem;
}
.form-field input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--grey-300);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.9375rem;
    color: var(--text);
    background: white;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-field input:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(14, 34, 64, 0.1);
}
.form-hint {
    font-size: 0.8125rem;
    color: var(--grey-500);
    margin: 0.35rem 0 0;
}

/* =========  Buttons  ========= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.05s ease;
    text-decoration: none;
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.btn-primary {
    background: var(--navy);
    color: white;
}
.btn-primary:hover:not(:disabled) { background: var(--navy-light); text-decoration: none; }
.btn-primary:active:not(:disabled) { transform: translateY(1px); }
.btn-block {
    width: 100%;
}

/* =========  Flash messages  ========= */
.flash {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    border-left: 3px solid;
}
.flash-error  { background: #fef2f2; border-color: var(--red);    color: #991b1b; }
.flash-notice { background: #eff6ff; border-color: var(--navy);   color: var(--navy); }
.flash-success{ background: #ecfdf5; border-color: var(--green);  color: #065f46; }

/* =========  APP layout (logged in)  ========= */
.app-body {
    background: var(--grey-50);
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: 240px;
    background: var(--navy);
    color: white;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: sticky;
    top: 0;
}

.sidebar-brand {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}
.sidebar-wordmark {
    color: white;
    font-size: 2rem;
}
.sidebar-brand-sub {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
    font-weight: 500;
}

.sidebar-nav {
    padding: 1rem 0.5rem;
    flex: 1;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    color: rgba(255,255,255,0.75);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius);
    margin-bottom: 0.15rem;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.sidebar-link:hover {
    background: rgba(255,255,255,0.06);
    color: white;
    text-decoration: none;
}
.sidebar-link.is-active {
    background: rgba(255,255,255,0.1);
    color: white;
}
.sidebar-link.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.sidebar-link.is-disabled:hover {
    background: transparent;
    color: rgba(255,255,255,0.75);
}
.sidebar-link-icon {
    color: rgba(255,255,255,0.5);
    font-size: 0.875rem;
    width: 1rem;
    text-align: center;
}
.sidebar-badge {
    margin-left: auto;
    font-size: 0.6875rem;
    background: rgba(212, 146, 15, 0.25);
    color: #f4c05e;
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sidebar-user {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: white;
}
.sidebar-user-role {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.55);
    text-transform: capitalize;
    margin-bottom: 0.6rem;
}
.sidebar-logout {
    color: rgba(255,255,255,0.75);
    font-size: 0.8125rem;
    font-weight: 500;
}
.sidebar-logout:hover { color: white; }

.main {
    flex: 1;
    padding: 2rem 2.5rem;
    max-width: 1200px;
}

/* =========  Page header  ========= */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}
.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--navy);
    margin: 0 0 0.25rem;
    letter-spacing: -0.01em;
}
.page-sub {
    color: var(--grey-500);
    margin: 0;
    font-size: 0.9375rem;
}

/* =========  Stats grid  ========= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: white;
    padding: 1.25rem 1.4rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-top: 3px solid var(--grey-200);
}
.stat-card-accent {
    border-top-color: var(--green);
}
.stat-label {
    font-size: 0.8125rem;
    color: var(--grey-500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--navy);
    letter-spacing: -0.015em;
    line-height: 1.1;
}
.stat-sub {
    font-size: 0.8125rem;
    color: var(--grey-500);
    margin-top: 0.3rem;
    font-style: italic;
}

/* =========  Panels  ========= */
.panel {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
}
.panel-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--grey-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.panel-title {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--navy);
}
.panel-body {
    padding: 1.25rem 1.5rem;
}
.panel-body p:first-child { margin-top: 0; }
.panel-body p:last-child  { margin-bottom: 0; }
.panel-body ul {
    padding-left: 1.25rem;
    margin: 0.5rem 0 1rem;
}
.panel-body li {
    margin-bottom: 0.35rem;
    color: var(--grey-700);
}

/* =========  Key-value list  ========= */
.key-value {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.6rem 1.5rem;
    margin: 0;
}
.key-value dt {
    color: var(--grey-500);
    font-size: 0.875rem;
    font-weight: 500;
}
.key-value dd {
    margin: 0;
    color: var(--text);
    font-weight: 500;
}

/* =========  Responsive  ========= */
@media (max-width: 768px) {
    .app-body {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        min-height: auto;
        position: relative;
    }
    .sidebar-nav {
        display: flex;
        overflow-x: auto;
        padding: 0.5rem;
    }
    .sidebar-link {
        flex-shrink: 0;
        margin-bottom: 0;
        margin-right: 0.25rem;
    }
    .sidebar-badge { display: none; }
    .main {
        padding: 1.5rem 1.25rem;
    }
    .page-header {
        flex-direction: column;
    }
}
/* ============================================================
   Fuse Portfolio - Slice 2 additions
   Append to the existing app.css (or replace the whole file)
   ============================================================ */

/* ========= Breadcrumb ========= */
.breadcrumb {
    font-size: 0.8125rem;
    color: var(--grey-500);
    margin-bottom: 0.4rem;
}
.breadcrumb a { color: var(--grey-500); }
.breadcrumb a:hover { color: var(--navy); }
.breadcrumb span { margin: 0 0.35rem; color: var(--grey-300); }

/* ========= Filter / search bar inside panel ========= */
.panel-header-compact {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
}
@media (min-width: 768px) {
    .panel-header-compact {
        flex-direction: row;
        align-items: center;
    }
}
.filter-form {
    display: flex;
    flex: 1;
}
.filter-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
}
.filter-search {
    flex: 1;
    min-width: 180px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--grey-300);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.875rem;
    background: white;
}
.filter-search:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(14, 34, 64, 0.08);
}
.filter-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--grey-300);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.875rem;
    background: white;
    cursor: pointer;
}
.result-count {
    font-size: 0.875rem;
    color: var(--grey-500);
    white-space: nowrap;
}
.result-count strong {
    color: var(--navy);
}

/* ========= Buttons additional variants ========= */
.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8125rem;
}
.btn-ghost {
    background: transparent;
    color: var(--navy);
    border: 1px solid var(--grey-300);
}
.btn-ghost:hover:not(:disabled) {
    background: var(--grey-100);
    text-decoration: none;
}

/* ========= Data table ========= */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.data-table thead {
    background: var(--grey-50);
}
.data-table th {
    text-align: left;
    padding: 0.6rem 1.25rem;
    font-weight: 600;
    color: var(--grey-700);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--grey-200);
}
.data-table td {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--grey-100);
    vertical-align: middle;
}
.data-table tbody tr:hover {
    background: var(--grey-50);
}
.data-table tbody tr:last-child td {
    border-bottom: none;
}
.cell-muted {
    color: var(--grey-500);
}
.cell-right {
    text-align: right;
    white-space: nowrap;
}
.link-inline {
    font-weight: 500;
    color: var(--navy);
    font-size: 0.875rem;
}

/* ========= Pagination ========= */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--grey-200);
}
.pagination-info {
    font-size: 0.875rem;
    color: var(--grey-500);
}

/* ========= Form layouts ========= */
.form-wide {
    max-width: 900px;
}
.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0 1.25rem;
}
.form-field textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--grey-300);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.9375rem;
    color: var(--text);
    background: white;
    resize: vertical;
    min-height: 80px;
}
.form-field textarea:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(14, 34, 64, 0.1);
}
.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
}
/* ============================================================
   Fuse Portfolio - Slice 2B additions
   ============================================================ */

/* ========= Pills (status badges) ========= */
.pill {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.pill-green { background: #d1fae5; color: #065f46; }
.pill-grey  { background: var(--grey-200); color: var(--grey-700); }
.pill-navy  { background: rgba(14, 34, 64, 0.1); color: var(--navy); }
.pill-amber { background: #fef3c7; color: #92400e; }
.pill-red   { background: #fee2e2; color: #991b1b; }

/* ========= Inline labels for checkboxes ========= */
.checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--grey-700);
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
}
.checkbox-inline input[type="checkbox"] {
    margin: 0;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--grey-700);
    font-weight: 500;
    padding: 0.4rem 0;
}

/* ========= Select dropdowns (in forms) ========= */
.form-field select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--grey-300);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.9375rem;
    color: var(--text);
    background: white;
    cursor: pointer;
}
.form-field select:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(14, 34, 64, 0.1);
}

/* ========= Required marker ========= */
.form-required {
    color: var(--red);
    font-weight: 700;
}

/* ========= Panel footer (for inline forms below a table) ========= */
.panel-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--grey-200);
    background: var(--grey-50);
}

.inline-form {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}
.inline-form select { min-width: 220px; }

/* ========= Empty state ========= */
.empty-state {
    text-align: center;
    color: var(--grey-500);
    padding: 1rem 0;
    margin: 0;
}
.empty-state a {
    color: var(--navy);
    font-weight: 600;
}

/* ========= Danger zone ========= */
.danger-zone {
    margin-top: 3rem;
    padding: 1.25rem 1.5rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius);
    max-width: 900px;
}
.danger-zone h3 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    color: #991b1b;
    font-weight: 600;
}
.danger-zone p {
    margin: 0 0 0.75rem;
    color: #7f1d1d;
    font-size: 0.875rem;
}

.btn-danger {
    background: var(--red);
    color: white;
    border: 1px solid var(--red);
}
.btn-danger:hover:not(:disabled) {
    background: #991b1b;
    border-color: #991b1b;
    text-decoration: none;
}

.link-danger {
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--red);
    cursor: pointer;
    font-weight: 500;
}
.link-danger:hover { text-decoration: underline; }
