:root {
    --swish-green: #01A200;
    --swish-green-dark: #047c00;
    --swish-green-deep: #045c00;
    --swish-green-soft: #eaf8ea;
    --swish-green-soft-2: #f3fbf3;

    --text-main: #151515;
    --text-muted: #5f6368;
    --text-soft: #777d78;
    --text-light: #ffffff;

    --bg-main: #f6f8f6;
    --bg-card: #ffffff;
    --bg-soft: #fbfdfb;
    --bg-sidebar: #132016;

    --border-soft: #e2e8e2;
    --border-strong: #cfd8cf;

    --danger: #d93636;
    --warning: #c08313;
    --info: #2877b7;

    --shadow-soft: 0 8px 26px rgba(0, 0, 0, 0.055);
    --shadow-card: 0 14px 36px rgba(0, 0, 0, 0.07);
    --shadow-green: 0 12px 32px rgba(1, 162, 0, 0.16);

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;

    --sidebar-width: 270px;
    --header-height: 72px;

    --transition: 180ms ease;
}


*,
*::before,
*::after {
    box-sizing: border-box;
}


html {
    min-height: 100%;
    scroll-behavior: smooth;
}


body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg-main);
    color: var(--text-main);
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;
    line-height: 1.6;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}


body.auth-page {
    background:
        radial-gradient(
            circle at top left,
            rgba(1, 162, 0, 0.12),
            transparent 30%
        ),
        var(--bg-main);
}


img,
svg {
    display: block;
    max-width: 100%;
}


button,
input,
textarea,
select {
    font: inherit;
}


button {
    cursor: pointer;
}


a {
    color: var(--swish-green);
}


h1,
h2,
h3,
h4,
p {
    margin-top: 0;
}


h1,
h2,
h3,
h4 {
    color: var(--text-main);
    letter-spacing: -0.035em;
}


.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


/* ==================================================
   Buttons
   ================================================== */

.swish-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 44px;
    padding: 0.7rem 1.15rem;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--swish-green);
    color: #ffffff;
    font-weight: 800;
    text-decoration: none;
    transition:
        transform var(--transition),
        background var(--transition),
        color var(--transition),
        border-color var(--transition),
        box-shadow var(--transition);
}


.swish-button:hover {
    background: var(--swish-green-dark);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-green);
    text-decoration: none;
}


.swish-button.secondary {
    background: #ffffff;
    color: var(--text-main);
    border-color: var(--border-strong);
}


.swish-button.secondary:hover {
    background: var(--swish-green-soft);
    color: var(--swish-green-dark);
    border-color: rgba(1, 162, 0, 0.35);
}


.swish-button.ghost {
    background: transparent;
    color: var(--text-muted);
}


.swish-button.ghost:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
    box-shadow: none;
}


.swish-button.full-width {
    width: 100%;
}


/* ==================================================
   Authentication
   ================================================== */

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(420px, 0.95fr) minmax(520px, 1.05fr);
}


.auth-brand-panel {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(2rem, 5vw, 5rem);
    background:
        radial-gradient(
            circle at top left,
            rgba(255, 255, 255, 0.17),
            transparent 28%
        ),
        linear-gradient(
            145deg,
            var(--swish-green),
            var(--swish-green-dark)
        );
    color: #ffffff;
}


.auth-brand-panel::after {
    content: "";
    position: absolute;
    width: 34rem;
    height: 34rem;
    right: -16rem;
    bottom: -18rem;
    border: 1px solid rgba(255, 255, 255, 0.17);
    border-radius: 50%;
}


.auth-brand {
    position: relative;
    z-index: 1;
    color: #ffffff;
    font-size: 1.7rem;
    font-weight: 900;
    letter-spacing: -0.05em;
}


.auth-brand span {
    color: rgba(255, 255, 255, 0.68);
}


.auth-brand-copy {
    position: relative;
    z-index: 1;
    max-width: 600px;
}


.auth-brand-copy h1 {
    margin-bottom: 1.2rem;
    color: #ffffff;
    font-size: clamp(2.8rem, 5.5vw, 5rem);
    line-height: 0.98;
    letter-spacing: -0.065em;
}


.auth-brand-copy p {
    max-width: 540px;
    color: rgba(255, 255, 255, 0.86);
    font-size: 1.08rem;
}


.auth-brand-meta {
    position: relative;
    z-index: 1;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.87rem;
}


.auth-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}


.auth-card {
    width: min(100%, 470px);
}


.auth-card-header {
    margin-bottom: 2rem;
}


.auth-card-header h2 {
    margin-bottom: 0.5rem;
    font-size: 2rem;
    font-weight: 850;
}


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


.form-field {
    margin-bottom: 1.15rem;
}


.form-field label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.9rem;
    font-weight: 800;
}


.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    min-height: 48px;
    padding: 0.8rem 0.95rem;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: #ffffff;
    color: var(--text-main);
    outline: none;
}


.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    border-color: var(--swish-green);
    box-shadow: 0 0 0 4px rgba(1, 162, 0, 0.1);
}


.form-message {
    min-height: 24px;
    margin: 0.8rem 0;
    color: var(--danger);
    font-size: 0.9rem;
    font-weight: 700;
}


/* ==================================================
   Application shell
   ================================================== */

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 900;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    background:
        linear-gradient(
            180deg,
            #15231a,
            #0e1811
        );
    color: #ffffff;
}


.sidebar-brand {
    min-height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    color: #ffffff;
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: -0.05em;
    text-decoration: none;
}


.sidebar-brand span {
    margin-left: 0.28rem;
    color: #68dd68;
}


.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.85rem;
}


.sidebar-section {
    margin-bottom: 1.4rem;
}


.sidebar-section-title {
    margin-bottom: 0.45rem;
    padding: 0 0.65rem;
    color: rgba(255, 255, 255, 0.38);
    font-size: 0.67rem;
    font-weight: 850;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}


.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 42px;
    margin-bottom: 0.2rem;
    padding: 0.65rem 0.75rem;
    border-radius: 9px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.89rem;
    font-weight: 680;
    text-decoration: none;
    transition:
        background var(--transition),
        color var(--transition);
}


.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
    text-decoration: none;
}


.sidebar-link.active {
    background: rgba(1, 162, 0, 0.18);
    color: #8bed8a;
}


.sidebar-link-icon {
    width: 22px;
    flex: 0 0 22px;
    text-align: center;
}


.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}


.sidebar-footer-note {
    margin-top: 0.7rem;
    color: rgba(255, 255, 255, 0.36);
    font-size: 0.72rem;
    text-align: center;
}


/* ==================================================
   Header
   ================================================== */

.app-header {
    position: fixed;
    top: 0;
    right: 0;
    left: var(--sidebar-width);
    z-index: 800;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 0 1.7rem;
    background: rgba(255, 255, 255, 0.93);
    border-bottom: 1px solid var(--border-soft);
    backdrop-filter: blur(16px);
}


.header-page-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 850;
}


.header-page-subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}


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


.company-switcher {
    min-height: 40px;
    padding: 0 0.75rem;
    border: 1px solid var(--border-soft);
    border-radius: 9px;
    background: #ffffff;
    color: var(--text-main);
    font-weight: 700;
}


.user-chip {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}


.user-avatar {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--swish-green-soft);
    color: var(--swish-green-dark);
    font-size: 0.8rem;
    font-weight: 900;
}


.user-name {
    color: var(--text-main);
    font-size: 0.84rem;
    font-weight: 800;
}


.user-role {
    color: var(--text-muted);
    font-size: 0.72rem;
}


/* ==================================================
   Main workspace
   ================================================== */

.app-main {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    padding-top: var(--header-height);
}


.workspace {
    width: 100%;
    max-width: 1680px;
    margin: 0 auto;
    padding: 1.8rem;
}


.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.8rem;
}


.page-heading h1 {
    margin-bottom: 0.35rem;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    font-weight: 900;
}


.page-heading p {
    margin: 0;
    color: var(--text-muted);
}


/* ==================================================
   Welcome
   ================================================== */

.welcome-panel {
    position: relative;
    overflow: hidden;
    margin-bottom: 1.25rem;
    padding: clamp(1.6rem, 4vw, 2.5rem);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(
            circle at right top,
            rgba(255, 255, 255, 0.2),
            transparent 28%
        ),
        linear-gradient(
            135deg,
            var(--swish-green),
            var(--swish-green-dark)
        );
    color: #ffffff;
}


.welcome-panel h2 {
    max-width: 780px;
    margin-bottom: 0.6rem;
    color: #ffffff;
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 900;
}


.welcome-panel p {
    max-width: 740px;
    margin-bottom: 0;
    color: rgba(255, 255, 255, 0.86);
}


/* ==================================================
   Department grid
   ================================================== */

.department-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}


.department-card {
    display: flex;
    flex-direction: column;
    min-height: 190px;
    padding: 1.25rem;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-main);
    box-shadow: var(--shadow-soft);
    text-decoration: none;
    transition:
        transform var(--transition),
        box-shadow var(--transition),
        border-color var(--transition);
}


.department-card:hover {
    transform: translateY(-3px);
    border-color: rgba(1, 162, 0, 0.3);
    box-shadow: var(--shadow-green);
    text-decoration: none;
}


.department-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    margin-bottom: 1rem;
    border-radius: 12px;
    background: var(--swish-green-soft);
    color: var(--swish-green);
    font-size: 1.1rem;
    font-weight: 900;
}


.department-card h3 {
    margin-bottom: 0.45rem;
    font-size: 1.05rem;
    font-weight: 850;
}


.department-card p {
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 0.86rem;
}


.department-link {
    margin-top: auto;
    color: var(--swish-green);
    font-size: 0.8rem;
    font-weight: 850;
}


/* ==================================================
   Overview cards
   ================================================== */

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}


.metric-card {
    padding: 1.2rem;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    background: #ffffff;
    box-shadow: var(--shadow-soft);
}


.metric-label {
    margin-bottom: 0.55rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 750;
}


.metric-value {
    color: var(--text-main);
    font-size: 1.75rem;
    font-weight: 900;
    letter-spacing: -0.045em;
}


.metric-note {
    margin-top: 0.3rem;
    color: var(--text-muted);
    font-size: 0.76rem;
}


/* ==================================================
   Panels
   ================================================== */

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.7fr);
    gap: 1rem;
}


.panel {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    background: #ffffff;
    box-shadow: var(--shadow-soft);
}


.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--border-soft);
}


.panel-header h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 850;
}


.panel-body {
    padding: 1.25rem;
}


/* ==================================================
   Quick actions
   ================================================== */

.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}


.quick-action {
    padding: 1rem;
    border: 1px solid var(--border-soft);
    border-radius: 11px;
    background: var(--bg-soft);
    color: var(--text-main);
    text-decoration: none;
}


.quick-action:hover {
    border-color: rgba(1, 162, 0, 0.28);
    background: var(--swish-green-soft-2);
    text-decoration: none;
}


.quick-action strong {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.86rem;
}


.quick-action span {
    color: var(--text-muted);
    font-size: 0.75rem;
}


/* ==================================================
   Activity
   ================================================== */

.activity-list {
    list-style: none;
    margin: 0;
    padding: 0;
}


.activity-item {
    position: relative;
    padding: 0 0 1rem 1.35rem;
    border-left: 1px solid var(--border-soft);
}


.activity-item:last-child {
    padding-bottom: 0;
}


.activity-item::before {
    content: "";
    position: absolute;
    top: 0.35rem;
    left: -5px;
    width: 9px;
    height: 9px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: var(--swish-green);
    box-shadow: 0 0 0 1px var(--swish-green);
}


.activity-title {
    margin-bottom: 0.2rem;
    font-size: 0.85rem;
    font-weight: 800;
}


.activity-meta {
    color: var(--text-muted);
    font-size: 0.74rem;
}


/* ==================================================
   Footer
   ================================================== */

.app-footer {
    margin-left: var(--sidebar-width);
    padding: 1.5rem 1.8rem 2rem;
    color: var(--text-muted);
    font-size: 0.75rem;
}


.app-footer-inner {
    max-width: 1680px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}


/* ==================================================
   Utilities
   ================================================== */

.error-state {
    margin-bottom: 1rem;
    padding: 1rem;
    border: 1px solid #efd0d0;
    border-radius: 10px;
    background: #fff6f6;
    color: #a82f2f;
}


.mobile-menu-button {
    display: none;
}


/* ==================================================
   Responsive
   ================================================== */

@media (max-width: 1250px) {
    .department-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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


@media (max-width: 950px) {
    :root {
        --sidebar-width: 0px;
    }

    .app-sidebar {
        width: 270px;
        transform: translateX(-100%);
        transition: transform 220ms ease;
    }

    .app-sidebar.open {
        transform: translateX(0);
    }

    .app-header {
        left: 0;
    }

    .app-main,
    .app-footer {
        margin-left: 0;
    }

    .mobile-menu-button {
        display: inline-flex;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-brand-panel {
        display: none;
    }
}


@media (max-width: 650px) {
    .workspace {
        padding: 1.1rem;
    }

    .department-grid,
    .metric-grid,
    .quick-actions {
        grid-template-columns: 1fr;
    }

    .page-heading {
        flex-direction: column;
    }

    .company-switcher,
    .user-details,
    .header-page-subtitle {
        display: none;
    }

    .app-footer-inner {
        flex-direction: column;
    }
}


@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}
