@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

:root {
    --navy-900: #102a43;
    --navy-800: #173f5f;
    --blue-600: #1976b9;
    --blue-200: #b9def4;
    --blue-100: #eaf6fd;
    --blue-050: #f7fbfe;
    --ink: #183247;
    --muted: #668097;
    --white: #ffffff;
    --line: #d5e7f2;
    --accent: #45a9df;
    --shadow: 0 30px 90px rgba(23, 63, 95, 0.16);
    --font-size-xs: 0.7rem;
    --font-size-sm: 0.8rem;
    --font-size-md: 0.9rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.15rem;
    --font-size-xl: 1.4rem;
    --font-size-2xl: 1.8rem;
    --font-size-3xl: 2rem;
    --font-size-hero: clamp(1.4rem, 4vw, 2rem);
    --font-size-display: clamp(1.6rem, 2.5vw, 1.8rem);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Inter", sans-serif;
}

html,
body {
    width: 100%;
    height: 100%;
}

.alert-box {
    position: fixed;
    right: 40px;
    top: 30px;
    align-items: center;
    gap: 0.6rem;
    color: #176b45;
    background-color: #effaf4;
    backdrop-filter: blur(12px);
    border-radius: 11px;
    padding: 0.6rem 1rem;
    border: 1px solid #54b987;
    font-size: var(--font-size-lg);
    z-index: 9999;
    display: none;
}

.timer {
    position: absolute;
    border-radius: 11px;
    top: 0;
    left: 0;
    background-color: rgba(22, 160, 93, 0.12);
    width: 100%;
    height: 100%;
    z-index: 1;
    animation: timer 5s linear forwards;
}

@keyframes timer {
    from {
        width: 100%;
    }

    to {
        width: 0;
    }
}

.alert-box h5 {
    position: relative;
    z-index: 2;
}

.admin-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    position: relative;
    gap: 1rem;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100dvh;
    padding: 2rem 1.25rem;
    overflow: hidden;
    background:
        radial-gradient(circle at 7% 15%, rgba(185, 222, 244, 0.4), transparent 24%),
        radial-gradient(circle at 94% 86%, rgba(234, 246, 253, 0.9), transparent 30%),
        var(--white);
}

.login-container {
    display: flex;
    width: 100%;
    max-width: 820px;
    height: fit-content;
    min-width: 0;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    background: var(--white);
    border: 1px solid rgba(213, 231, 242, 0.9);
    border-radius: 1.75rem;
    box-shadow: var(--shadow);
    overflow: hidden;
    transform: translateY(0);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.login-content {
    display: flex;
    flex-direction: row;
    justify-content: center;
    width: 100%;
    align-items: center;
    gap: 0;
    border-radius: 1.75rem;
}

.logo-image {
    position: fixed;
    top: -1.7rem;
    left: 50%;
}

.top {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    width: 42%;
    min-height: 340px;
    border-radius: 0;
    padding: 2.5rem 2rem;
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, var(--navy-900) 0%, var(--navy-800) 72%, #1d6a97 100%);
}

.top::before {
    content: "";
    position: absolute;
    width: 190px;
    height: 190px;
    right: -78px;
    top: -110px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    box-shadow: 0 0 0 18px rgba(255, 255, 255, 0.045), 0 0 0 36px rgba(255, 255, 255, 0.025);
}

.top::after {
    content: "";
    position: absolute;
    left: 2rem;
    bottom: 2.5rem;
    width: 48px;
    height: 4px;
    border-radius: 999px;
    background: var(--accent);
}

.top h2 {
    font-size: var(--font-size-hero);
    color: var(--white);
    letter-spacing: 0;
    line-height: 1.2;
    font-weight: 600;
    position: relative;
    z-index: 1;
    opacity: 1;
}

.bottom {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 58%;
    border-radius: 0;
    padding: 2rem;
    background: linear-gradient(180deg, var(--white), var(--blue-050));
}

.bottom form {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.2rem;
    width: 100%;
}

.input-group {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 1rem;
    width: 100%;
}

.input-group i {
    color: var(--blue-600);
    font-size: var(--font-size-lg);
}

.input-group label {
    color: var(--ink);
    font-size: var(--font-size-base);
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    letter-spacing: 0.2px;
    padding: 0;
    border-radius: 6px;
}

.input-group input {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border-radius: 0.65rem;
    border: 1px solid var(--line);
    background: var(--blue-050);
    color: var(--ink);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    letter-spacing: 0.5px;
    min-height: 46px;
}

.input-group input:hover {
    border-color: var(--blue-200);
}

.input-group input::placeholder {
    color: var(--muted);
}

.input-group input:focus {
    outline: none;
    background: var(--white);
    border-color: var(--blue-600);
    box-shadow: 0 0 0 4px rgba(25, 118, 185, 0.12);
}

.bottom form {
    position: relative;
}

.login-btn {
    width: 100%;
    height: fit-content;
    border-radius: 0.7rem;
    border: none;
    background: var(--navy-900);
    color: var(--white);
    letter-spacing: 0.3px;
    padding: 0.7rem 1rem;
    margin-top: 0.45rem;
    font-weight: 600;
    cursor: pointer;
    min-height: 45px;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.login-btn:focus-visible {
    outline: 3px solid rgba(69, 169, 223, 0.35);
    outline-offset: 3px;
}

.login-btn:hover {
    background: var(--navy-800);
    box-shadow: 0 10px 22px rgba(16, 42, 67, 0.2);
    transform: translateY(-1px);
}

.alt-login-text {
    width: 100%;
    margin: 0.2rem 0 0;
    text-align: center;
    color: var(--muted);
    font-size: var(--font-size-md);
    letter-spacing: 0.4px;
}

.alt-login-text a {
    color: var(--blue-600);
    text-decoration: none;
    font-weight: 600;
}

.alt-login-text a:hover {
    text-decoration: underline;
}

.top img {
    width: 210px;
    height: auto;
    object-fit: cover;
}

.top .separator-img {
    width: 100%;
    max-width: 350px;
    opacity: 0.7;
}

.desktop-nav-bar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 1.6rem 1.2rem 1.35rem;
    background: rgba(255, 255, 255, 0.96);
    color: #17202d;
    position: fixed;
    top: 0;
    left: 0;
    width: 210px;
    max-width: 210px;
    height: 100%;
    flex-direction: column;
    box-shadow: 8px 0 24px rgba(34, 43, 58, 0.04);
    border-right: 1px solid #dfe1e2;
    /*edf0f4*/
    z-index: 10;
    gap: 1.45rem;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0 0 1.5rem 0;
}

.logo-text-container {
    min-width: 0;
}

.logo-text {
    color: #17202d;
    font-size: var(--font-size-base);
    line-height: 1.1;
    font-weight: 750;
    letter-spacing: -0.3px;
}

.logo-sub-text {
    margin-top: 0.2rem;
    color: #7b8491;
    font-size: var(--font-size-xs);
    line-height: 1;
    font-weight: 500;
}

.desktop-nav-bar nav {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    width: 100%;
}

.nav-left-body {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    width: 100%;
    gap: 0.4rem;
}

.nav-dropdown {
    width: 100%;
}

.nav-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-height: 44px;
    padding: 0.65rem 0.8rem;
    border-radius: 0.55rem;
    color: #26313f;
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    list-style: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.nav-dropdown-toggle::-webkit-details-marker {
    display: none;
}

.nav-dropdown-toggle>i:first-child {
    width: 19px;
    color: #697482;
    font-size: var(--font-size-base);
    text-align: center;
}

.nav-chevron {
    width: auto !important;
    margin-left: auto;
    font-size: var(--font-size-xs) !important;
    transition: transform 0.2s ease;
}

.nav-dropdown[open] .nav-chevron {
    transform: rotate(180deg);
}

.nav-dropdown-toggle:hover,
.nav-dropdown[open] .nav-dropdown-toggle {
    color: #3e51d1;
    background: #f0f1ff;
}

.nav-dropdown-toggle:hover>i:first-child,
.nav-dropdown[open] .nav-dropdown-toggle>i:first-child {
    color: #3e51d1;
}

.nav-dropdown-menu {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin: 0.4rem 0 0.35rem 1.1rem;
    padding-left: 0.65rem;
    border-left: 1px solid #dfe1e2;
}

.nav-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 38px;
    padding: 0.5rem 0.65rem;
    border-radius: 0.45rem;
    color: #697482;
    font-size: var(--font-size-xs);
    font-weight: 550;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.nav-dropdown-menu a i {
    width: 16px;
    text-align: center;
}

.nav-dropdown-menu a:hover,
.nav-dropdown-menu a[aria-current="page"] {
    color: #3e51d1;
    background: #f4f5ff;
}

.link-container {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 0.9rem;
    min-height: 44px;
    padding: 0.65rem 0.8rem;
    border-radius: 0.55rem;
    width: 100%;
    transition: background 0.2s ease, color 0.2s ease;
}

.link-container a {
    text-decoration: none;
    color: #26313f;
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.link-container i {
    width: 19px;
    color: #697482;
    font-size: var(--font-size-base);
    text-align: center;
}

.link-container:hover {
    background: #f4f5ff;
}

.link-container:hover a,
.link-container:hover i,
.link-container.active a,
.link-container.active i {
    color: #3e51d1;
}

.link-container.active {
    background: #f0f1ff;
}

.nav-left-logo {
    width: 34px;
    height: 34px;
    margin: 0;
    object-fit: contain;
}

.nav-link:focus-visible,
.logout-form input:focus-visible,
.nav-dropdown-toggle:focus-visible,
.nav-dropdown-menu a:focus-visible {
    outline: 3px solid rgba(75, 95, 232, 0.2);
    outline-offset: 2px;
}

.logout-form {
    width: 100%;
    padding-top: 0.85rem;
    border-top: 1px solid #edf0f4;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    min-height: 44px;
    padding: 0.5rem 1rem;
    border: 1px solid #e3e7ee;
    border-radius: 0.6rem;
    background: #4b5fe8;
    gap: 0.75rem;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(75, 95, 232, 0.2);
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.logout-form:hover {
    background: #3e51d1;
    border-color: #3e51d1;
    box-shadow: 0 10px 20px rgba(75, 95, 232, 0.3);
    transform: translateY(-2px);
}

.logout-form>i {
    z-index: 1;
    color: #ffffff;
    font-size: var(--font-size-md);
    transition: transform 0.2s ease;
}

.logout-form:hover>i {
    transform: translateX(2px);
}

.logout-form input[type="submit"] {
    width: 100%;
    color: #ffffff;
    font: inherit;
    background: transparent;
    font-size: var(--font-size-sm);
    border: none;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.logout-form input[type="submit"]:active {
    transform: translateY(0);
}

.logout-form:has(input[type="submit"]:active) {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(75, 95, 232, 0.2);
}

.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #3e51d110;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
    padding: 3rem 1rem;
}

.mobile-logout-form {
    display: none;
}

.mobile-nav-bar,
.hamburger {
    display: none;
}

.mobile-nav.active {
    pointer-events: auto;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 2.5rem;
    color: var(--secondary);
    cursor: pointer;
    transition: transform 0.2s ease;
    user-select: none;
    z-index: 1001;
    color: white;
    background: #4b5fe8;
    border-radius: 50%;
    border: none;
    height: 40px;
    width: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-bottom: 4.8px;
}

.mobile-nav a {
    color: #4b5fe8d1;
    text-decoration: none;
    font-size: 1.6rem;
    font-weight: bold;
    position: relative;
    text-align: center;
}

.mobile-nav a span {
    height: 100%;
}

.mobile-nav a::after {
    content: "";
    display: block;
    width: 60%;
    height: 2px;
    background: #4b5fe8d1;
    margin: 0.35rem auto 0;
}

.app-container {
    width: 100%;
    height: auto;
    max-width: 1800px;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem 1.5rem 1.5rem 14.4rem;
    background:
        linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.5)),
        url('../assets/images/white-bg.jpg') no-repeat center center/cover;
    background-attachment: fixed;
}

/* Dashboard Styles */

.section-title {
    display: flex;
    align-items: center;
    width: fit-content;
    margin: 0;
    padding: 0.4rem 0.75rem;
    color: #000;
    font-size: var(--font-size-display);
    font-weight: 650;
    line-height: 1.2;
    letter-spacing: 1px;
    background: #4B5FE840;
    backdrop-filter: blur(2px);
    border: 1px solid #4B5FE860;
    border-radius: 0.5rem;
}

.app-container-body {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
}

.kpi-cards-container {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.kpi-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    padding: 1rem;
    border: 1px solid #dfe1e2;
    border-radius: 0.85rem;
    background: #ffffff;
    backdrop-filter: blur(14px);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
}

.dashboard-arrow-container {
    padding: 0.5rem 0.5rem;
    height: 30px;
    width: 30px;
    border-radius: 50%;
    background: #3e51d120;
    display: flex;
    justify-content: center;
    align-items: center;
}

.dashboard-kpi-arrow {
    transform: rotate(45deg);
    color: #3e51d1;
}

.kpi-card:hover {
    border-color: #3e51d150;
    box-shadow: 0 18px 34px rgba(34, 43, 58, 0.12);
    transform: translateY(-2px);
}

.kpi-heading {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    color: #102a43;
    font-size: var(--font-size-lg);
    line-height: 1.3;
    font-weight: 650;
}

.kpi-heading>i {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    color: #3e51d1;
    font-size: var(--font-size-lg);
}

.kpi-title {
    display: block;
}

.kpi-card a {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 0.75rem;
    width: 100%;
    height: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: 0.65rem;
    color: #3e51d1;
    font-size: var(--font-size-sm);
    font-weight: 650;
}

.kpi-card a i {
    font-size: var(--font-size-sm);
    transform: rotate(45deg);
}

.kpi-card a:focus-visible {
    outline: 3px solid rgba(75, 95, 232, 0.2);
    outline-offset: 4px;
}

/* Product Management Styles */

.product-page {
    gap: 1.25rem;
}

.product-section {
    width: 100%;
    max-width: 1400px;
    padding: 1.35rem;
    border: 1px solid #dfe1e2;
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 12px 28px rgba(34, 43, 58, 0.07);
}

.product-section h2 {
    margin-bottom: 1.1rem;
    color: #000;
    font-size: var(--font-size-lg);
    font-weight: 650;
}

.product-form {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(150px, 1fr) auto;
    align-items: end;
    gap: 1rem;
}

.product-form label {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    color: #26313f;
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.product-form input {
    width: 100%;
    min-height: 44px;
    padding: 0.7rem 0.8rem;
    border: 1px solid #dfe1e2;
    border-radius: 0.55rem;
    color: #26313f;
    background: #f8f9fb;
    font: inherit;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.product-form input:hover {
    border-color: #b7bfce;
}

.product-form input:focus {
    outline: none;
    border-color: #4b5fe8;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(75, 95, 232, 0.14);
}

.product-form .login-btn {
    width: auto;
    min-width: 140px;
    margin-top: 0;
    background: #4b5fe8;
}

.product-form .login-btn:hover {
    background: #3e51d1;
}

.product-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.product-table {
    width: 100%;
    border-collapse: collapse;
    color: #26313f;
    font-size: var(--font-size-sm);
}

.product-table th,
.product-table td {
    padding: 0.85rem 0.7rem;
    border-bottom: 1px solid #edf0f4;
    text-align: left;
    vertical-align: middle;
}

.product-table th {
    color: #697482;
    font-size: var(--font-size-xs);
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.product-table tbody tr:hover {
    background: #f4f5ff;
}

.product-empty-state {
    color: #697482;
    font-size: var(--font-size-sm);
}

.party-page .party-section {
    width: 100%;
    padding: 1.35rem;
    border: 1px solid #dfe1e2;
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 12px 28px rgba(34, 43, 58, 0.07);
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.1rem;
}

.section-heading h2,
.party-modal-dialog h2 {
    color: #17202d;
    font-size: var(--font-size-lg);
    font-weight: 650;
}

.primary-action,
.icon-action {
    border: 0;
    cursor: pointer;
}

.primary-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
    border-radius: 0.55rem;
    color: #ffffff;
    background: #4b5fe8;
    font-size: var(--font-size-sm);
    font-weight: 650;
    text-decoration: none;
    width: fit-content;
}

.primary-action:hover {
    background: #3e51d1;
}

.party-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.party-table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
    color: #26313f;
    font-size: var(--font-size-sm);
}

.party-table th,
.party-table td {
    padding: 0.85rem 0.7rem;
    border-bottom: 1px solid #edf0f4;
    text-align: left;
}

.party-table th {
    color: #697482;
    font-size: var(--font-size-xs);
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.party-table tbody tr:hover {
    background: #f4f5ff;
}

.recent-invoices-table {
    width: 100%;
    min-width: 0;
    border: 1px solid #dfe1e2;
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 12px 28px rgba(34, 43, 58, 0.07);
}

.recent-invoices-table-body {
    width: 100%;
    min-width: 0;
    padding: 1.35rem;
}

.recent-invoices-heading {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.recent-invoices-heading h2 {
    color: #17202d;
    font-size: var(--font-size-lg);
    font-weight: 650;
}

.recent-invoices-table-wrapper {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    border: 1px solid #edf0f4;
    border-radius: 0.65rem;
}

.recent-invoices-table-grid {
    width: max(100%, 560px);
    border-collapse: collapse;
    color: #26313f;
    font-size: var(--font-size-sm);
}

.recent-invoices-table-grid th,
.recent-invoices-table-grid td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #edf0f4;
    text-align: left;
    white-space: nowrap;
}

.recent-invoices-table-grid th {
    color: #697482;
    background: #f8f9fb;
    font-size: var(--font-size-xs);
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.recent-invoices-table-grid tbody tr:last-child td {
    border-bottom: 0;
}

.recent-invoices-table-grid tbody tr:hover {
    background: #f4f5ff;
}

.invoice-number {
    color: #3e51d1;
    font-weight: 700;
}

.recent-invoices-total {
    text-align: right !important;
    font-weight: 650;
}

.recent-invoices-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

.party-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.party-actions form {
    margin: 0;
}

.invoice-actions {
    white-space: nowrap;
}

.invoice-actions form {
    display: inline-flex;
    align-items: center;
    width: fit-content;
}

.invoice-actions .primary-action:disabled {
    cursor: wait;
    opacity: 0.6;
}

.icon-action {
    display: inline-grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 0.45rem;
    color: #3e51d1;
    background: #f0f1ff;
}

.icon-action:hover {
    color: #ffffff;
    background: #4b5fe8;
}

.icon-action.delete-action {
    color: #a33a3a;
    background: #fff2f2;
}

.icon-action.delete-action:hover {
    color: #ffffff;
    background: #c34755;
}

.action-disabled {
    color: #697482;
}

.party-modal[hidden] {
    display: none;
}

.party-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 1.25rem;
}

.party-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(23, 32, 45, 0.38);
    backdrop-filter: blur(8px);
}

.party-modal-dialog {
    position: relative;
    width: min(760px, 100%);
    max-height: min(90vh, 760px);
    overflow-y: auto;
    padding: 1.5rem;
    border: 1px solid #dfe1e2;
    border-radius: 0.85rem;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(23, 32, 45, 0.22);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 0.45rem;
    color: #ffffff;
    background: #3e51d1;
    cursor: pointer;
}

.modal-close:hover {
    color: #a33a3a;
    background: #fff2f2;
}

.party-modal-dialog h2 {
    margin-bottom: 1.1rem;
}

.party-section {
    width: 100%;
    padding: 1.35rem;
    border: 1px solid #dfe1e2;
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 12px 28px rgba(34, 43, 58, 0.07);
}

.party-section h2 {
    margin-bottom: 1.1rem;
    color: #17202d;
    font-size: var(--font-size-lg);
    font-weight: 650;
    background: linear-gradient(90deg, #3e51d120, transparent);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    max-width: fit-content;
    border: 1px solid #3e51d130;
}

.settings-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.settings-heading h2 {
    margin-bottom: 0.25rem;
}

.settings-heading p,
.settings-help {
    color: #668097;
    font-size: var(--font-size-sm);
}

.settings-form-heading {
    grid-column: 1 / -1;
    padding-top: 0.85rem;
    border-top: 1px solid #e5edf2;
    color: #173f5f;
    font-size: var(--font-size-base);
    font-weight: 700;
}

.settings-form-heading:first-of-type {
    padding-top: 0;
    border-top: 0;
}

.settings-form input[type="file"] {
    padding: 0.45rem;
    background: #ffffff;
}

.settings-image-preview {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 100px;
    padding: 0.75rem;
    border: 1px dashed #b9def4;
    border-radius: 0.55rem;
    background: #f7fbfe;
}

.settings-image-preview img {
    width: 96px;
    height: 72px;
    object-fit: contain;
    border-radius: 0.35rem;
    background: #ffffff;
}

.settings-image-preview label {
    flex-direction: row;
    align-items: center;
    font-weight: 500;
}

.settings-help {
    grid-column: 1 / -1;
}

.party-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.party-form label {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    color: #26313f;
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.party-form-wide,
.party-form-actions {
    grid-column: 1 / -1;
}

.party-form input,
.party-form select,
.party-form textarea {
    width: 100%;
    min-height: 44px;
    padding: 0.7rem 0.8rem;
    border: 1px solid #dfe1e2;
    border-radius: 0.55rem;
    color: #26313f;
    background: #f8f9fb;
    font: inherit;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.party-form textarea {
    min-height: 96px;
    resize: vertical;
}

.gst-lookup-status {
    grid-column: 1 / -1;
    min-height: 1.25rem;
    margin: -0.45rem 0 0;
    color: #32745b;
    font-size: 0.85rem;
}

.gst-lookup-status.gst-lookup-error {
    color: #b42318;
}

.party-form input:focus,
.party-form select:focus,
.party-form textarea:focus {
    outline: none;
    border-color: #4b5fe8;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(75, 95, 232, 0.14);
}

.party-form .input-invalid {
    border-color: #d93648;
    background: #fff7f7;
    box-shadow: 0 0 0 4px rgba(217, 54, 72, 0.12);
}

.party-form-actions .login-btn {
    width: auto;
    min-width: 140px;
    margin-top: 0;
    background: #4b5fe8;
}

.party-form-actions .login-btn:hover {
    background: #3e51d1;
}

.product-table-actions form {
    margin: 0;
}

.product-table-actions button {
    padding: 0;
    border: 0;
    color: #a33a3a;
    background: transparent;
    font: inherit;
    font-size: var(--font-size-sm);
    font-weight: 650;
    cursor: pointer;
}

.product-table-actions button:hover {
    text-decoration: underline;
}

.invoice-items-heading,
.invoice-print-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    grid-column: 1 / -1;
}

.invoice-items-heading h3 {
    color: #000;
    font-size: var(--font-size-base);
    background: linear-gradient(90deg, #3e51d120, transparent);
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    border: 1px solid #3e51d130;

}

.invoice-items {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    grid-column: 1 / -1;
}

.invoice-item {
    display: grid;
    grid-template-columns: 1.3fr 2fr 0.8fr 0.75fr 0.85fr auto auto;
    gap: 0.7rem;
    align-items: end;
    padding: 0.85rem;
    border: 1px solid #dfe1e2;
    border-radius: 0.55rem;
    background: #f8f9fb;
}

.invoice-item label {
    min-width: 0;
}

.invoice-item textarea {
    min-height: 44px;
}

.invoice-line-total {
    min-width: 70px;
    padding-bottom: 0.8rem;
    color: #173f5f;
    font-size: var(--font-size-sm);
    font-weight: 700;
    text-align: right;
}

.remove-invoice-item {
    width: 38px;
    height: 38px;
    border: 0;
    color: #a33a3a;
    background: transparent;
    cursor: pointer;
}

.invoice-summary {
    display: flex;
    justify-content: flex-end;
    gap: 1.5rem;
    grid-column: 1 / -1;
    color: #668097;
    font-size: var(--font-size-sm);
}

.invoice-summary strong {
    margin-left: 0.3rem;
    color: #173f5f;
}

.invoice-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem 1.5rem;
}

.invoice-detail-grid p {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid #edf0f4;
}

.invoice-detail-grid span {
    color: #668097;
    text-align: right;
}

.invoice-detail-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.invoice-print-actions {
    width: 100%;
    justify-content: flex-end;
    gap: 0.8rem;
}

.invoice-print-actions .login-btn,
.invoice-print-actions .primary-action {
    width: auto;
}

.print-invoice {
    width: 100%;
    max-width: 1200px;
    padding: 1.25rem;
    border: 1px solid #1976b9;
    color: #111111;
    background: #ffffff;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 0.9rem;
}

.print-invoice p {
    margin: 0.2rem 0;
}

.print-invoice h2 {
    margin-bottom: 0.3rem;
    font-size: 1.55rem;
}

.print-invoice h3 {
    margin-bottom: 0.35rem;
    font-size: 1rem;
}

.print-invoice-header,
.print-invoice-meta,
.print-invoice-lower {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.print-invoice-header {
    padding: 0.25rem 0.2rem 1rem;
    border-bottom: 2px solid #1976b9;
}

.print-invoice-header>strong {
    align-self: center;
    color: #1976b9;
    font-size: 1.35rem;
    text-align: center;
}

.print-invoice-header small {
    color: #111111;
    font-size: 0.75rem;
}

.print-invoice-meta {
    padding: 0.75rem 0.2rem;
    border-bottom: 1px solid #1976b9;
}

.print-invoice-meta section+section {
    padding-left: 1rem;
    border-left: 1px solid #1976b9;
}

.print-invoice-items {
    width: 100%;
    border-collapse: collapse;
}

.print-invoice-items th,
.print-invoice-items td {
    padding: 0.45rem;
    border: 1px solid #1976b9;
    vertical-align: top;
}

.print-invoice-items th {
    background: #eaf6fd;
    text-align: center;
}

.print-invoice-items td:not(:nth-child(2)) {
    text-align: center;
}

.print-invoice-items tfoot th {
    text-align: right;
}

.print-invoice-lower {
    margin-top: 0.1rem;
}

.print-invoice-lower>section {
    position: relative;
    min-height: 170px;
    padding: 1rem 0.2rem;
}

.print-totals {
    padding: 0 !important;
}

.print-totals p {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    border-bottom: 1px solid #1976b9;
    background: #eaf6fd;
}

.print-totals p:last-child {
    font-size: 1rem;
    font-weight: 700;
}

.invoice-qr {
    width: 125px;
    height: 125px;
    margin: 0.5rem 0 0 40%;
    object-fit: contain;
}

.print-invoice-footer {
    position: relative;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #1976b9;
}

.print-invoice-footer ul {
    margin: 0.6rem 0 1.4rem 1.2rem;
    padding: 0;
}

.authorized {
    text-align: right;
}

.invoice-signature {
    position: absolute;
    right: 1rem;
    bottom: 1.4rem;
    width: 130px;
    max-height: 65px;
    object-fit: contain;
}

.certified {
    padding-top: 0.45rem;
    border-top: 1px solid #1976b9;
    text-align: center;
}

@media print {

    .desktop-nav-bar,
    .page-title,
    .invoice-print-actions,
    .alert-box {
        display: none !important;
    }

    .app-container {
        display: block;
        padding: 0;
        background: #ffffff;
    }

    .print-invoice {
        max-width: none;
        border: 1px solid #1976b9;
    }

    @page {
        size: A4;
        margin: 8mm;
    }
}

/* Responsive Styles */

@media (max-width: 480px) {
    .admin-wrapper {
        padding: 1rem;
    }

    .bottom {
        padding: 1.5rem 1.25rem 1.25rem;
    }

    .login-content {
        flex-direction: column;
    }

    .top,
    .bottom {
        width: 100%;
    }

    .top {
        min-height: 126px;
        padding: 2rem 1.5rem;
    }

    .top::after {
        left: 1.5rem;
        bottom: 1.5rem;
    }

}

@media (min-width: 481px) and (max-width: 720px) {
    .bottom {
        padding: 2.25rem 1.75rem;
    }
}

@media (max-width: 1100px) {
    .kpi-cards-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .app-container {
        padding: 1rem;
        padding-top: 5.7rem;
    }

    .kpi-cards-container {
        grid-template-columns: 1fr;
    }

    .recent-invoices-table-body {
        padding: 1rem;
    }

    .recent-invoices-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .recent-invoices-table-grid {
        min-width: 560px;
    }

    .recent-invoices-footer .primary-action {
        width: auto;
    }

    .product-form {
        grid-template-columns: 1fr;
    }

    .product-form .login-btn {
        width: 100%;
    }

    .party-form {
        grid-template-columns: 1fr;
    }

    .party-form-wide,
    .party-form-actions {
        grid-column: auto;
    }

    .party-form-actions .login-btn {
        width: 100%;
    }

    .invoice-item {
        grid-template-columns: 1fr 1fr;
    }

    .invoice-item label:nth-child(1),
    .invoice-item label:nth-child(2),
    .invoice-line-total {
        grid-column: 1 / -1;
    }

    .invoice-summary {
        flex-direction: column;
        align-items: flex-end;
        gap: 0.35rem;
    }

    .invoice-detail-grid {
        grid-template-columns: 1fr;
    }

    .invoice-detail-actions {
        flex-direction: column;
    }

    .invoice-detail-actions .primary-action {
        justify-content: center;
    }

    .print-invoice {
        overflow-x: auto;
        font-size: 0.72rem;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .primary-action {
        width: 100%;
        justify-content: center;
    }

    .desktop-nav-bar {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        max-width: none;
        height: 64px;
        padding: 0;
        background: transparent;
        border: 0;
        box-shadow: none;
        z-index: 1002;
    }

    .desktop-nav-bar>nav {
        display: none;
    }

    .logo-container {
        display: none;
    }

    .mobile-nav-bar {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        align-items: center;
        justify-content: space-between;
        width: calc(100% - 25px);
        height: 64px;
        padding: 0 1.25rem;
        background: #3e51d110;
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        margin: 0.75rem 0.75rem 0 0.75rem;
        border-radius: 1rem;
        border: 1px solid #3e51d120;
    }

    .mobile-nav .mobile-logout-form {
        display: flex;
        justify-content: center;
        align-items: center;
        position: absolute;
        right: 1rem;
        bottom: 1.5rem;
        left: 1rem;
        width: auto;
    }

    .mobile-logo-container {
        display: flex;
        align-items: center;
        gap: 0.65rem;
    }

    .alert-box {
        right: 20px;
        top: 95px;
    }

    .mobile-logo-container .logo-text {
        color: #000;
    }

    .hamburger {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;
        width: 42px;
        height: 42px;
        cursor: pointer;
    }

    .hamburger span {
        display: block;
        width: 21px;
        height: 2px;
        background: #000;
        border-radius: 2px;
    }
}

.alert-box.alert-success .fa-circle-check {
    color: #16a05d;
}

.alert-box.alert-error {
    color: #a52f3b;
    background-color: #fff1f2;
    border-color: #e27782;
}

.alert-box.alert-error .fa-circle-xmark {
    color: #d93648;
}

.alert-box.alert-error .timer {
    background-color: rgba(217, 54, 72, 0.12);
}

.invoice-modal {
    position: fixed;
    inset: 0;
    z-index: 1002;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(16, 42, 67, 0.28);
    backdrop-filter: blur(16px) saturate(115%);
    -webkit-backdrop-filter: blur(16px) saturate(115%);
}

.invoice-modal-dialog {
    position: relative;
    width: min(980px, 100%);
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 24px 70px rgba(16, 42, 67, 0.28);
}

.invoice-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.invoice-modal-header h2 {
    margin: 0;
}

.invoice-modal .invoice-create-page {
    padding: 0;
}

.invoice-modal-close {
    position: static;
    flex: 0 0 34px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    font-size: 1rem;
}

.invoice-modal-close:focus-visible {
    outline: 3px solid rgba(75, 95, 232, 0.2);
    outline-offset: 2px;
}

.invoice-actions-cta {
    width: fit-content;
}