/* your custom styles go here */

/* ── Global scale fix ──
   Tailwind defaults to 1rem = 16px, making the UI feel ~125% zoomed.
   Setting 14px here scales every rem-based utility (padding, font,
   gap, height, width) down proportionally — one change, whole app.
   Landing + auth pages keep their own explicit overrides if needed. */
html { font-size: 11px; }

/* Figma-aligned login surface. */
.auth-page {
    min-width: 320px;
    height: 100vh;
    overflow: hidden;
    background: #168c75;
}
.auth-page__background {
    position: relative;
    display: flex;
    height: 100vh;
    height: 100dvh;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0 1.25rem;
    background: linear-gradient(112deg, #0b6657 0%, #159b7d 49%, #0b5e51 100%);
}
.auth-page__stripes,
.auth-page__stripes::before,
.auth-page__stripes::after {
    position: absolute;
    content: "";
    pointer-events: none;
}
.auth-page__stripes {
    inset: -22rem -18rem;
    opacity: .2;
    transform: rotate(-12deg);
    background: repeating-linear-gradient(115deg, transparent 0 7rem, #074f48 7rem 10rem, transparent 10rem 17rem);
}
.auth-page__stripes::before {
    inset: 0;
    transform: translateX(-45%);
    background: repeating-linear-gradient(115deg, transparent 0 10rem, #39b89a 10rem 13rem, transparent 13rem 22rem);
}
.auth-page__stripes::after {
    inset: 0;
    transform: translateX(145%);
    background: repeating-linear-gradient(115deg, transparent 0 9rem, #064d48 9rem 12rem, transparent 12rem 20rem);
}
.auth-page__content {
    position: relative;
    z-index: 1;
    display: flex;
    width: min(100%, 500px);
    flex-direction: column;
    align-items: center;
}
.auth-page__logo {
    position: absolute;
    top: 1.35rem;
    left: 50%;
    display: block;
    width: 100px;
    height: 78px;
    transform: translateX(-50%);
}
.auth-page__logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.auth-card {
    position: relative;
    width: 100%;
    padding: 8.4rem 1.35rem 2.7rem;
    border: 1px solid rgba(211, 218, 219, .9);
    border-radius: 7px;
    background: #fdfdfd;
    box-shadow: 0 5px 12px rgba(5, 65, 57, .12);
}
.auth-card::before {
    position: absolute;
    top: -1px;
    left: 25px;
    right: 25px;
    height: 7px;
    border-radius: 0 0 7px 7px;
    background: #27c9ad;
    content: "";
}
.auth-card > .auth-form { max-width: 582px; margin: 0 auto; }
.auth-title { margin: 0; color: #075749; font-size: 1.5rem; font-weight: 700; line-height: 1.25; }
.auth-subtitle { margin: .55rem 0 0; color: #737b82; font-size: .75rem; line-height: 1rem; }
.auth-subtitle span { color: #2d6cf6; font-weight: 600; }
.auth-form { display: flex; flex-direction: column; gap: .99rem; }
.auth-field { display: flex; flex-direction: column; }
.auth-label { margin-bottom: .4rem; color: #68717a; font-size: .6875rem; line-height: 1rem; }
.auth-form input:not([type="hidden"]) { height: 50px; border: 1px solid #c8ced1; border-radius: 7px; background: #fff; padding: 0 .8rem; color: #343a40; font-size: .75rem; box-shadow: inset 0 1px 2px rgba(0,0,0,.03); }
.auth-form input:not([type="hidden"]):focus { border-color: #27a991; outline: 2px solid rgba(39, 201, 173, .18); }
.auth-login-as__options { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; border-radius: 7px; background: #f0f3f3; padding: .25rem; }
.auth-login-as__option { min-height: 42px; border: 0; border-radius: 5px; background: transparent; color: #68717a; font-size: .75rem; font-weight: 600; cursor: pointer; }
.auth-submit { min-height: 50px; border: 0; border-radius: 7px; background: linear-gradient(180deg, #3bc3ac 0%, #087c68 100%); color: #fff; font-size: .75rem; font-weight: 600; box-shadow: 0 2px 3px rgba(5, 91, 75, .25); cursor: pointer; }
.auth-submit:hover { background: linear-gradient(180deg, #49cdb7 0%, #08705f 100%); }
.auth-footer { margin: 1.3rem 0 0; color: #444; font-size: .75rem; font-weight: 500; line-height: 1rem; text-align: center; }
@media (max-width: 640px) {
    .auth-page { height: auto; min-height: 100vh; overflow: visible; }
    .auth-page__background { min-height: 100vh; height: auto; padding: 1.5rem .75rem; }
    .auth-page__logo { top: 1rem; width: 92px; height: 72px; }
    .auth-card { padding: 8.6rem 1.25rem 1.75rem; }
}

/* Hide Alpine.js elements until the framework initialises (prevents flash). */
[x-cloak] {
    display: none !important;
}

/* Narrow icon-above-label sidebar — all portals */
.sidebar-shell {
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    width: 108px;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    overflow: hidden;
    flex-shrink: 0;
}
.sidebar-logo {
    background: #ffffff;
    border-bottom: 1px solid #f3f4f6;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 0.5rem 0.625rem;
    gap: 0.2rem;
}
.sidebar-logo img { width: 30px; height: 30px; object-fit: contain; }
.sidebar-logo span { font-size: 0.6rem; font-weight: 700; color: #111827; text-align: center; }
.sidebar-nav {
    flex: 1 1 0%;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #e5e7eb #ffffff;
    padding: 0.375rem 0.3rem;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: #ffffff; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 9999px; }
.sidebar-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    border-radius: 0.625rem;
    padding: 0.5rem 0.25rem;
    font-size: 0.6rem;
    font-weight: 500;
    color: #1f2937;
    text-align: center;
    line-height: 1.2;
    transition: background-color 0.15s ease, color 0.15s ease;
    width: 100%;
}
.sidebar-link:hover {
    background: #f9fafb;
    color: #374151;
}
.sidebar-link.is-active {
    background: #e6f5f0;
    color: #0d6e5a;
    font-weight: 600;
}
.sidebar-link svg { flex-shrink: 0; }
.sidebar-badge {
    display: inline-flex;
    height: 1rem;
    min-width: 1rem;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: #10b981;
    padding: 0 0.25rem;
    font-size: 0.6rem;
    font-weight: 700;
    color: #ffffff;
}

/* Shared portal page chrome (invoices / approvals / company / etc.) */
.portal-page { position: relative; }
.portal-glow { display: none; }
.portal-fade { animation: portalFade .45s ease both; }
.portal-fade-1 { animation-delay: .05s; }
.portal-fade-2 { animation-delay: .1s; }
.portal-fade-3 { animation-delay: .15s; }
@keyframes portalFade {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.portal-eyebrow {
    margin: 0;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #059669;
}
.portal-title {
    margin: 0.2rem 0 0;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #005143;
}
.portal-sub {
    margin: 0.375rem 0 0;
    max-width: 36rem;
    font-size: 0.8125rem;
    line-height: 1.55;
    color: #6b7280;
}
.portal-panel {
    overflow: hidden;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.portal-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.625rem;
    border-bottom: 1px solid rgba(243, 244, 246, 0.9);
    padding: 0.625rem 0.875rem;
}
@media (min-width: 640px) {
    .portal-panel-head { padding-left: 1.125rem; padding-right: 1.125rem; }
}
.portal-thead {
    background: #f4faf8;
    border-bottom: 1px solid #f3f4f6;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #9ca3af;
}
.portal-row { transition: background-color .15s ease; }
.portal-row:hover { background: rgba(31, 157, 110, 0.05); }
.portal-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    border-radius: 0.625rem;
    border: 1px solid #e5e7eb;
    background: #fff;
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #4b5563;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.portal-tab:hover { background: #f9fafb; }
.portal-tab.is-active {
    border-color: transparent;
    background: #059669;
    color: #fff;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.2);
}
.portal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    border-radius: 0.625rem;
    background: #059669;
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #fff;
    box-shadow: 0 3px 10px rgba(5, 150, 105, 0.18);
    transition: transform .15s ease, background-color .15s ease;
}
.portal-btn:hover { background: #047857; transform: translateY(-1px); }
.portal-empty {
    border-radius: 0.75rem;
    border: 1px dashed #e5e7eb;
    background: #fff;
    padding: 2rem 1.25rem;
    text-align: center;
}
.portal-section-label {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.75rem;
}
.portal-section-label > span:first-child {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #9ca3af;
}
.portal-section-label > i {
    flex: 1;
    height: 1px;
    background: #f3f4f6;
}

/* ── Landing page (Figma hero + features) ── */
.landing-header {
    background: #FFFFFF;

    backdrop-filter: blur(100px);
    -webkit-backdrop-filter: blur(100px);

    box-shadow:
        inset -67.83px 67.83px 67.83px 0 rgba(255, 255, 255, 0.10),
        inset 67.83px -67.83px 67.83px 0 rgba(0, 153, 119, 0.10);
}
.landing-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.65rem;
    background: linear-gradient(90deg, #2db372 0%, #178a5f 45%, #0f6b49 100%);
    box-shadow: 0 8px 20px -8px rgba(15, 107, 73, 0.5);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.landing-btn-primary:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 12px 24px -8px rgba(15, 107, 73, 0.55);
}

.landing-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
}
.landing-nav-links {
    justify-self: center;
}
.landing-nav-cta {
    justify-self: end;
}
.landing-nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color:#EEF8F6;
    transition: color .15s ease;
}
.landing-nav-link:hover {
    color: #0f6b49;
}

.landing-hero {
    position: relative;
    overflow: hidden;
    background: #ffffff;
}
.landing-hero-bands {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.landing-hero-bands svg {
    position: absolute;
    top: -8%;
    right: -6%;
    width: 72%;
    height: 118%;
}

/* Clockwise tilt — top-right higher (matches Figma) */
.landing-hero-card {
    transform: rotate(9deg);
}
@media (min-width: 1024px) {
    .landing-hero-card {
        transform: rotate(11deg) translate(2%, 4%);
    }
}
@media (max-width: 1023px) {
    .landing-hero-card {
        transform: rotate(5deg);
        margin-top: 0.5rem;
    }
}

.landing-features-grid {
    background:
        linear-gradient(to bottom, rgba(247, 251, 249, 1) 0%, rgba(247, 251, 249, 0) 18%),
        linear-gradient(90deg, rgba(174, 224, 200, 0.45) 1px, transparent 1px),
        linear-gradient(0deg, rgba(174, 224, 200, 0.45) 1px, transparent 1px);
    background-size: 100% 100%, 56px 56px, 56px 56px;
    transform: perspective(900px) rotateX(58deg) scale(1.35);
    transform-origin: center top;
    mask-image: linear-gradient(to bottom, transparent 0%, black 22%, black 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 22%, black 100%);
}

.landing-feature-card {
    transition: transform .2s ease, box-shadow .2s ease;
}
.landing-feature-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px -16px rgba(10, 58, 42, 0.18);
}
