html, body {
    height: 100%;
    margin: 0;
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0d6efd;
}

.btn-primary {
    color: #fff;
    background-color: #0d6efd;
    border-color: #0a58ca;
}

.content {
    padding-top: 1rem;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto;
}

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #0d6efd;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

code {
    color: #c02d76;
}

/* Theme variables (Saffron Orange, India Green, Navy Blue) */
:root {
    --saffron: #FF9933;
    --india-green: #138808;
    --navy: #1A2D6B;
    --saffron-light: #ffb86b;
    --accent-gradient: linear-gradient(90deg, var(--india-green) 0%, var(--saffron) 100%);
}

/* Brand gradient text (uses background-clip) */
.brand-gradient {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 700;
}

/* Small starburst accent used near the brand */
.brand-gradient::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 8px;
    vertical-align: middle;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #fff 0%, rgba(255,255,255,0.8) 10%, rgba(255,255,255,0) 40%), var(--saffron);
    box-shadow: 0 0 8px rgba(255, 240, 140, 0.9), 0 0 18px rgba(255, 153, 51, 0.45);
}

/* Sidebar theme */
.nav-menu {
   background-color:transparent;
    color: #fff;
}

.nav-menu .nav-link {
    color: rgba(255,255,255,0.95);
}

.nav-menu .nav-link.active {
    background: rgba(255,255,255,0.06);
    border-left: 3px solid var(--saffron);
}

/* Collapsed sidebar styles */
.sidebar {
    /* make sidebar a fixed flex item so width changes affect layout reliably */
    flex: 0 0 250px;
    width: 250px;
    transition: flex-basis 0.18s ease, width 0.18s ease;
    overflow: hidden;
}

.sidebar.collapsed {
    flex: 0 0 72px;
    width: 72px;
}

.sidebar .nav-text {
    transition: opacity 0.12s ease, transform 0.12s ease;
}

.sidebar.collapsed .nav-text {
    opacity: 0;
    transform: translateX(-6px);
    pointer-events: none;
}

.sidebar.collapsed .nav-icon {
    margin-right: 0;
    text-align: center;
    width: 100%;
}

.nav-logo img { transition: height 0.12s ease; }
.sidebar.collapsed .nav-logo img { height: 36px !important; }
/* Logo swapping */
.nav-logo .logo-small { display: none; }
.sidebar.collapsed .nav-logo .logo-default { display: none !important; }
.sidebar.collapsed .nav-logo .logo-small { display: inline-block !important; }

/* Global theme usage */
:root {
    --primary: var(--india-green);
    --accent: var(--saffron);
    --muted-navy: rgba(26,45,107,0.08);
}

body {
    background: #ffffff;
    color: #212529;
}

    /* Sidebar footer */
    .sidebar-footer {
        padding: 0.5rem 0.75rem;
        color: rgba(255,255,255,0.85);
        font-size: 0.78rem;
        border-top: 1px solid rgba(255,255,255,0.04);
    }

    .sidebar.collapsed .sidebar-footer {
        text-align: center;
        font-size: 0.7rem;
    }

    /* Ensure sidebar inner area stretches so footer sits at bottom */
    .sidebar .sidebar-inner,
    .sidebar nav,
    .nav-menu {
        display: flex;
        flex-direction: column;
        height: 100%;
    }

    .sidebar .sidebar-footer { margin-top: auto; }

.btn-primary {
    background-color: var(--primary);
    border-color: rgba(0,0,0,0.05);
}

.btn-accent {
    background-color: var(--accent);
    color: #fff;
    border-color: rgba(0,0,0,0.05);
}

.brand-band {
    background: linear-gradient(90deg, var(--navy), rgba(26,45,107,0.85));
    color: white;
}

.brand-gradient { font-size: 1rem; }


/* Dropdown menu - professional theme-aligned styles */
.dropdown-menu {
    min-width: 12rem;
    background: #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 8px 24px rgba(26,45,107,0.10);
    padding: 0.25rem 0;
    border: 1px solid rgba(26,45,107,0.06);
}

.dropdown-item {
    padding: 0.5rem 1rem;
    color: var(--navy);
    background: transparent;
    display: block;
    text-decoration: none;
    transition: background 0.12s ease, color 0.12s ease;
}
    .dropdown-item a {
        color: var(--india-green);
        text-decoration: none;
    }
    .dropdown-item button {
        color: var(--india-green);
        text-decoration: none;
    }
.dropdown-item:hover,
.dropdown-item:focus {
    background: linear-gradient(90deg, rgba(19,136,8,0.06), rgba(255,153,51,0.06));
    color: var(--india-green);
}

.dropdown-divider {
    margin: 0 0;
    border-top: 1px solid rgba(26,45,107,0.06);
}

.top-row {
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0;
    border-bottom: 1px solid #dee2e6;
    background: var(--india-green)
}

.dashboard-page {
    display: grid;
    gap: 1rem;
    color: #202820;
}

.welcome-banner {
    min-height: 7rem;
    display: flex;
    align-items: center;
    padding: 1.35rem 1.55rem;
    border: 1px solid rgba(49, 84, 45, 0.08);
    border-radius: 8px;
    background-image: linear-gradient(90deg, rgba(255,255,255,0.96) 0%, rgba(255,255,255,0.82) 42%, rgba(255,255,255,0.28) 100%), url("/images/agri.png");
    background-size: cover;
    background-position: center 44%;
    box-shadow: 0 12px 28px rgba(31,54,34,0.07);
}

.welcome-banner h1 {
    margin: 0;
    font-size: 1.75rem;
    line-height: 1.1;
    font-weight: 900;
    letter-spacing: 0;
}

.welcome-banner p {
    margin: 0.55rem 0 0;
    color: #526158;
    font-size: 0.95rem;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.8rem;
}

.metric-card,
.panel {
    border: 1px solid rgba(41,72,44,0.1);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(31,54,34,0.07);
}

.metric-card {
    min-height: 6rem;
    display: flex;
    align-items: center;
    gap: 0.95rem;
    padding: 1.05rem;
}

.metric-card > i {
    width: 3.2rem;
    height: 3.2rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 1.45rem;
}

.metric-card div {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
}

.metric-card strong {
    color: #202820;
    font-size: 1.35rem;
    line-height: 1.1;
    font-weight: 900;
}

.metric-card span {
    color: #48544e;
    font-size: 0.78rem;
    font-weight: 800;
}

.metric-card small {
    color: #208f22;
    font-size: 0.73rem;
    font-weight: 800;
}

.employee > i {
    background: #e8f8e5;
    color: #209722;
}

.timesheet > i {
    background: #fff1df;
    color: #ff8f1e;
}

.leave > i {
    background: #e8f1ff;
    color: #2579e8;
}

.task > i {
    background: #f3e6ff;
    color: #9d42ea;
}

.payroll > i {
    background: #eaf9df;
    color: #238b1e;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 1.05fr) minmax(260px, 0.9fr);
    gap: 0.8rem;
}

.panel {
    display: grid;
    gap: 1rem;
    padding: 1.1rem;
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.panel-heading h2 {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0;
    color: #202820;
    font-size: 0.98rem;
    font-weight: 900;
    letter-spacing: 0;
}

.panel-heading h2 i {
    color: #22971e;
}

.panel-heading button {
    border: 1px solid rgba(65,89,70,0.14);
    border-radius: 8px;
    background: #ffffff;
    color: #22901f;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 0.45rem 0.65rem;
}

.attendance-content {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    align-items: center;
    gap: 1.25rem;
}

.attendance-ring {
    width: 11.7rem;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: conic-gradient(#22a51f 0 73%, #ff9b1f 73% 82%, #ff3d25 82% 90%, #9aa0a3 90% 100%);
}

.attendance-ring div {
    width: 7.9rem;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    align-content: center;
    border-radius: 50%;
    background: #ffffff;
}

.attendance-ring strong {
    font-size: 1.75rem;
    font-weight: 900;
}

.attendance-ring span {
    color: #56615b;
    font-size: 0.8rem;
    font-weight: 800;
}

.attendance-list,
.activity-list,
.quick-actions {
    display: grid;
    gap: 0.72rem;
}

.attendance-list span {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.75rem;
    align-items: center;
    color: #5b665f;
    font-size: 0.84rem;
    font-weight: 800;
}

.attendance-list i {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
}

.present { background: #22a51f; }
.absent { background: #ff3d25; }
.half-day { background: #ff9b1f; }
.leave-dot { background: #9aa0a3; }

.activity-item {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.7rem;
}

.activity-item > i,
.quick-actions > a > i:first-child {
    width: 2rem;
    height: 2rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 1rem;
}

.activity-item span {
    color: #2d3931;
    font-size: 0.84rem;
    font-weight: 800;
}

.activity-item small {
    color: #748078;
    font-size: 0.74rem;
    font-weight: 800;
}

.activity-green { background: #e8f8e5; color: #209722; }
.activity-orange { background: #fff1df; color: #ff8f1e; }
.activity-blue { background: #e8f1ff; color: #2579e8; }
.activity-purple { background: #f3e6ff; color: #9d42ea; }

.quick-actions a {
    min-height: 3.7rem;
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid rgba(40,70,44,0.08);
    border-radius: 8px;
    background: #f8faf7;
    color: #26342b;
    text-decoration: none;
}

.quick-actions a:hover,
.quick-actions a:focus {
    border-color: rgba(34,151,30,0.24);
    background: #f1f8ef;
}

.quick-actions a > i:first-child {
    background: #e8f8e5;
    color: #209722;
}

.quick-actions strong {
    display: block;
    color: #26342b;
    font-size: 0.82rem;
    font-weight: 900;
}

.quick-actions small {
    color: #6b766f;
    font-size: 0.72rem;
    font-weight: 700;
}

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

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

@media (max-width: 620px) {
    .metric-grid,
    .attendance-content {
        grid-template-columns: 1fr;
    }

    .welcome-banner h1 {
        font-size: 1.35rem;
    }
}

.membership-page {
    display: grid;
    gap: 18px;
}

.membership-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.membership-heading h1,
.membership-panel h2 {
    margin: 0;
    color: #142617;
    font-weight: 800;
    letter-spacing: 0;
}

.membership-heading p,
.membership-panel span,
.dialog-heading small {
    margin: 5px 0 0;
    color: #647067;
}

.membership-panel {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(20, 87, 31, 0.1);
    border-radius: 8px;
    box-shadow: 0 18px 42px rgba(20, 48, 21, 0.08);
    padding: 18px;
}

.grid-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.grid-add-button,
.membership-submit {
    background: linear-gradient(135deg, #188b23, #4d9c36) !important;
    border-color: #188b23 !important;
    color: #fff !important;
    box-shadow: 0 10px 18px rgba(24, 139, 35, 0.2);
}

.grid-add-button span,
.grid-add-button i,
.membership-submit span,
.membership-submit i {
    color: #fff !important;
}

.grid-add-button {
    min-width: 142px;
}

.form-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 8px;
    margin-bottom: 14px;
    padding: 10px 12px;
    font-weight: 700;
}

.form-alert.error {
    background: #fff1f0;
    color: #a9291f;
}

.form-alert.success {
    background: #edf8ed;
    color: #17731f;
}

.grid-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 220px;
    color: #4c6250;
}

.grid-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.action-edit {
    color: #197124 !important;
}

.action-delete {
    color: #c33224 !important;
}

.dialog-heading {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dialog-heading > span {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: #eaf7e9;
    color: #178620;
}

.membership-form {
    display: grid;
    gap: 14px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.form-field {
    display: grid;
    gap: 7px;
}

.form-field.full {
    grid-column: 1 / -1;
}

.form-field label {
    color: #273b2b;
    font-size: 0.86rem;
    font-weight: 800;
}

.active-row {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    padding-top: 2px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #eef2ee;
    padding-top: 16px;
}

.e-grid {
    border-radius: 8px;
    overflow: hidden;
}

.validation-message {
    color: #be2f24;
    font-size: 0.8rem;
    font-weight: 700;
}

.proof-link {
    color: #168722;
    font-weight: 900;
    text-decoration: none;
}

.proof-link:hover,
.proof-link:focus {
    color: #0f6419;
    text-decoration: underline;
}

.proof-upload {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px dashed rgba(24, 139, 35, 0.45);
    border-radius: 8px;
    background: #f6fbf5;
    color: #244d2b;
    cursor: pointer;
    font-weight: 850;
    padding: 0 12px;
}

.proof-upload input {
    display: none;
}

.proof-upload i {
    color: #168722;
    font-size: 1.1rem;
}

.upload-status {
    color: #3d6f43;
    font-weight: 800;
}

.proof-file-ready {
    display: block;
    margin-top: 6px;
}

.proof-view-button,
.proof-inline-button {
    color: #168722 !important;
    font-weight: 900 !important;
}

.proof-inline-button {
    margin-top: 8px;
}

.proof-preview-dialog .e-dlg-content {
    min-height: 420px;
}

.proof-preview-image {
    display: block;
    max-width: 100%;
    max-height: 70vh;
    margin: 0 auto;
    border: 1px solid #e0eadf;
    border-radius: 8px;
    object-fit: contain;
}

.proof-preview-frame {
    width: 100%;
    min-height: 70vh;
    border: 1px solid #e0eadf;
    border-radius: 8px;
    background: #fff;
}

@media (max-width: 720px) {
    .membership-heading,
    .grid-heading,
    .form-actions {
        align-items: stretch;
        flex-direction: column;
    }

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

.auth-check-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: #f4f7f3;
}

.auth-check-card {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(24, 139, 35, 0.12);
    border-radius: 8px;
    background: #ffffff;
    color: #214125;
    font-weight: 800;
    padding: 14px 18px;
    box-shadow: 0 18px 42px rgba(20, 48, 21, 0.08);
}
