@import url('../fonts/poppins/poppins.css');

:root {
    --bg: #eef6ed;
    --bg-soft: #f8fcf7;
    --panel: #ffffff;
    --panel-soft: #f3f8f1;
    --line: #d5e4d2;
    --line-strong: #c4d9bf;
    --text: #1b2d20;
    --muted: #627565;
    --green: #0b5e2b;
    --green-deep: #0f5a25;
    --green-soft: #dff0dd;
    --lime: #78a557;
    --blue-soft: #e8f2ff;
    --amber-soft: #fff1dc;
    --danger-soft: #fff0f0;
    --shadow: 0 18px 45px rgba(22, 71, 31, 0.08);
    --font-main: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    font-family: var(--font-main);
    color: var(--text);
    background: var(--bg-soft);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0;
    font-family: var(--font-main);
    color: var(--text);
}

p {
    margin: 0;
}

input,
select,
textarea,
button {
    font: inherit;
}

.main,
.sidebar,
.login-shell,
.table-card,
.kl-form,
.ef-page {
    font-family: var(--font-main);
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    background: #fff;
    color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 4px rgba(28, 122, 57, 0.12);
}

.app-shell {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    min-height: 100vh;
    overflow-x: hidden;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 22px;
    background: #114222;
    background-image: linear-gradient(135deg, #114222 0%, #0a2914 100%);
    border-right: none;
    backdrop-filter: blur(16px);
    min-width: 210px;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(28, 122, 57, 0.2);
    border-radius: 20px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background-color: rgba(28, 122, 57, 0.4);
}

.brand-card,
.side-card,
.hero-card,
.content-card,
.table-card,
.panel,
.stat-card,
.coa-card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(196, 217, 191, 0.9);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.brand-card {
    padding: 18px;
}

.brand-top {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-copy h1 {
    font-size: 1.45rem;
}

.brand-copy p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.side-card {
    margin-top: 18px;
    padding: 18px;
}

.side-card h3 {
    font-size: 1rem;
    margin-bottom: 6px;
}

.nav-group {
    margin-top: 28px;
}

.nav-label {
    margin: 0 0 10px 12px;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--muted);
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 8px;
    border-radius: 16px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #27442b;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.8);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link span:first-child {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-link:hover,
.nav-link.active {
    background: var(--green);
    color: #fff;
    border-color: transparent;
    transform: translateX(4px);
    box-shadow: 0 6px 14px rgba(28, 122, 57, 0.25);
}

.nav-pill {
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(28, 122, 57, 0.1);
    color: var(--green);
    font-size: 0.68rem;
    font-weight: 800;
}

.nav-link.active .nav-pill,
.nav-link:hover .nav-pill {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.main {
    padding: 26px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.eyebrow {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.hero-card {
    padding: 28px;
    background: var(--green);
    color: #fff;
}

.hero-card h2,
.hero-card h3,
.hero-card h4 {
    color: #fff;
}

.hero-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
}

.hero-copy h2 {
    font-size: 2.1rem;
    line-height: 1.15;
}

.hero-copy p {
    margin-top: 10px;
    max-width: 860px;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.9);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 800;
    white-space: nowrap;
}

.hero-chips,
.stats-grid,
.split-grid,
.cards-grid,
.flow-grid,
.panel-grid,
.form-grid,
.form-grid-3,
.mini-list {
    display: grid;
    gap: 18px;
}

.hero-chips {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 22px;
}

.hero-chip {
    padding: 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-chip strong {
    display: block;
    margin-bottom: 6px;
    font-size: 1.05rem;
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 24px;
}

.stat-card {
    padding: 20px;
}

.label {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.value {
    margin-top: 8px;
    font-size: 2rem;
    font-weight: 800;
    color: var(--green-deep);
}

.hint {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.split-grid {
    grid-template-columns: 1.2fr 0.8fr;
    margin-top: 24px;
}

.content-card,
.table-card,
.panel,
.coa-card {
    padding: 22px;
}

.section-head,
.panel-header,
.history-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.section-head h3,
.panel-title {
    font-size: 1.25rem;
}

.section-head p,
.helper-text,
.subtle,
.footer-note {
    color: var(--muted);
}

.flow-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.flow-step {
    padding: 18px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(243, 248, 241, 0.92));
    border: 1px solid var(--line);
}

.step-no {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--green);
    color: #fff;
    font-weight: 800;
    margin-bottom: 12px;
}

.mini-list {
    gap: 12px;
}

.mini-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: 18px;
    background: var(--panel-soft);
    border: 1px solid var(--line);
}

.mini-item strong {
    display: block;
    margin-bottom: 4px;
}

.cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.table-shell,
.table-container {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
}

table,
.table-interactive {
    width: 100%;
    border-collapse: collapse;
}

thead th,
.table-interactive th {
    padding: 14px 12px;
    background: var(--green);
    color: #fff;
    font-size: 0.82rem;
    text-align: left;
    white-space: nowrap;
}

tbody td,
.table-interactive td {
    padding: 12px;
    border-bottom: 1px solid #e1ece0;
    font-size: 0.92rem;
    vertical-align: top;
}

tbody tr:nth-child(even) td,
.table-interactive tbody tr:nth-child(even) td {
    background: transparent;
}

.table-interactive tbody tr:hover td,
tbody tr:hover td {
    background: #f1f8ef;
}

.table-interactive input,
.table-interactive select {
    border-radius: 12px;
    padding: 10px 12px;
    border: 1px solid var(--line-strong);
    background: #fff;
    color: var(--text);
}

.calc-cell {
    font-weight: 800;
    color: var(--green-deep);
}

.metric-box,
.grn-metric {
    padding: 16px;
    border-radius: 20px;
    background: var(--panel-soft);
    border: 1px solid var(--line);
}

.metric-box strong,
.grn-metric strong {
    display: block;
    margin-top: 8px;
    font-size: 1.35rem;
    color: var(--green-deep);
}

.btn,
.btn-light,
.btn-action-primary,
.btn-secondary,
.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 16px;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 800;
}

.btn,
.btn-action-primary {
    background: var(--green);
    color: #fff;
}

.btn-light,
.btn-secondary {
    background: var(--panel-soft);
    border-color: var(--line);
    color: var(--green-deep);
}

.btn-danger,
.btn-icon-danger {
    background: var(--danger-soft);
    border-color: #efcaca;
    color: #b74949;
}

.btn-icon-danger {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 12px;
}

.action-bar,
.action-row,
.tag-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.progress-bar {
    width: 100%;
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    background: #e5efe3;
}

.progress-fill {
    height: 100%;
    background: var(--green);
}

.status-ready,
.status-ok,
.status-hold,
.status-reserved,
.user-role-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 800;
}

.status-ready,
.status-ok {
    background: #e4f4e3;
    color: #196b2b;
}

.status-hold {
    background: var(--amber-soft);
    color: #a56b10;
}

.status-reserved {
    background: var(--blue-soft);
    color: #2e67a6;
}

.flash {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 16px;
    font-weight: 800;
}

.flash.success {
    background: #e4f4e3;
    border: 1px solid #bfdebc;
    color: #196b2b;
}

.flash.error {
    background: #fff1f1;
    border: 1px solid #efc8c8;
    color: #a63d3d;
}

.footer-note {
    margin-top: 24px;
    font-size: 0.84rem;
}

.login-shell {
    min-height: 100vh;
    height: 100vh;
    display: grid;
    grid-template-columns: 1.06fr 0.94fr;
    background: var(--bg-soft);
    overflow: hidden;
}

.login-visual {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    background: var(--green);
}

.login-visual-image {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    min-height: 100vh;
    object-fit: cover;
    filter: saturate(1.02) contrast(1.02);
    transform: scale(1.04);
    animation: loginVisualFloat 16s ease-in-out infinite alternate;
}

.login-visual-image.is-animating {
    animation:
        loginVisualSwap 0.7s ease,
        loginVisualFloat 16s ease-in-out infinite alternate;
}

.login-visual::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    background:
        linear-gradient(180deg, rgba(4, 18, 10, 0.18), rgba(4, 18, 10, 0.48)),
        linear-gradient(100deg, rgba(0, 108, 149, 0.42), rgba(39, 111, 58, 0.08) 48%, rgba(0, 0, 0, 0.14));
    pointer-events: none;
}

.login-visual-orb,
.login-visual-grid,
.login-visual-frame,
.login-visual-copy {
    pointer-events: none;
}

.login-visual-orb {
    position: absolute;
    z-index: 3;
    border-radius: 999px;
    filter: blur(8px);
    opacity: 0.84;
}

.login-visual-orb-top {
    top: -4%;
    left: -6%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(71, 190, 255, 0.26), rgba(71, 190, 255, 0.04) 68%, transparent 78%);
    animation: loginGlowDrift 11s ease-in-out infinite;
}

.login-visual-orb-bottom {
    right: 8%;
    bottom: 10%;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(145, 211, 120, 0.2), rgba(145, 211, 120, 0.04) 68%, transparent 78%);
    animation: loginGlowDrift 13s ease-in-out infinite reverse;
}

.login-visual-grid {
    position: absolute;
    inset: 26px;
    z-index: 3;
    border-radius: 0 40px 40px 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.68), transparent);
}

.login-visual-frame {
    position: absolute;
    z-index: 4;
    inset: 26px 0 26px 26px;
    border-radius: 0 42px 42px 0;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.login-visual-copy {
    position: absolute;
    left: 44px;
    right: 80px;
    bottom: 52px;
    z-index: 5;
    max-width: 520px;
    color: #fff;
}

.login-visual-tag {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.login-visual-copy h1 {
    margin-top: 18px;
    font-size: clamp(2rem, 3vw, 3.2rem);
    line-height: 1.02;
    letter-spacing: -0.04em;
    color: #fff;
}

.login-visual-copy p {
    margin-top: 14px;
    max-width: 470px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.84);
    font-size: 0.98rem;
}

.login-panel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 22px;
    overflow: hidden;
    background: var(--panel-soft);
}

.login-panel::before,
.login-panel::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
    opacity: 0.9;
    z-index: 0;
}

.login-panel::before {
    width: 420px;
    height: 420px;
    right: -120px;
    top: 10%;
    background:
        radial-gradient(circle at center, rgba(22, 112, 54, 0.16) 0%, rgba(22, 112, 54, 0.05) 34%, transparent 70%);
    filter: blur(8px);
}

.login-panel::after {
    width: 260px;
    height: 260px;
    left: -70px;
    bottom: 8%;
    background:
        radial-gradient(circle at center, rgba(132, 181, 88, 0.18) 0%, rgba(132, 181, 88, 0.06) 40%, transparent 72%);
    filter: blur(8px);
}

.login-card {
    position: relative;
    z-index: 1;
    width: min(480px, 100%);
    max-height: calc(100vh - 40px);
    padding: 44px 48px;
    border-radius: 32px;
    background: #ffffff;
    box-shadow: 0 24px 64px rgba(17, 62, 26, 0.08), 0 8px 24px rgba(17, 62, 26, 0.04);
    animation: loginCardRise 0.85s ease;
}

.login-panel-aura {
    position: absolute;
    inset: 50% 18px auto auto;
    width: 480px;
    height: 480px;
    transform: translateY(-50%);
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(44, 139, 62, 0.12) 0%, rgba(44, 139, 62, 0.04) 36%, transparent 72%);
    filter: blur(14px);
    pointer-events: none;
}

.login-brand-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
}

.login-logo-cluster {
    display: flex;
    align-items: center;
    gap: 14px;
}

.login-logo-card {
    width: 64px;
    height: 64px;
    padding: 8px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    background: #ffffff;
    border: 1px solid var(--line);
    box-shadow: 0 8px 20px rgba(17, 62, 26, 0.05);
}

.login-logo-main {
    width: 100%;
    height: auto;
}

.login-brand-name {
    font-size: 0.98rem;
    font-weight: 800;
    color: var(--green-deep);
}

.login-brand-sub {
    margin-top: 2px;
    font-size: 0.8rem;
    color: var(--muted);
}

.login-card-head {
    margin-top: 14px;
}

.login-title-main {
    font-size: 20px;
    line-height: 0.98;
    letter-spacing: -0.05em;
    color: var(--text);
}

.login-subtext {
    margin-top: 8px;
    line-height: 1.45;
    color: var(--muted);
    font-size: 0.92rem;
    max-width: 360px;
}

.login-form {
    margin-top: 14px;
}

.login-form-grid {
    display: grid;
    gap: 10px;
}

.login-field {
    margin-bottom: 20px;
}

.login-field input,
.login-field select {
    margin-top: 8px;
    padding: 12px 16px;
    border: 1px solid #d5e4d2;
    background: #fcfdfc;
    border-radius: 12px;
    font-size: 0.95rem;
    min-height: 52px;
    width: 100%;
    color: var(--text);
    transition: all 0.2s ease;
}

.login-field input:focus,
.login-field select:focus {
    outline: none;
    border-color: var(--green);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(28, 122, 57, 0.1);
}

.login-field select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 46px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.25 4.5L6 8.25L9.75 4.5' stroke='%231b2d20' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 12px;
}

.login-field .eyebrow {
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    display: block;
}

.login-submit {
    width: 100%;
    margin-top: 12px;
    min-height: 52px;
    border-radius: 12px;
    background: var(--green);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(30, 110, 49, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    font-size: 1rem;
    font-weight: 700;
}

.login-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(30, 110, 49, 0.3);
}

@keyframes loginVisualFloat {
    0% {
        transform: scale(1.035) translate3d(0, 0, 0);
    }

    100% {
        transform: scale(1.075) translate3d(-10px, -12px, 0);
    }
}

@keyframes loginVisualSwap {
    0% {
        opacity: 0.35;
        transform: scale(1.12);
        filter: saturate(1.2) blur(2px);
    }

    100% {
        opacity: 1;
        transform: scale(1.035);
        filter: saturate(1.04) blur(0);
    }
}

@keyframes loginGlowDrift {

    0%,
    100% {
        transform: translate3d(0, 0, 0);
    }

    50% {
        transform: translate3d(16px, -14px, 0);
    }
}

@keyframes loginCardRise {
    0% {
        opacity: 0;
        transform: translateY(18px) scale(0.98);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes loginPulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(55, 178, 77, 0.2);
    }

    50% {
        transform: scale(1.08);
        box-shadow: 0 0 0 10px rgba(55, 178, 77, 0.08);
    }
}

.grn-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) 420px;
    gap: 24px;
    margin-top: 24px;
    align-items: start;
}

.grn-entry-card {
    padding: 24px;
    border-radius: 28px;
    background: var(--panel);
    border: 1px solid rgba(196, 217, 191, 0.95);
    box-shadow: var(--shadow);
}

.grn-top-strip {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    margin-bottom: 18px;
    padding: 16px 18px;
    border-radius: 20px;
    background: var(--panel-soft);
    border: 1px solid rgba(28, 122, 57, 0.12);
}

.grn-top-strip strong {
    display: block;
    color: var(--green-deep);
    font-size: 1rem;
}

.grn-top-strip span {
    font-size: 0.84rem;
    color: var(--muted);
}

.grn-icon-badge {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--green);
    color: #fff;
    font-size: 1.15rem;
}

.grn-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.grn-field {
    padding: 14px;
    border-radius: 20px;
    background: #fbfdf9;
    border: 1px solid #dbe8d7;
}

.grn-field label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.73rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.grn-field-wide {
    grid-column: 1 / -1;
}

.grn-metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.grn-helper-line {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 18px;
    background: #eef5ff;
    border: 1px solid #d9e7fb;
    color: #416180;
    font-size: 0.9rem;
}

.qr-tag-card {
    position: sticky;
    top: 20px;
    padding: 24px;
    border-radius: 28px;
    background: #f4f8f4;
    border: 1px solid #e0eade;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

.qr-tag-sheet {
    padding: 40px 32px;
    border-radius: 20px;
    background: #ffffff;
    border: 2px dashed #c0cdd1;
}

/* ── NEW PREMIUM TAG DESIGN v2 ── */
.tag-card-v2 {
    position: sticky;
    top: 20px;
    border-radius: 20px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #d1ddd0;
    box-shadow: 0 12px 36px rgba(15, 50, 25, 0.12);
    font-family: 'Poppins', sans-serif;
}

/* DARK TOP BANNER */
.tag-banner {
    background: var(--green);
    padding: 20px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.tag-banner-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.tag-logo-mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-weight: 900;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.tag-company {
    font-size: 0.95rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.04em;
}

.tag-subtitle {
    font-size: 0.65rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.65);
    letter-spacing: 0.1em;
    margin-top: 3px;
}

.tag-lot-badge {
    text-align: right;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 8px 14px;
    flex-shrink: 0;
}

.tag-lot-label {
    font-size: 0.6rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.tag-lot-value {
    font-size: 1.1rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

/* BODY: QR + INFO GRID */
.tag-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    padding: 0;
}

/* QR PANEL */
.tag-qr-panel {
    padding: 24px 20px;
    background: #f8faf7;
    border-right: 1px solid #e0ead8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.tag-qr-frame {
    padding: 10px;
    border-radius: 14px;
    background: #fff;
    border: 2px solid #d0e0cc;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
}

.tag-qr-inner {
    display: flex;
    align-items: center;
    justify-content: center;
}

.tag-scan-hint {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    color: #8aab80;
    text-transform: uppercase;
}

/* INFO GRID */
.tag-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: #e0ead8;
    padding: 0;
}

.tag-info-cell {
    background: #fff;
    padding: 16px 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tag-info-wide {
    grid-column: 1 / -1;
    background: #f8faf7;
}

.tag-info-label {
    font-size: 0.6rem;
    font-weight: 800;
    color: #8aab80;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.tag-info-value {
    font-size: 1rem;
    font-weight: 700;
    color: #0f2018;
    line-height: 1.2;
}

/* BARCODE STRIP */
.tag-barcode-strip {
    background: #fff;
    border-top: 1px solid #e0ead8;
    padding: 14px 20px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.tag-barcode-canvas {
    display: block;
    width: 100%;
    max-width: 340px;
    height: 56px;
}

.tag-barcode-text {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.4em;
    color: #3a5a3d;
    text-transform: uppercase;
}

/* FOOTER */
.tag-foot {
    background: #0f2018;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 0.6rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.tag-foot span:nth-child(2n) {
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.4rem;
}

/* TAG ACTIONS */
.tag-actions {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    background: #f8faf7;
    border-top: 1px solid #e0ead8;
}

.tag-actions button {
    flex: 1;
}

.qr-tag-head {
    text-align: center;
}

.qr-tag-head h3 {
    font-size: 1.25rem;
    font-weight: 900;
    color: #000;
    letter-spacing: 0.02em;
}

.qr-tag-head p {
    margin-top: 6px;
    line-height: 1.4;
    font-size: 0.95rem;
    font-weight: 500;
    color: #374151;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tag-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 28px 0;
}

.qr-render {
    width: 220px;
    min-height: 220px;
    margin: 0 auto;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: none;
    border-radius: 0;
}

.qr-render img,
.qr-render canvas {
    max-width: 100%;
    height: auto;
}

.qr-tag-meta {
    display: grid;
    gap: 16px;
}

.qr-tag-row {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 16px;
    align-items: center;
    font-size: 1.05rem;
}

.qr-tag-row span:first-child {
    font-weight: 800;
    color: #6b7280;
    letter-spacing: 0.05em;
}

.qr-tag-row strong {
    font-weight: 600;
    color: #1f2937;
}

.qr-tag-foot {
    margin-top: 32px;
    padding-top: 0;
    border-top: none;
    text-align: center;
    font-size: 0.65rem;
    color: #9ca3af;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.grn-table-card {
    margin-top: 24px;
}

.coa-sheet {
    padding: 24px;
    border-radius: 22px;
    border: 2px solid #d8e3d4;
    background: #fffefb;
}

.coa-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding-bottom: 14px;
    border-bottom: 2px solid #dce7d8;
    margin-bottom: 14px;
}

.coa-title {
    font-size: 1.35rem;
}

@media (max-width: 1280px) {

    .app-shell,
    .grn-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        height: auto;
    }

    .qr-tag-card {
        position: static;
    }

    .stats-grid,
    .hero-chips,
    .split-grid,
    .cards-grid,
    .flow-grid,
    .panel-grid,
    .form-grid,
    .form-grid-3,
    .grn-form-grid,
    .grn-metric-grid {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 767px) {
    .login-shell {
        grid-template-columns: 1fr;
        height: auto;
        overflow: visible;
    }

    .login-panel {
        padding: 24px;
    }

    .login-visual,
    .login-visual-image {
        min-height: 50vh;
    }

    .login-card {
        max-height: none;
    }

    .login-visual-copy {
        right: 44px;
        bottom: 38px;
    }
}

@media (max-width: 720px) {
    .login-shell {
        background: linear-gradient(180deg, #f3f8f0 0%, #edf5e9 100%);
    }

    .login-visual-grid,
    .login-visual-frame {
        inset: 16px;
        border-radius: 24px;
    }

    .login-card {
        padding: 20px 18px;
        border-radius: 24px;
    }

    .login-brand-row,
    .login-logo-cluster {
        flex-direction: column;
        align-items: flex-start;
    }

    .login-visual-copy {
        left: 24px;
        right: 24px;
        bottom: 24px;
    }

    .login-title-main {
        font-size: 1.15rem;
        line-height: 1.2;
    }

    .login-brand-name {
        font-size: 0.9rem;
    }

    .login-brand-sub {
        font-size: 0.75rem;
    }

    .login-field input,
    .login-field select {
        padding: 10px 14px;
        min-height: 46px;
        font-size: 0.9rem;
    }

    .login-submit {
        min-height: 46px;
        font-size: 0.9rem;
    }

    .login-visual-copy h1 {
        font-size: 1.45rem;
        margin-top: 10px;
    }

    .login-visual-copy p {
        font-size: 0.85rem;
        line-height: 1.4;
        margin-top: 8px;
    }

    .login-visual-tag {
        font-size: 0.65rem;
        padding: 6px 10px;
    }
}

.kl-page {
    padding: 20px 28px 48px;
    background: #f2faf5;
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
}

.kl-form {
    width: 100%;
    background: #fff;
    border: 1px solid #d8ecd4;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(47, 97, 48, 0.07);
}

.kl-form-head {
    background: #1c7a39;
    padding: 18px 26px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.kl-form-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #fff;
    flex-shrink: 0;
}

.kl-form-head h3 {
    font-size: 0.98rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
}

.kl-form-head p {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.78);
    margin: 4px 0 0;
}

.kl-form-body {
    padding: 26px;
}

.kl-form-section {
    margin-bottom: 24px;
}

.kl-form-section-label {
    font-size: 0.62rem;
    font-weight: 800;
    color: #9aba91;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kl-form-section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5f0e0;
}

.kl-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.kl-field label {
    display: block;
    font-size: 0.68rem;
    font-weight: 800;
    color: #3d5e3f;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 6px;
}

.kl-field input,
.kl-field select {
    width: 100%;
    box-sizing: border-box;
    border: 1.5px solid #d1e8cc;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.84rem;
    font-weight: 600;
    color: #1b2d20;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    appearance: auto;
}

.kl-field input:focus,
.kl-field select:focus {
    border-color: #4a824e;
    box-shadow: 0 0 0 3px rgba(47, 97, 48, 0.12);
}

.kl-form-footer {
    padding: 18px 26px;
    border-top: 1px solid #e8f3e4;
    background: #f8faf7;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.kl-btn-submit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #1c7a39;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 11px 24px;
    cursor: pointer;
    transition: opacity 0.2s;
    box-shadow: 0 4px 14px rgba(47, 97, 48, 0.28);
}

.kl-btn-submit:hover {
    opacity: 0.88;
}

.kl-btn-cancel {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #fff;
    color: #6b7280;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.kl-btn-cancel:hover {
    background: #f3f4f6;
    color: #374151;
}

.kl-table-wrap {
    overflow-x: auto;
    border: 1px solid #dcfce7;
    border-radius: 10px;
}

.kl-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 960px;
    font-size: .76rem;
}

.kl-table th {
    background: #1c7a39;
    color: #ffffff;
    text-align: left;
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 16px 20px;
    border: none;
}

.kl-table td {
    padding: 16px 20px;
    border: none;
    border-bottom: 1px solid #e8f3e4;
    color: #14532d;
    font-weight: 600;
    vertical-align: middle;
    text-align: left;
}

.kl-table td input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #c5dcc0;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 0.75rem;
}

.kl-table td input.readonly-cell {
    background: #f8faf7;
    color: #15803d;
    border-color: transparent;
    font-weight: 900;
}

.table-empty {
    height: 76px !important;
    color: #8caf83;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
}

.kl-page {
    padding: 20px 28px 48px;
    background: #f2faf5;
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
}

.kl-panel {
    background: #fff;
    border: 1px solid #bbf7d0;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 4px 24px rgba(47, 97, 48, 0.07);
}

.kl-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.kl-title {
    font-weight: 900;
    color: #14532d;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
}

.kl-btn {
    border: 0;
    border-radius: 10px;
    padding: 11px 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
}

.kl-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.kl-btn.primary {
    background: var(--green);
    color: #fff;
}

.kl-table-wrap {
    overflow-x: auto;
    border: 1px solid #dcfce7;
    border-radius: 10px;
}

.kl-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 960px;
    font-size: .76rem;
}

.kl-table th {
    background: #1c7a39;
    color: #ffffff;
    text-align: left;
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 16px 20px;
    border: none;
}

.kl-table td {
    padding: 16px 20px;
    border: none;
    border-bottom: 1px solid #e8f3e4;
    color: #14532d;
    font-weight: 600;
    white-space: nowrap;
    text-align: left;
}

.kl-empty {
    text-align: center;
    color: #4ade80;
    padding: 26px;
}

.kl-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #dcfce7;
    color: #15803d;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: .68rem;
    font-weight: 900;
}

.tbl-btn {
    border: 0;
    border-radius: 7px;
    padding: 5px 10px;
    font-size: .64rem;
    font-weight: 800;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.tbl-view {
    background: #dcfce7;
    color: #15803d;
}

.tbl-print {
    background: #e0f2fe;
    color: #0284c7;
}

.tbl-del {
    background: #fef2f2;
    color: #dc2626;
}

.tbl-view:hover {
    background: #15803d;
    color: #fff;
}

.tbl-print:hover {
    background: #0284c7;
    color: #fff;
}

.tbl-del:hover {
    background: #dc2626;
    color: #fff;
}

@page {
    size: A4 portrait;
    margin: 10mm;
}

.print-page {
    display: grid;
    gap: 18px;
}

.print-actions-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(196, 217, 191, 0.9);
    border-radius: 18px;
    box-shadow: 0 14px 35px rgba(22, 71, 31, 0.07);
}

.print-actions-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.print-actions-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: #1c7a39;
    color: #fff;
    flex: 0 0 auto;
}

.print-actions-title h2 {
    margin: 0;
    color: #0f2018;
    font-size: 1rem;
    font-weight: 900;
}

.print-actions-title p {
    margin: 3px 0 0;
    color: #627565;
    font-size: 0.78rem;
    font-weight: 600;
}

.print-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.print-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid #cfe6c8;
    background: #f8fcf7;
    color: #0f5a25;
    font-size: 0.78rem;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.print-btn-primary {
    background: #1c7a39;
    border-color: transparent;
    color: #fff;
    box-shadow: 0 10px 22px rgba(28, 122, 57, 0.18);
}

.paper-wrap {
    display: flex;
    justify-content: center;
    overflow-x: auto;
    padding-bottom: 8px;
}

.paper {
    width: 190mm;
    background: #f8fcf6;
    border: 1.8px solid #14532d;
    box-shadow: 0 20px 48px rgba(22, 71, 31, 0.13);
    flex: 0 0 auto;
    color: #0b1f14;
    font-family: Arial, Helvetica, sans-serif;
    padding: 0;
}

.sheet-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.sheet-table th,
.sheet-table td {
    border: 1.2px solid #14532d;
    color: #0b1f14;
    font-size: 10px;
    line-height: 1.1;
    padding: 4px 5px;
    text-align: center;
    vertical-align: middle;
}

.sheet-table .company-row th {
    height: 24px;
    background: #e7f5e4;
    color: #063f1d;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.sheet-table .meta-label {
    width: 16%;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-align: left;
    text-transform: uppercase;
    background: #eef8ec;
    color: #063f1d;
}

.sheet-table .meta-value {
    height: 24px;
    font-size: 11px;
    font-weight: 800;
    text-align: left;
    background: #fbfefa;
}

.sheet-table .lot-label {
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    background: #dff1dc;
    color: #063f1d;
}

.sheet-table .lot-value {
    font-size: 12px;
    font-weight: 900;
    text-align: left;
    background: #fbfefa;
    color: #063f1d;
}

.sheet-table .report-row th {
    height: 22px;
    background: #16a34a;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.sheet-table .group-row th {
    height: 18px;
    background: #dff1dc;
    color: #063f1d;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.sheet-table .column-row th {
    height: 22px;
    background: #eef8ec;
    color: #063f1d;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.sheet-table tbody tr:nth-child(odd) td {
    background: #fbfefa;
}

.sheet-table tbody tr:nth-child(even) td {
    background: #f1f8ef;
}

.sheet-table .body-row td {
    height: 22px;
    font-size: 11px;
    font-weight: 750;
}

.sheet-table .body-row .bag-cell,
.sheet-table .body-row .weight-cell {
    font-weight: 900;
}

.sheet-table .total-row td {
    height: 24px;
    font-weight: 900;
    text-transform: uppercase;
    background: #dff1dc !important;
    color: #063f1d;
}

@media (max-width: 760px) {
    .print-actions-card {
        align-items: stretch;
        flex-direction: column;
    }

    .print-actions {
        justify-content: stretch;
    }

    .print-btn {
        flex: 1;
    }
}

@media print {
    body {
        background: #fff !important;
    }

    .sidebar,
    .topbar,
    .footer-note,
    .print-actions-card {
        display: none !important;
    }

    .app-shell {
        display: block !important;
        min-height: 0 !important;
    }

    .main {
        padding: 0 !important;
    }

    .print-page,
    .paper-wrap {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .paper {
        width: auto !important;
        border: 1.8px solid #14532d !important;
        box-shadow: none !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .sheet-table tr {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

.kl-page {
    padding: 20px 28px 48px;
    background: #f2faf5;
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
}

.kl-panel {
    background: #fff;
    border: 1px solid #bbf7d0;
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 4px 24px rgba(47, 97, 48, 0.07);
}

.kl-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.kl-title {
    font-weight: 900;
    color: #14532d;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
}

.kl-stripe {
    width: 3px;
    height: 20px;
    border-radius: 4px;
    background: #1c7a39;
}

.kl-btn {
    border: 0;
    border-radius: 10px;
    padding: 9px 16px;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
}

.kl-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.kl-btn.primary {
    background: var(--green);
    color: #fff;
}

.kl-btn.secondary {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.kl-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kl-grid-item {
    background: #f8faf7;
    border: 1px solid #e5f0e0;
    border-radius: 10px;
    padding: 12px 14px;
}

.kl-grid-label {
    font-size: 0.6rem;
    font-weight: 800;
    color: #9aba91;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
}

.kl-grid-value {
    font-size: 0.92rem;
    font-weight: 700;
    color: #0f2018;
}

.kl-table-title {
    text-align: center;
    font-weight: 900;
    background: #1c7a39;
    color: #fff;
    padding: 10px;
    border-radius: 8px 8px 0 0;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
}

.kl-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.kl-table th,
.kl-table td {
    border: none;
    border-bottom: 1px solid #e8f3e4;
    padding: 16px 20px;
    text-align: left;
}

.kl-table th {
    background: #1c7a39;
    color: #ffffff;
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    border-bottom: none;
}

.kl-table tbody tr:nth-child(odd) {
    background: #f8faf7;
}

.kl-table tbody tr:hover {
    background: #ecf5e9;
}

.kl-table tfoot td {
    background: #e8f5e9;
    font-weight: 900;
    color: #1c7a39;
}

.domestic-form-panel {
    padding: 0;
    overflow: hidden;
    border-color: #cfe7cf;
    box-shadow: 0 12px 32px rgba(15, 32, 24, 0.06);
}

.domestic-form-panel .grn-panel-head {
    padding: 20px 22px 16px;
    margin: 0;
    background: linear-gradient(180deg, #fbfefa 0%, #f4faf2 100%);
    border-bottom: 1px solid #e1f0dd;
}

.domestic-lot-form {
    padding: 18px 22px 22px;
}

.domestic-status-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.domestic-status-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 62px;
    padding: 12px 14px;
    border: 1px solid #d8ecd4;
    border-radius: 10px;
    background: #fbfdfa;
}

.domestic-status-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    background: #ecfdf3;
    color: #1c7a39;
}

.domestic-status-item:nth-child(2) .domestic-status-icon {
    background: #eef6ff;
    color: #1d4ed8;
}

.domestic-status-item:nth-child(3) .domestic-status-icon {
    background: #fff7ed;
    color: #b45309;
}

.domestic-status-item:nth-child(4) .domestic-status-icon {
    background: #f0f8ed;
    color: #4d7c0f;
}

.domestic-status-label {
    display: block;
    margin-bottom: 3px;
    font-size: 0.58rem;
    font-weight: 900;
    color: #7a9480;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.domestic-status-value {
    display: block;
    font-size: 0.78rem;
    font-weight: 900;
    color: #0f2018;
    line-height: 1.25;
}

.domestic-lot-form .grn-section-divider {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 18px 0 10px;
    padding: 0;
    border: 0;
    color: #315f38;
    letter-spacing: 0.08em;
}

.domestic-lot-form .grn-section-divider::before {
    content: "";
    width: 6px;
    height: 18px;
    border-radius: 99px;
    background: #1c7a39;
}

.domestic-lot-form .grn-fields-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    padding: 14px;
    margin-bottom: 14px;
    border: 1px solid #e1f0dd;
    border-radius: 12px;
    background: #fbfdfa;
}

.domestic-lot-form .grn-field-2 {
    grid-column: span 2;
}

.domestic-lot-form .grn-field-wide {
    grid-column: 1 / -1;
}

.domestic-lot-form .grn-field label {
    color: #53785a;
}

.domestic-lot-form .grn-field input,
.domestic-lot-form .grn-field select,
.domestic-lot-form .grn-field textarea {
    min-height: 42px;
    background: #fff;
    border-color: #d8ecd4;
}

.domestic-lot-form .grn-field input[readonly] {
    background: #f0f8ed;
}

.domestic-feature-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(220px, 0.62fr) minmax(0, 1.38fr);
    gap: 0;
    margin-bottom: 16px;
    border: 1px solid #d8ecd4;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 10px 26px rgba(15, 32, 24, 0.045);
}

.domestic-card-aside {
    padding: 18px;
    border-right: 1px solid #d8ecd4;
    background: linear-gradient(180deg, #f8fcf5 0%, #eef8ed 100%);
}

.domestic-card-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    margin-bottom: 12px;
    border-radius: 12px;
    background: #1c7a39;
    color: #fff;
    box-shadow: 0 8px 18px rgba(28, 122, 57, 0.18);
}

.domestic-card-kicker {
    display: block;
    margin-bottom: 5px;
    color: #7a9480;
    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.domestic-card-title {
    margin: 0 0 7px;
    color: #0f2018;
    font-size: 0.96rem;
    font-weight: 900;
    line-height: 1.25;
}

.domestic-card-copy {
    margin: 0;
    color: #5f7b65;
    font-size: 0.72rem;
    line-height: 1.55;
    font-weight: 650;
}

.domestic-card-body {
    padding: 16px;
}

.domestic-card-body .grn-fields-grid {
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.domestic-supplier-preview,
.domestic-carry-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 12px;
    padding: 11px 12px;
    border: 1px solid #d8ecd4;
    border-radius: 10px;
    background: #f8faf7;
    color: #45674c;
    font-size: 0.72rem;
    font-weight: 750;
    line-height: 1.45;
}

.domestic-supplier-preview i,
.domestic-carry-note i {
    margin-top: 2px;
    color: #1c7a39;
}

.domestic-weight-card .domestic-card-aside {
    background: linear-gradient(180deg, #f8fbff 0%, #edf6ff 100%);
}

.domestic-weight-card .domestic-card-icon {
    background: #1d4ed8;
    box-shadow: 0 8px 18px rgba(29, 78, 216, 0.16);
}

.domestic-weight-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.domestic-weight-tile {
    min-height: 70px;
    padding: 12px;
    border: 1px solid #d8ecd4;
    border-radius: 10px;
    background: #fbfdfa;
}

.domestic-weight-tile span {
    display: block;
    margin-bottom: 5px;
    color: #7a9480;
    font-size: 0.58rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.domestic-weight-tile strong {
    display: block;
    color: #0f2018;
    font-size: 1rem;
    font-weight: 900;
}

.domestic-weight-tile.net strong {
    color: #1c7a39;
}

.domestic-carry-card .domestic-card-aside {
    background: linear-gradient(180deg, #fffaf0 0%, #f3faef 100%);
}

.domestic-carry-card .domestic-card-icon {
    background: #6b8f2a;
    box-shadow: 0 8px 18px rgba(107, 143, 42, 0.16);
}

.domestic-carry-card .grn-field:first-child {
    grid-column: span 2;
}

.domestic-available-box {
    min-height: 42px;
    display: flex;
    align-items: center;
    padding: 9px 12px;
    border: 1px solid #bfe4c2;
    border-radius: 9px;
    background: #ecfdf3;
    color: #14532d;
    font-size: 0.88rem;
    font-weight: 900;
}

.domestic-lot-form .bag-logger {
    margin-top: 0;
    padding: 16px 18px;
    background: #fbfdfa;
    border-color: #d8ecd4;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.domestic-lot-form .bag-row-labels,
.domestic-lot-form .bag-row {
    grid-template-columns: minmax(110px, 150px) minmax(130px, 180px) 40px;
    align-items: start;
}

.domestic-lot-form .bag-row {
    padding: 10px;
    border: 1px solid #e5f0e0;
    border-radius: 12px;
    background: #fff;
}

.domestic-lot-form .bag-row input {
    height: 42px;
}

.domestic-lot-form .bag-total-row,
.domestic-lot-form .bag-limit-message {
    width: min(100%, 370px);
}

.domestic-lot-form .grn-submit-row {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin: 18px -22px -22px;
    padding: 14px 22px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(8px);
}

@media (max-width: 1120px) {

    .domestic-status-strip,
    .domestic-lot-form .grn-fields-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .domestic-feature-card {
        grid-template-columns: 1fr;
    }

    .domestic-card-aside {
        border-right: 0;
        border-bottom: 1px solid #d8ecd4;
    }
}

@media (max-width: 760px) {

    .domestic-status-strip,
    .domestic-lot-form .grn-fields-grid {
        grid-template-columns: 1fr;
    }

    .domestic-lot-form .grn-field-2,
    .domestic-lot-form .grn-field-wide {
        grid-column: 1;
    }

    .domestic-lot-form {
        padding: 14px;
    }

    .domestic-lot-form .grn-submit-row {
        margin: 18px -14px -14px;
        padding: 14px;
    }

    .domestic-weight-summary {
        grid-template-columns: 1fr;
    }

    .domestic-carry-card .grn-field:first-child {
        grid-column: 1;
    }
}

.bag-logger {
    background: #f8fdf8;
    border: 1px solid #d4ecd4;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 12px;
}

.bag-logger-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: linear-gradient(90deg, #e8f5e8, #f0faf0);
    border-bottom: 1px solid #d4ecd4;
}

.bag-logger-title {
    font-weight: 800;
    color: #1c7a39;
    font-size: 0.95rem;
}

.bag-add-btn {
    background: #1c7a39;
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: 7px 16px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.bag-add-btn:hover {
    background: #155f2c;
}

.bag-table {
    width: 100%;
    border-collapse: collapse;
}

.bag-table thead tr {
    background: #1c7a39;
}

.bag-table thead th {
    padding: 10px 16px;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
    text-align: left;
    letter-spacing: 0.04em;
}

.bag-table tbody tr {
    border-bottom: 1px solid #e8f5e8;
    transition: background 0.15s;
}

.bag-table tbody tr:hover {
    background: #f0faf0;
}

.bag-table tbody tr:last-child {
    border-bottom: none;
}

.bag-table td {
    padding: 10px 16px;
    vertical-align: middle;
}

.bag-table input[type="text"],
.bag-table input[type="number"] {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #c8e6c8;
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #103919;
    background: #fff;
    outline: none;
    transition: border 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.bag-table input:focus {
    border-color: #1c7a39;
    box-shadow: 0 0 0 3px rgba(28, 122, 57, 0.1);
}

.bag-del-btn {
    background: #fff0f0;
    border: 1px solid #f5c6c6;
    color: #c0392b;
    border-radius: 6px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    transition: background 0.2s;
}

.bag-del-btn:hover {
    background: #ffe0e0;
}

.bag-print-btn {
    background: #f0faf0;
    border: 1px solid #c8e6c8;
    color: #1c7a39;
    border-radius: 6px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    transition: background 0.2s;
}

.bag-print-btn:hover {
    background: #d4ecd4;
}

.bag-total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: linear-gradient(90deg, #e8f5e8, #f0faf0);
    border-top: 1px solid #d4ecd4;
    font-weight: 700;
    color: #1c7a39;
    font-size: 0.9rem;
}

.bag-total-val {
    font-size: 1.05rem;
    font-weight: 900;
    color: #1c7a39;
}

.row-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #d4ecd4;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 800;
    color: #1c7a39;
}



/* ── Index page styles ── */
.grn-index-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 10px;
}

.grn-index-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 800;
    color: #103919;
}

.grn-index-title i {
    color: #1c7a39;
}

/* Main table */
.lot-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(28, 122, 57, 0.07);
}

.lot-table thead tr {
    background: #1c7a39;
}

.lot-table thead th {
    padding: 11px 14px;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    text-align: left;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.lot-table tbody tr {
    border-bottom: 1px solid #e8f5e8;
    transition: background 0.15s;
}

.lot-table tbody tr:hover {
    background: #f5fbf5;
}

.lot-table tbody tr:last-child {
    border-bottom: none;
}

.lot-table td {
    padding: 12px 14px;
    font-size: 0.86rem;
    color: #1a1a1a;
    vertical-align: middle;
}

/* Row number */
.row-idx {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: #e8f5e8;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 800;
    color: #1c7a39;
}

/* Lot badge */
.lot-grn-badge {
    display: inline-block;
    background: #e8f5e8;
    color: #1c7a39;
    border: 1px solid #c8e6c8;
    border-radius: 6px;
    padding: 3px 9px;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.03em;
}

/* Date */
.date-val {
    font-weight: 700;
    color: #2d3748;
}

/* Supervisor */
.supervisor-val {
    font-weight: 600;
    color: #4a5568;
}

/* Bag details cell */
.bag-details-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    min-width: 180px;
}

.bag-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f0faf0;
    border: 1px solid #c8e6c8;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 0.76rem;
    font-weight: 700;
    color: #103919;
    white-space: nowrap;
}

.bag-chip-qr {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #1c7a39;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    border: none;
    padding: 0;
    flex-shrink: 0;
}

.bag-chip-qr:hover {
    background: #155f2c;
    transform: scale(1.1);
}

.bag-chip-qr i {
    color: #fff;
    font-size: 0.58rem;
}

/* Weight val */
.weight-val {
    font-weight: 800;
    color: #1c7a39;
    font-size: 0.92rem;
}

/* Status badge */
.status-pending {
    background: #fff8e1;
    color: #b7791f;
    border: 1px solid #f6e05e;
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 0.72rem;
    font-weight: 700;
}

.status-approved {
    background: #e8f5e8;
    color: #1c7a39;
    border: 1px solid #c8e6c8;
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 0.72rem;
    font-weight: 700;
}

/* Action buttons */
.action-cell {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: flex-start;
}

/* Universal Action Buttons */
.btn-view,
.btn-edit,
.btn-delete,
.tbl-btn-view,
.tbl-btn-edit,
.tbl-btn-delete,
.tbl-btn-del {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #94a3b8;
    /* Neutral grey default */
    cursor: pointer;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

/* Hover States (Shows colors) */
.btn-view:hover,
.tbl-btn-view:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #2563eb;
    /* Blue */
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.1);
}

.btn-edit:hover,
.tbl-btn-edit:hover {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #16a34a;
    /* Green */
    box-shadow: 0 2px 6px rgba(22, 163, 74, 0.1);
}

.btn-delete:hover,
.tbl-btn-delete:hover,
.tbl-btn-del:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
    /* Red */
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.1);
}

.action-row {
    display: flex;
    gap: 5px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: #9aba91;
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    display: block;
}

.empty-state p {
    font-size: 0.9rem;
    font-weight: 600;
}

/* ── BAG TAG MODAL ── */
.bag-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.bag-modal-overlay.open {
    display: flex;
}

.bag-modal-box {
    background: #fff;
    border-radius: 16px;
    padding: 28px 24px 20px;
    max-width: 330px;
    width: 90%;
    position: relative;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.bag-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
    cursor: pointer;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.bag-modal-close:hover {
    background: #e0e0e0;
}

/* Tag card inside modal */
.modal-tag-card {
    position: relative;
    border: 1px solid #5db96b;
    border-radius: 10px;
    background: linear-gradient(135deg, #dff8df 0%, #afe8b8 48%, #73cf82 100%);
    color: #103919;
    padding: 22px 16px 18px;
    margin-bottom: 16px;
    box-sizing: border-box;
}

.modal-tag-hole {
    position: absolute;
    left: 50%;
    top: 9px;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(16, 57, 25, 0.24);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.78);
    transform: translateX(-50%);
}

.modal-tag-title {
    display: block;
    padding-top: 12px;
    text-align: center;
    margin-bottom: 14px;
    font-size: 0.85rem;
    font-weight: 900;
    color: #0f3b1a;
}

.modal-tag-body {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.modal-tag-grid {
    display: grid;
    gap: 10px;
    flex: 1;
}

.modal-tag-row {
    display: grid;
    grid-template-columns: 72px 10px 1fr;
    gap: 6px;
    align-items: baseline;
}

.modal-tag-lbl {
    font-size: 0.76rem;
    font-weight: 900;
    color: rgba(16, 57, 25, 0.82);
}

.modal-tag-sep {
    color: rgba(16, 57, 25, 0.72);
    font-weight: 900;
    text-align: center;
}

.modal-tag-val {
    font-size: 0.88rem;
    font-weight: 900;
    color: #103919;
}

/* QR block inside modal */
.modal-qr-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.modal-qr-block canvas {
    border-radius: 6px;
    background: #fff;
    padding: 4px;
    display: block;
}

.modal-qr-label {
    font-size: 0.58rem;
    font-weight: 800;
    color: rgba(16, 57, 25, 0.65);
    text-align: center;
    letter-spacing: 0.04em;
}

/* Print button */
.modal-print-btn {
    width: 100%;
    padding: 11px;
    background: #1c7a39;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

.modal-print-btn:hover {
    background: #155f2c;
}


/* ── View page extra styles ── */
.view-hero-stat {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 10px 20px;
    min-width: 90px;
}

.view-hero-stat-val {
    font-size: 1.4rem;
    font-weight: 900;
    color: #fff;
}

.view-hero-stat-lbl {
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Bag chips table */
.bag-chips-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 4px;
}

.bag-chips-table thead tr {
    background: #1c7a39;
}

.bag-chips-table thead th {
    padding: 9px 14px;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
    text-align: left;
    letter-spacing: 0.04em;
}

.bag-chips-table tbody tr {
    border-bottom: 1px solid #e8f5e8;
    transition: background 0.15s;
}

.bag-chips-table tbody tr:hover {
    background: #f5fbf5;
}

.bag-chips-table tbody tr:last-child {
    border-bottom: none;
}

.bag-chips-table td {
    padding: 10px 14px;
    font-size: 0.88rem;
    color: #1a1a1a;
    vertical-align: middle;
}

.bag-num-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #d4ecd4;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 800;
    color: #1c7a39;
}

.bag-no-val {
    font-weight: 800;
    color: #103919;
    font-size: 0.92rem;
}

.bag-wt-val {
    font-weight: 700;
    color: #2d6a4f;
}

.bag-tag-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f0faf0;
    border: 1px solid #c8e6c8;
    color: #1c7a39;
    border-radius: 7px;
    padding: 5px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, border 0.2s;
}

.bag-tag-btn:hover {
    background: #1c7a39;
    color: #fff;
    border-color: #1c7a39;
}

/* Modal */
.bag-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.bag-modal-overlay.open {
    display: flex;
}

.bag-modal-box {
    background: #fff;
    border-radius: 16px;
    padding: 28px 24px 20px;
    max-width: 320px;
    width: 90%;
    position: relative;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.bag-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
    cursor: pointer;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.bag-modal-close:hover {
    background: #e0e0e0;
}

.modal-tag-card {
    position: relative;
    border: 1px solid #5db96b;
    border-radius: 10px;
    background: linear-gradient(135deg, #dff8df 0%, #afe8b8 48%, #73cf82 100%);
    color: #103919;
    padding: 22px 16px 18px;
    margin-bottom: 16px;
    box-sizing: border-box;
}

.modal-tag-hole {
    position: absolute;
    left: 50%;
    top: 9px;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(16, 57, 25, 0.24);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.78);
    transform: translateX(-50%);
}

.modal-tag-plus {
    position: absolute;
    top: 7px;
    right: 10px;
    color: rgba(16, 57, 25, 0.55);
    font-size: 1.2rem;
    font-weight: 700;
}

.modal-tag-title {
    display: block;
    padding-top: 12px;
    text-align: center;
    margin-bottom: 18px;
    font-size: 0.85rem;
    font-weight: 900;
    color: #0f3b1a;
}

.modal-tag-grid {
    display: grid;
    gap: 12px;
}

.modal-tag-row {
    display: grid;
    grid-template-columns: 72px 10px 1fr;
    gap: 6px;
    align-items: baseline;
}

.modal-tag-lbl {
    font-size: 0.76rem;
    font-weight: 900;
    color: rgba(16, 57, 25, 0.82);
}

.modal-tag-sep {
    color: rgba(16, 57, 25, 0.72);
    font-weight: 900;
    text-align: center;
}

.modal-tag-val {
    font-size: 0.88rem;
    font-weight: 900;
    color: #103919;
}

.modal-print-btn {
    width: 100%;
    padding: 11px;
    background: #1c7a39;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

.modal-print-btn:hover {
    background: #155f2c;
}

.qa-page {
    padding: 22px;
    min-height: calc(100vh - 80px);
    background: linear-gradient(180deg, #f4f8f4 0%, #eaf1ea 100%);
}

.kl-form {
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #d8ecd4;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(47, 97, 48, 0.07);
}

.kl-form-head {
    background: #1c7a39;
    padding: 18px 26px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.kl-form-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #fff;
    flex-shrink: 0;
}

.kl-form-head h3 {
    font-size: 0.98rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
}

.kl-form-head p {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.78);
    margin: 4px 0 0;
}

.kl-form-body {
    padding: 26px;
}

.kl-form-section {
    margin-bottom: 24px;
}

.kl-form-section-label {
    font-size: 0.62rem;
    font-weight: 800;
    color: #9aba91;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kl-form-section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5f0e0;
}

.kl-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.kl-grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kl-grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.kl-field label {
    display: block;
    font-size: 0.68rem;
    font-weight: 800;
    color: #3d5e3f;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 6px;
}

.kl-field input,
.kl-field select {
    width: 100%;
    box-sizing: border-box;
    border: 1.5px solid #d1e8cc;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.84rem;
    font-weight: 600;
    color: #1b2d20;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    appearance: auto;
}

.kl-field input:focus,
.kl-field select:focus {
    border-color: #4a824e;
    box-shadow: 0 0 0 3px rgba(47, 97, 48, 0.12);
}

.kl-field input[readonly] {
    background: #f8faf7;
    color: #4b6351;
    border-color: #e5f0e0;
    cursor: not-allowed;
}

.kl-form-footer {
    padding: 18px 26px;
    border-top: 1px solid #e8f3e4;
    background: #f8faf7;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.kl-btn-submit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #1c7a39;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 11px 24px;
    cursor: pointer;
    transition: opacity 0.2s;
    box-shadow: 0 4px 14px rgba(47, 97, 48, 0.28);
}

.kl-btn-submit:hover {
    opacity: 0.88;
}

.kl-btn-cancel {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #fff;
    color: #6b7280;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.kl-btn-cancel:hover {
    background: #f3f4f6;
    color: #374151;
}

.kl-btn-secondary {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 8px 16px;
    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
}

.qa-bag-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.qa-help {
    font-size: 11px;
    color: #5a7d5c;
    margin-top: 6px;
}

.qa-bag-wrap {
    border: 1px solid #c5dcc0;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

.qa-bag-header {
    display: grid;
    grid-template-columns: 1fr repeat(8, 1.2fr) 60px;
    gap: 12px;
    padding: 14px 20px;
    background: #f4f9f2;
    border-bottom: 2px solid #c5dcc0;
    font-size: 0.65rem;
    font-weight: 800;
    color: #2F7A33;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.qa-bag-row {
    display: grid;
    grid-template-columns: 1fr repeat(8, 1.2fr) 60px;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid #edf4eb;
    align-items: center;
    transition: background 0.15s;
}

.qa-bag-row:hover {
    background: #fbfdfa;
}

.qa-bag-row:last-child {
    border-bottom: 0;
}

.qa-bag-row .kl-field {
    margin: 0;
}

.qa-bag-row .kl-field input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #c5dcc0;
    border-radius: 8px;
    font-size: 0.76rem;
    font-weight: 700;
    color: #1a2e1b;
    background: #fff;
    transition: all 0.2s;
}

.qa-bag-row .kl-field input:focus {
    border-color: #2F7A33;
    box-shadow: 0 0 0 3px rgba(47, 122, 51, 0.12);
    outline: none;
}

.qa-bag-row .kl-field input[readonly] {
    background: #f4f8f3;
    color: #3b5a3d;
    border-color: #d2ecd0;
    cursor: not-allowed;
}

.qa-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #efcaca;
    background: #fff0f0;
    color: #b74949;
    cursor: pointer;
    transition: all 0.18s;
    justify-self: center;
}

.qa-icon-btn:hover {
    background: #b74949;
    color: #fff;
    border-color: transparent;
}



/* ═══════════════════════════ QC HUB ═══════════════════════════ */
.qc-hub-hero {
    background: #1c7a39;
    border-radius: 16px;
    padding: 22px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.qc-hub-hero::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    pointer-events: none;
}

.qc-hub-hero-copy h2 {
    font-size: 1.3rem;
    font-weight: 900;
    color: #fff;
    line-height: 1.2;
    margin: 0 0 6px;
}

.qc-hub-hero-copy p {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
}

.qc-hub-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 0.74rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    backdrop-filter: blur(4px);
}

.qc-top-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin: -6px 0 14px;
}

/* METRICS */
.qc-hub-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.qc-hub-metric {
    background: #fff;
    border: 1px solid #c5dcc0;
    border-radius: 13px;
    padding: 15px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.qc-hub-metric:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(47, 122, 51, .12);
}

.qc-hub-metric-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #1c7a39;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #fff;
    flex-shrink: 0;
}

.qc-hub-metric-label {
    font-size: 0.6rem;
    font-weight: 800;
    color: #2F7A33;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    margin-bottom: 3px;
}

.qc-hub-metric-value {
    font-size: 1.3rem;
    font-weight: 900;
    color: #1a2e1b;
}

/* TABS */
.qc-source-tabs {
    display: flex;
    gap: 0;
    background: #fff;
    border: 1px solid #c5dcc0;
    border-radius: 14px;
    padding: 6px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(47, 122, 51, .06);
}

.qc-source-tab {
    flex: 1;
    padding: 14px 16px;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    border: 1.5px solid transparent;
    background: transparent;
    transition: all 0.22s;
    text-decoration: none;
    display: block;
}

.qc-source-tab:hover {
    background: #f2f8f2;
    border-color: #8AAB80;
}

.qc-source-tab.active {
    background: #1c7a39;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(47, 122, 51, .28);
}

.qc-source-tab .tab-name {
    display: block;
    font-size: 0.88rem;
    font-weight: 800;
    color: #1a2e1b;
    transition: color 0.2s;
}

.qc-source-tab.active .tab-name {
    color: #fff;
}

.qc-source-tab .tab-desc {
    display: block;
    font-size: 0.64rem;
    color: #2F7A33;
    margin-top: 3px;
    transition: color 0.2s;
}

.qc-source-tab.active .tab-desc {
    color: rgba(255, 255, 255, 0.75);
}

.qc-section {
    display: none;
}

.qc-section.active {
    display: block;
}

/* TABLE PANEL */
.qc-hub-panel {
    background: #fff;
    border: 1px solid #c5dcc0;
    border-radius: 14px;
    padding: 20px 22px;
}

.qc-hub-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.qc-hub-panel-title {
    font-size: 0.88rem;
    font-weight: 800;
    color: #1a2e1b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.qc-hub-stripe {
    width: 3px;
    height: 18px;
    border-radius: 4px;
    background: #1c7a39;
}

.qc-hub-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 11px 20px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
    text-decoration: none;
}

.qc-hub-add-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

/* secondary btn used inline */
.qc-btn {
    text-decoration: none;
    border-radius: 10px;
    padding: 9px 16px;
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
}

.qc-btn.secondary {
    background: #edf6e8;
    color: #2F7A33;
    border: 1px solid #8AAB80;
}

.qc-btn.secondary:hover {
    background: #d6eccc;
}

.qc-hub-tbl-wrap {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid #d4e8cf;
}

.qc-hub-tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.76rem;
}

.qc-hub-tbl thead th {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: #2F7A33;
    padding: 8px 10px;
    text-align: left;
    border-bottom: 2px solid #d4e8cf;
    background: #f4f9f2;
}

.qc-hub-tbl tbody tr:nth-child(odd) {
    background: #fafcf9;
}

.qc-hub-tbl tbody tr:nth-child(even) {
    background: #fff;
}

.qc-hub-tbl tbody tr:hover {
    background: #f0f7ee;
    transition: background 0.15s;
}

.qc-hub-tbl tbody td {
    padding: 9px 10px;
    color: #1a2e1b;
    font-weight: 600;
    border-bottom: 1px solid #edf4eb;
    vertical-align: middle;
}

.qc-form-panel {
    display: none;
    margin-bottom: 16px;
    border: 1px solid #c5dcc0;
    border-radius: 14px;
    background: #f8fcf6;
    padding: 16px;
}

.qc-form-panel.open {
    display: block;
}

.qc-inline-form {
    display: none;
}

.qc-inline-form.open {
    display: block;
}

.qc-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.qc-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.qc-field label {
    font-size: 0.65rem;
    font-weight: 800;
    color: #2F7A33;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.qc-field input,
.qc-field select {
    width: 100%;
    border: 1px solid #c5dcc0;
    border-radius: 10px;
    background: #fff;
    padding: 10px 12px;
    font: inherit;
    color: #1a2e1b;
}

.qc-field input:focus,
.qc-field select:focus {
    outline: none;
    border-color: #2F7A33;
    box-shadow: 0 0 0 3px rgba(47, 122, 51, 0.14);
}

/* TABLE BADGES & BUTTONS */
.qc-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 800;
}

.qc-lot-text {
    display: inline-block;
    color: #2F7A33;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.01em;
}

.qc-approved {
    background: #dcfce7;
    color: #15803d;
}

.qc-hold {
    background: #fef9c3;
    color: #856404;
}

.qc-rejected {
    background: #fee2e2;
    color: #c0392b;
}

.tbl-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 7px;
    font-size: 0.64rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.18s;
    text-decoration: none;
}

.tbl-btn-view {
    background: #eaf3e5;
    color: #2F7A33;
    border: 1px solid #8AAB80;
}

.tbl-btn-del {
    background: #fff0f0;
    color: #b74949;
    border: 1px solid #efcaca;
}

.tbl-btn-view:hover {
    background: #2F7A33;
    color: #fff;
    border-color: transparent;
}

.tbl-btn-del:hover {
    background: #b74949;
    color: #fff;
    border-color: transparent;
}

.qc-tbl-empty {
    text-align: center;
    color: #2F7A33;
    font-size: 0.76rem;
    padding: 30px 0;
}

@media (max-width: 900px) {
    .qc-hub-metrics {
        grid-template-columns: repeat(2, 1fr);
    }

    .qc-source-tabs {
        flex-direction: column;
    }
}

@media (max-width: 600px) {
    .qc-hub-metrics {
        grid-template-columns: 1fr;
    }

    .qc-hub-hero {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

.ql-page {
    padding: 22px;
    min-height: calc(100vh - 80px);
    background: linear-gradient(180deg, #f4f8f4 0%, #eaf1ea 100%);
}

.kl-form {
    max-width: 1100px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #d8ecd4;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(47, 97, 48, 0.07);
}

.kl-form-head {
    background: #1c7a39;
    padding: 18px 26px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.kl-form-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #fff;
    flex-shrink: 0;
}

.kl-form-head h3 {
    font-size: 0.98rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
}

.kl-form-head p {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.78);
    margin: 4px 0 0;
}

.kl-form-body {
    padding: 26px;
}

.kl-form-section {
    margin-bottom: 24px;
}

.kl-form-section-label {
    font-size: 0.62rem;
    font-weight: 800;
    color: #9aba91;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kl-form-section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5f0e0;
}

.kl-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.kl-grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kl-grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.kl-field label {
    display: block;
    font-size: 0.68rem;
    font-weight: 800;
    color: #3d5e3f;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 6px;
}

.kl-field input,
.kl-field select {
    width: 100%;
    box-sizing: border-box;
    border: 1.5px solid #d1e8cc;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.84rem;
    font-weight: 600;
    color: #1b2d20;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    appearance: auto;
}

.kl-field input:focus,
.kl-field select:focus {
    border-color: #4a824e;
    box-shadow: 0 0 0 3px rgba(47, 97, 48, 0.12);
}

.kl-form-footer {
    padding: 18px 26px;
    border-top: 1px solid #e8f3e4;
    background: #f8faf7;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.kl-btn-submit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #1c7a39;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 11px 24px;
    cursor: pointer;
    transition: opacity 0.2s;
    box-shadow: 0 4px 14px rgba(47, 97, 48, 0.28);
}

.kl-btn-submit:hover {
    opacity: 0.88;
}

.kl-btn-cancel {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #fff;
    color: #6b7280;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.kl-btn-cancel:hover {
    background: #f3f4f6;
    color: #374151;
}

.ql-bag-tbl {
    width: 100%;
    border-collapse: collapse;
    min-width: 1200px;
    font-size: 0.76rem;
}

.ql-bag-tbl th {
    padding: 8px 6px;
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #2F7A33;
    text-align: left;
    background: #f4f9f2;
    border-bottom: 2px solid #d4e8cf;
}

.ql-bag-tbl td {
    padding: 6px;
    border-bottom: 1px solid #edf4eb;
    vertical-align: top;
}

.ql-bag-tbl input,
.ql-bag-tbl select {
    width: 100%;
    border: 1px solid #c5dcc0;
    border-radius: 8px;
    padding: 6px 8px;
    font-size: 0.72rem;
}

.ql-icon-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #efcaca;
    background: #fff0f0;
    color: #b74949;
    cursor: pointer;
}

.ql-icon-btn:hover {
    background: #b74949;
    color: #fff;
}

.kl-btn-secondary {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 8px 16px;
    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
}

.qa-page {
    padding: 22px;
    min-height: calc(100vh - 80px);
    background: linear-gradient(180deg, #f4f8f4 0%, #eaf1ea 100%);
}

.kl-form {
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #d8ecd4;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(47, 97, 48, 0.07);
}

.kl-form-head {
    background: #1c7a39;
    padding: 18px 26px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.kl-form-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #fff;
    flex-shrink: 0;
}

.kl-form-head h3 {
    font-size: 0.98rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
}

.kl-form-head p {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.78);
    margin: 4px 0 0;
}

.kl-form-body {
    padding: 26px;
}

.kl-form-section {
    margin-bottom: 24px;
}

.kl-form-section-label {
    font-size: 0.62rem;
    font-weight: 800;
    color: #9aba91;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kl-form-section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5f0e0;
}

.kl-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.kl-grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kl-grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.kl-field label {
    display: block;
    font-size: 0.68rem;
    font-weight: 800;
    color: #3d5e3f;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 6px;
}

.kl-field input,
.kl-field select {
    width: 100%;
    box-sizing: border-box;
    border: 1.5px solid #d1e8cc;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.84rem;
    font-weight: 600;
    color: #1b2d20;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    appearance: auto;
}

.kl-field input:focus,
.kl-field select:focus {
    border-color: #4a824e;
    box-shadow: 0 0 0 3px rgba(47, 97, 48, 0.12);
}

.kl-form-footer {
    padding: 18px 26px;
    border-top: 1px solid #e8f3e4;
    background: #f8faf7;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.kl-btn-submit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #1c7a39;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 11px 24px;
    cursor: pointer;
    transition: opacity 0.2s;
    box-shadow: 0 4px 14px rgba(47, 97, 48, 0.28);
}

.kl-btn-submit:hover {
    opacity: 0.88;
}

.kl-btn-cancel {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #fff;
    color: #6b7280;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.kl-btn-cancel:hover {
    background: #f3f4f6;
    color: #374151;
}

.print-page {
    padding: 24px;
    background: #edf2ed;
    min-height: calc(100vh - 80px);
}

.print-toolbar {
    width: 100%;
    max-width: 980px;
    margin: 0 auto 14px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.print-btn {
    text-decoration: none;
    border-radius: 999px;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 800;
    background: #fff;
    color: #2F7A33;
    border: 1px solid #8AAB80;
}

.print-stack {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
}

.coa-paper {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 980px;
    min-height: 1380px;
    margin: 0 auto;
    padding: 52px 62px 28px;
    border: 1px solid #8AAB80;
    background: #fffef8;
    color: #2d2a26;
    font-family: "Times New Roman", Georgia, serif;
    overflow: hidden;
    box-sizing: border-box;
}

.coa-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
}

.coa-logo-wrap {
    width: 100px;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
}

.coa-logo {
    max-width: 90px;
    max-height: 90px;
    object-fit: contain;
}

.coa-brand {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #7a9d58;
}

.coa-brand-top-wrap {
    display: flex;
    align-items: center;
    width: 100%;
}

.coa-ausbon {
    font-size: 20px;
    font-weight: 700;
    font-style: italic;
    color: #2d2a26;
    letter-spacing: .03em;
    padding-right: 12px;
}

.coa-brand-line-top {
    flex: 1;
    height: 1.5px;
    background: #7a9d58;
}

.coa-brand-name {
    margin: 2px 0 4px;
    font-size: 28px;
    line-height: 1.05;
    font-weight: 800;
    color: #7a9d58;
    text-transform: uppercase;
    letter-spacing: .02em;
    white-space: nowrap;
}

.coa-brand-sub {
    margin: 0 auto 6px;
    font-size: 15px;
    font-weight: 800;
    text-transform: uppercase;
    color: #7a9d58;
    letter-spacing: .02em;
    white-space: nowrap;
}

.coa-brand-line-bottom {
    width: 100%;
    height: 1.5px;
    background: #7a9d58;
}

.coa-cert-title {
    margin: 16px 0 8px;
    text-align: center;
    font-size: 20px;
    font-weight: 800;
    text-transform: uppercase;
    text-decoration: underline;
    color: #2d2926;
}

.coa-meta {
    width: 100%;
    margin: 0 0 10px;
    border-collapse: collapse;
}

.coa-meta td {
    padding: 1px 4px;
    font-size: 16px;
    line-height: 1.12;
    vertical-align: top;
    color: #2d2a26;
}

.coa-meta .label {
    width: 28%;
    font-weight: 400;
}

.coa-meta .colon {
    width: 3%;
    text-align: center;
    font-weight: 400;
}

.coa-meta .value {
    width: 69%;
    font-weight: 400;
}

.coa-result-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.coa-result-table th,
.coa-result-table td {
    border: 1px solid #c4d0b8;
    padding: 6px 5px;
    text-align: center;
    font-size: 14px;
    line-height: 1.08;
}

.coa-result-table thead tr:first-child th {
    background: #73a343;
    color: #1f211c;
    font-weight: 800;
    font-size: 15px;
    padding: 8px 5px;
}

.coa-result-table thead tr:nth-child(2) th {
    background: #eef0e8;
    color: #2d2a26;
    font-weight: 400;
    font-size: 13px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.coa-result-table tbody tr:nth-child(even) {
    background: #dfe6d7;
}

.coa-result-table tbody tr:nth-child(odd) {
    background: #f9f8f4;
}

.coa-result-table .bag-col {
    width: 11%;
}

.coa-result-table .ph-col {
    width: 9%;
}

.coa-signs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: end;
    margin-top: auto;
}

.coa-sign {
    min-height: 96px;
    text-align: center;
}

.coa-sign-label {
    font-size: 17px;
    font-weight: 400;
    margin-bottom: 52px;
    text-align: center;
}

.coa-footer {
    margin-top: 0;
    border-top: 1.5px solid #7a9d58;
    padding-top: 10px;
    text-align: center;
    color: #2f2b27;
}

.coa-footer-line {
    font-size: 14px;
    line-height: 1.25;
}

.coa-footer-line a {
    color: #284a8f;
    text-decoration: underline;
}

.coa-empty {
    padding: 18px;
    border: 1px dashed #8AAB80;
    text-align: center;
    color: #5a7d5c;
}

.lotwise-paper {
    width: 100%;
    max-width: 980px;
    min-height: 1050px;
    margin: 24px auto 0;
    padding: 52px 62px 28px;
    border: 1px solid #8AAB80;
    background: #fffef8;
    color: #2d2a26;
    font-family: "Times New Roman", Georgia, serif;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.lotwise-page-break {
    page-break-before: always;
    break-before: page;
}

.lotwise-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
}

.lotwise-logo-wrap {
    width: 100px;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
}

.lotwise-logo {
    max-width: 90px;
    max-height: 90px;
    object-fit: contain;
}

.lotwise-brand {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #7a9d58;
}

.lotwise-brand-top-wrap {
    display: flex;
    align-items: center;
    width: 100%;
}

.lotwise-brand-top {
    font-size: 20px;
    font-weight: 700;
    font-style: italic;
    color: #2d2a26;
    letter-spacing: .03em;
    padding-right: 12px;
}

.lotwise-brand-line-top {
    flex: 1;
    height: 1.5px;
    background: #7a9d58;
}

.lotwise-brand-name {
    margin: 2px 0 4px;
    font-size: 28px;
    line-height: 1.05;
    font-weight: 800;
    color: #7a9d58;
    text-transform: uppercase;
    letter-spacing: .02em;
    white-space: nowrap;
}

.lotwise-brand-sub {
    margin: 0 auto 6px;
    font-size: 15px;
    font-weight: 800;
    text-transform: uppercase;
    color: #7a9d58;
    letter-spacing: .02em;
    white-space: nowrap;
}

.lotwise-brand-line-bottom {
    width: 100%;
    height: 1.5px;
    background: #7a9d58;
}

.lotwise-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: #79a842;
    color: #1d2a18;
    padding: 16px;
    font-size: 16px;
    text-transform: uppercase;
}

.lotwise-info strong {
    font-weight: 500;
}

.lotwise-container {
    background: #79a842;
    color: #1d2a18;
    text-align: center;
    padding: 14px 16px 20px;
    font-size: 20px;
    text-transform: uppercase;
}

.lotwise-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.lotwise-table th,
.lotwise-table td {
    border: 1px solid #cbd8bd;
    padding: 17px 12px;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
}

.lotwise-table th {
    background: #eef0e8;
    font-size: 15px;
    text-transform: uppercase;
    color: #2d2a26;
    padding: 15px 12px;
}

.lotwise-table tbody tr:nth-child(even) {
    background: #dfe6d7;
}

.lotwise-table tbody tr:nth-child(odd) {
    background: #f8f6f3;
}

.lotwise-table .param-main {
    text-align: center;
}

.lotwise-table .param-sub {
    width: 12%;
}

.lotwise-table .result {
    font-size: 15px;
    color: #2d2a26;
}

.lotwise-signs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: auto;
    align-items: end;
}

.lotwise-sign {
    min-height: 96px;
    text-align: center;
}

.lotwise-sign-label {
    font-size: 17px;
    text-align: center;
    margin-bottom: 52px;
}

.lotwise-sign-name {
    display: none;
}

.lotwise-footer {
    margin-top: 0;
    border-top: 1.5px solid #7a9d58;
    padding-top: 10px;
    text-align: center;
    font-size: 14px;
    line-height: 1.25;
}

@media print {
    @page {
        size: portrait;
        margin: 0;
    }

    html,
    body {
        height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body * {
        visibility: hidden;
    }

    .print-stack,
    .print-stack * {
        visibility: visible;
    }

    .print-page {
        padding: 0;
        background: #fff;
    }

    .print-toolbar {
        display: none;
    }

    .print-stack {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: auto !important;
        min-height: 100% !important;
        max-width: none;
    }

    .coa-paper,
    .lotwise-paper {
        width: 100% !important;
        height: auto !important;
        min-height: 250mm !important;
        max-height: none !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        padding: 40px 60px 20px !important;
        border: 0 !important;
        page-break-inside: auto !important;
        break-inside: auto !important;
        box-sizing: border-box !important;
        overflow: visible !important;
        position: relative !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .coa-signs,
    .lotwise-signs {
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
        right: auto !important;
        width: 100% !important;
        margin-top: auto !important;
        padding-top: 40px !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .coa-footer,
    .lotwise-footer {
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
        right: auto !important;
        width: 100% !important;
        margin-top: 20px !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .lotwise-table th,
    .lotwise-table td {
        padding: 8px 10px !important;
        font-size: 13px !important;
    }

    .lotwise-info {
        padding: 10px !important;
        font-size: 14px !important;
    }

    .lotwise-container {
        padding: 10px 10px 14px !important;
        font-size: 16px !important;
    }

    .lotwise-header {
        margin-bottom: 16px !important;
    }

    .lotwise-page-break {
        page-break-before: always !important;
        break-before: page !important;
    }
}

.kl-page {
    display: flex;
    flex-direction: column;
    gap: 18px
}

.kl-hero {
    background: var(--green);
    border-radius: 16px;
    padding: 22px 28px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center
}

.kl-hero h2 {
    margin: 0 0 6px;
    font-size: 1.3rem;
    font-weight: 900
}

.kl-hero p {
    margin: 0;
    color: rgba(255, 255, 255, .82);
    font-size: .78rem
}

.kl-date-picker {
    display: flex;
    align-items: center;
    gap: 10px
}

.kl-date-picker input[type="date"] {
    background: rgba(255, 255, 255, .15);
    border: 2px solid rgba(255, 255, 255, .35);
    border-radius: 10px;
    padding: 8px 14px;
    color: #fff;
    font-size: .88rem;
    font-weight: 900;
    cursor: pointer;
    outline: none;
    transition: all .2s
}

.kl-date-picker input[type="date"]:hover,
.kl-date-picker input[type="date"]:focus {
    background: rgba(255, 255, 255, .25);
    border-color: rgba(255, 255, 255, .6)
}

.kl-date-picker input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer
}

.kl-date-nav {
    background: rgba(255, 255, 255, .15);
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 8px;
    padding: 6px 10px;
    color: #fff;
    font-size: .82rem;
    font-weight: 900;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: all .2s
}

.kl-date-nav:hover {
    background: rgba(255, 255, 255, .3)
}

.kl-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #dcfce7;
    color: #15803d;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: .68rem;
    font-weight: 900
}

.kl-metrics {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px
}

.kl-metric {
    background: #fff;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    padding: 14px;
    text-align: center
}

.kl-metric span {
    display: block;
    font-size: .6rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #16a34a;
    font-weight: 900
}

.kl-metric strong {
    font-size: 1.25rem;
    color: #14532d
}

.kl-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid #bbf7d0;
    border-radius: 14px;
    padding: 6px
}

.kl-tab {
    flex: 1;
    min-width: 110px;
    text-align: center;
    text-decoration: none;
    border-radius: 10px;
    padding: 12px;
    color: #14532d;
    font-size: .76rem;
    font-weight: 900
}

.kl-tab.active {
    background: var(--green);
    color: #fff
}

.kl-section {
    display: none
}

.kl-section.active {
    display: block
}

.kl-panel {
    background: #fff;
    border: 1px solid #bbf7d0;
    border-radius: 14px;
    padding: 18px
}

.kl-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 14px
}

.kl-title {
    font-weight: 900;
    color: #14532d;
    display: flex;
    align-items: center;
    gap: 8px
}

.kl-btn {
    border: 0;
    border-radius: 10px;
    padding: 11px 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
}

.kl-btn {
    border: 0;
    border-radius: 10px;
    padding: 11px 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
}

.kl-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.kl-btn.primary {
    background: var(--green);
    color: #fff
}

.kl-btn.secondary {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0
}

/* DESTONE FORM STYLE (Adapted for Kiln) */
.kl-form {
    margin-bottom: 24px;
    background: #fff;
    border: 1px solid #d8ecd4;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(47, 97, 48, 0.07)
}

.kl-form.open {
    display: block
}

.kl-form-head {
    background: #1c7a39;
    padding: 18px 26px;
    display: flex;
    align-items: center;
    gap: 12px
}

.kl-form-head h3 {
    font-size: 0.98rem;
    font-weight: 800;
    color: #fff;
    margin: 0
}

.kl-form-head p {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.78);
    margin: 4px 0 0
}

.kl-form-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #fff;
    flex-shrink: 0
}

.kl-form-body {
    padding: 26px
}

.kl-form-section {
    margin-bottom: 24px
}

.kl-form-section-label {
    font-size: 0.62rem;
    font-weight: 800;
    color: #9aba91;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px
}

.kl-form-section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5f0e0
}

.kl-form-footer {
    padding: 18px 26px;
    border-top: 1px solid #e8f3e4;
    background: #f8faf7;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px
}

.kl-btn-submit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #1c7a39;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 11px 24px;
    cursor: pointer;
    transition: opacity 0.2s;
    box-shadow: 0 4px 14px rgba(47, 97, 48, 0.28)
}

.kl-btn-submit:hover {
    opacity: 0.88
}

.kl-btn-cancel {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #fff;
    color: #6b7280;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none
}

.kl-btn-cancel:hover {
    background: #f3f4f6;
    color: #374151
}

.kl-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px
}

.kl-grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr))
}

.kl-grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr))
}

.kl-field label {
    display: block;
    font-size: 0.68rem;
    font-weight: 800;
    color: #3d5e3f;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 6px
}

.kl-field input,
.kl-field select,
.kl-field textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1.5px solid #d1e8cc;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.84rem;
    font-weight: 600;
    color: #1b2d20;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    appearance: auto
}

.kl-field input:focus,
.kl-field select:focus,
.kl-field textarea:focus {
    border-color: #4a824e;
    box-shadow: 0 0 0 3px rgba(47, 97, 48, 0.12)
}

.kl-field input::placeholder {
    color: #b0c8b0;
    font-weight: 500
}

.kl-field textarea {
    min-height: 96px
}

.kl-table-wrap {
    overflow-x: auto;
    border: 1px solid #dcfce7;
    border-radius: 10px
}

.kl-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 960px;
    font-size: .76rem
}

.kl-table th {
    background: #1c7a39;
    color: #ffffff;
    text-align: left;
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 16px 20px;
    border: none;
}

.kl-table td {
    padding: 16px 20px;
    border: none;
    border-bottom: 1px solid #e8f3e4;
    color: #14532d;
    font-weight: 600;
    text-align: left;
}

.kl-empty {
    text-align: center;
    color: #4ade80;
    padding: 26px
}

.kl-total td {
    background: #ecfdf5;
    font-weight: 900
}

.tbl-btn {
    border: 0;
    border-radius: 7px;
    padding: 5px 10px;
    font-size: .64rem;
    font-weight: 800;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer
}

.tbl-view {
    background: #dcfce7;
    color: #15803d
}

.tbl-del {
    background: #fef2f2;
    color: #dc2626
}

.accent {
    font-weight: 900;
    color: #0284c7
}

.swatches {
    display: flex;
    gap: 8px;
    align-items: center
}

.swatches label {
    display: flex;
    align-items: center;
    gap: 5px;
    text-transform: none;
    color: #14532d
}

.swatches input {
    width: auto
}

.moisture-average-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
    padding: 12px 14px;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    background: #f0fdf4;
    color: #14532d;
    font-weight: 900
}

.moisture-average-card strong {
    font-size: 1.05rem;
    color: #15803d
}

.moisture-summary-table {
    margin-top: 10px
}

@media(max-width:1000px) {

    .kl-metrics,
    .kl-grid,
    .kl-grid.cols-3,
    .kl-grid.cols-2 {
        grid-template-columns: 1fr
    }

    .kl-hero {
        align-items: flex-start;
        flex-direction: column
    }
}

@page {
    size: A4 portrait;
    margin: 8mm;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #e8f0e8;
    color: #071e0d;
    font-family: Poppins;
    font-size: 11px;
    line-height: 1.25;
}

.print-shell {
    padding: 18px;
}

.print-sheet {
    width: 100%;
    max-width: 1540px;
    min-height: 1040px;
    margin: 0 auto;
    padding: 22px;
    background: #fffdf7;
    border: 2px solid #2F7A33;
}

/* ── Toolbar ── */
.print-toolbar {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 20px;
}

.print-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 10px 18px;
    border: 1px solid #2F7A33;
    border-radius: 999px;
    background: #fff;
    color: #0b2b28;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.print-btn:hover {
    background: #edf5ed;
}

/* ── Heading ── */
.print-heading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 0 0 16px;
    padding: 12px 0;
    border-top: 3px solid #2F7A33;
    border-bottom: 3px solid #2F7A33;
    background: #f2f9f2;
}

.print-logo {
    width: 80px;
    height: auto;
    max-height: 72px;
    object-fit: contain;
    flex-shrink: 0;
}

.print-title {
    text-align: left;
}

.print-title h1 {
    margin: 0;
    font-size: 27px;
    line-height: 1;
    letter-spacing: 0.03em;
    color: #2F7A33;
}

.print-title p {
    margin: 8px 0 0;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8AAB80;
}

/* ── Grids ── */
.print-grid-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.feed-discharge-wrap {
    display: grid;
    grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.15fr);
    gap: 16px;
    align-items: start;
}

/* ── Register box ── */
.register-box {
    border: 1.5px solid #8AAB80;
    background: #fffefa;
    break-inside: avoid;
}

/* ── Box title ── */
.box-title {
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
    border-bottom: 1.5px solid #8AAB80;
    font-size: 13px;
    font-weight: 900;
    text-align: center;
    text-transform: uppercase;
    background: #2F7A33;
    color: #ffffff;
    letter-spacing: 0.04em;
}

/* ── Tables ── */
.register-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.register-table th,
.register-table td {
    border: 1px solid #c2d9b8;
    padding: 6px 7px;
    vertical-align: top;
    overflow-wrap: anywhere;
}

/* Header row */
.register-table thead tr th {
    background: #8AAB80;
    color: #ffffff;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    text-align: center;
}

/* Alternating rows */
.register-table tbody tr:nth-child(even) td {
    background: #f2f9f2;
}

.register-table tbody tr:nth-child(odd) td {
    background: #ffffff;
}

.register-table td {
    min-height: 26px;
    font-size: 12px;
    color: #071e0d;
}

/* ── Hourly table ── */
.hourly-table th,
.hourly-table td {
    padding: 6px 6px;
    text-align: center;
    white-space: nowrap;
}

.hourly-table .time-col {
    width: 8%;
}

.hourly-table .temp-col {
    width: 7%;
}

/* ── Remarks ── */
.remarks-box {
    min-height: 148px;
}

.remarks-table .date-col {
    width: 19%;
}

.remarks-table .shift-col {
    width: 10%;
    text-align: center;
}

/* ── Bottom stack ── */
.bottom-stack {
    display: grid;
    gap: 14px;
}

.param-table th:first-child,
.param-table td:first-child {
    width: 30%;
    font-weight: 800;
    text-transform: uppercase;
    background: #edf5ed !important;
    color: #2F7A33;
}

/* ── Feed table ── */
.feed-table th:nth-child(1),
.feed-table td:nth-child(1) {
    width: 12%;
    text-align: center;
}

.feed-table th:nth-child(2),
.feed-table td:nth-child(2) {
    width: 28%;
}

.feed-table th:nth-child(3),
.feed-table td:nth-child(3) {
    width: 28%;
}

.feed-table th:nth-child(4),
.feed-table td:nth-child(4) {
    width: 32%;
}

/* ── Discharge table ── */
.discharge-table th,
.discharge-table td {
    text-align: center;
    padding-left: 5px;
    padding-right: 5px;
}

.discharge-table th:nth-child(1),
.discharge-table td:nth-child(1) {
    width: 18%;
}

.discharge-table th:nth-child(2),
.discharge-table td:nth-child(2),
.discharge-table th:nth-child(3),
.discharge-table td:nth-child(3) {
    width: 13%;
}

.discharge-table th:nth-child(4),
.discharge-table td:nth-child(4),
.discharge-table th:nth-child(5),
.discharge-table td:nth-child(5),
.discharge-table th:nth-child(6),
.discharge-table td:nth-child(6) {
    width: 18.66%;
}

/* Total row */
.discharge-total td {
    font-weight: 900;
    background: #2F7A33 !important;
    color: #ffffff !important;
}

.small-note-row td {
    height: 30px;
}

.moisture-print-table th,
.moisture-print-table td {
    height: 30px;
    text-align: center;
    font-weight: 800;
}

.moisture-print-table .sample-col {
    width: 22%;
}

.moisture-print-table .value-col {
    width: 48%;
    font-size: 13px;
}

.moisture-print-table .avg-col {
    width: 30%;
    font-size: 15px;
    font-weight: 900;
}

.moisture-print-table .avg-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #2F7A33;
    display: block;
    margin-bottom: 4px;
}

.blank-row td {
    height: 24px;
    background: #ffffff !important;
}



.text-left {
    text-align: left !important;
}

.nowrap {
    white-space: nowrap;
}

/* ── Print media ── */
@media print {
    body {
        background: #fff;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .print-shell {
        padding: 0;
    }

    .print-sheet {
        width: 100%;
        max-width: none;
        min-height: 0;
        margin: 0;
        padding: 0;
        border: 0;
    }

    .print-toolbar {
        display: none;
    }

    .print-heading {
        margin-bottom: 10px;
        padding: 8px 0;
    }

    .print-logo {
        width: 64px;
        max-height: 58px;
    }

    .register-box {
        break-inside: avoid;
    }
}

@media (max-width: 1100px) {

    .print-grid-top,
    .feed-discharge-wrap {
        grid-template-columns: 1fr;
    }
}

.kt-wrap {
    min-height: calc(100vh - 140px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 16px;
    background:
        radial-gradient(circle at 50% 0%, rgba(120, 165, 87, 0.22), transparent 34%),
        linear-gradient(180deg, #f3faf1 0%, #e7f3e3 100%);
}

.kt-card {
    width: 340px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #b9d9ae;
    border-radius: 20px;
    color: #12291a;
    box-shadow: 0 24px 52px rgba(15, 90, 37, 0.18);
    position: relative;
}

.kt-head {
    position: relative;
    padding: 16px 20px 14px;
    text-align: center;
    background:
        radial-gradient(circle at 86% 10%, rgba(255, 255, 255, 0.22), transparent 34%),
        #1c7a39;
    color: #fff;
}

.kt-head h1 {
    margin: 0;
    font-size: 17px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.kt-head p {
    margin: 5px 0 0;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.78);
}

.kt-pin {
    width: 22px;
    height: 22px;
    margin: 0 auto 8px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.34);
}

.kt-pin::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18);
}

.kt-body {
    padding: 14px 18px 16px;
}

.kt-grid {
    display: grid;
    gap: 5px;
    padding: 10px 12px;
    border-radius: 14px;
    background: #f8fcf7;
    border: 1px solid #d8ecd4;
}

.kt-row {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 12px;
    align-items: center;
    min-height: 28px;
}

.kt-row span {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #5c745f;
}

.kt-row strong {
    display: block;
    font-size: 16px;
    line-height: 1.1;
    color: #0f2018;
    text-align: right;
    word-break: break-word;
}

.kt-row em {
    font-style: normal;
    display: block;
    margin-top: 1px;
    font-size: 9px;
    font-weight: 700;
    color: #6f856c;
    text-align: right;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.kt-qr {
    margin: 12px auto 10px;
    width: 134px;
    min-height: 134px;
    border-radius: 14px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border: 1px solid #cfe6c8;
    box-shadow: 0 12px 24px rgba(15, 90, 37, 0.1);
}

.kt-footnote {
    margin-bottom: 10px;
    text-align: center;
    color: #668061;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.kt-actions {
    display: flex;
    gap: 8px;
}

.kt-btn {
    flex: 1;
    border-radius: 10px;
    padding: 9px 12px;
    font-weight: 800;
    font-size: 11px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}

.kt-btn.primary {
    border: 1px solid transparent;
    background: #1c7a39;
    color: #fff;
    box-shadow: 0 10px 20px rgba(15, 90, 37, 0.18);
}

.kt-btn.secondary {
    background: #f0f8ed;
    color: #0f5a25;
    border: 1px solid #cfe6c8;
}

@media print {
    body * {
        visibility: hidden;
    }

    .kt-card,
    .kt-card * {
        visibility: visible;
    }

    .kt-card {
        position: absolute;
        top: 8mm;
        left: 50%;
        transform: translateX(-50%);
        width: 86mm;
        box-shadow: none;
        border-radius: 20px;
    }

    .kt-actions {
        display: none;
    }

    .kt-head,
    .kt-card {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}

.kv-page {
    padding: 24px;
    background: #eef1e7;
    min-height: calc(100vh - 80px);
}

.kv-sheet {
    max-width: 1500px;
    margin: 0 auto;
    background: #fffdf6;
    border: 2px solid #444;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.08);
    padding: 18px;
}

.kv-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.kv-btn {
    text-decoration: none;
    border-radius: 999px;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 800;
    border: 1px solid #d8dfd0;
    background: #fff;
    color: #2e3a2a;
}

.kv-title {
    text-align: center;
    font-weight: 800;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.kv-title h2 {
    margin: 0;
    font-size: 24px;
}

.kv-title p {
    margin: 6px 0 0;
    font-size: 12px;
    color: #4f5a49;
    text-transform: uppercase;
}

.kv-grid-top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

.kv-box {
    border: 1px solid #555;
    background: #fff;
}

.kv-box-head {
    padding: 8px 10px;
    border-bottom: 1px solid #555;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 12px;
    text-align: center;
}

.kv-box-body {
    padding: 0;
}

.kv-table {
    width: 100%;
    border-collapse: collapse;
}

.kv-table th,
.kv-table td {
    border: 1px solid #666;
    padding: 6px 7px;
    font-size: 12px;
    vertical-align: top;
}

.kv-table th {
    font-size: 11px;
    text-transform: uppercase;
    background: #f3f3ef;
}

.kv-total-row td {
    background: #f7f7ef;
    font-weight: 800;
}

.kv-subgrid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

.kv-highlight {
    outline: 3px solid #f0d85a;
    outline-offset: -3px;
    background: #fffbe4;
}

.kv-rich p {
    margin: 0 0 8px;
}

.kv-operator-list {
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.7;
}

@media print {
    body * {
        visibility: hidden;
    }

    .kv-sheet,
    .kv-sheet * {
        visibility: visible;
    }

    .kv-sheet {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        box-shadow: none;
    }

    .kv-toolbar {
        display: none;
    }
}

@media (max-width: 1200px) {

    .kv-grid-top,
    .kv-subgrid {
        grid-template-columns: 1fr;
    }
}

.ef-page {
    padding: 8px 0 40px;
    font-family: var(--font-main);
}

/* Form panel container */
.kl-form {
    background: #fff;
    border: 1px solid #d8ecd4;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(47, 97, 48, 0.07);
    max-width: 650px;
    margin: 0 auto;
}

/* Form header */
.kl-form-head {
    background: #1c7a39;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.kl-form-head h3 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
}

.kl-form-head p {
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.78);
    margin: 4px 0 0;
}

.kl-form-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #fff;
    flex-shrink: 0;
}

/* Form body */
.kl-form-body {
    padding: 24px;
}

/* Fields */
.kl-field {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.kl-field:last-child {
    margin-bottom: 0;
}

.kl-field label {
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    color: #3d5e3f;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 6px;
}

.kl-field label span.req {
    color: #d93025;
    margin-left: 1px;
}

/* Input elements override global big sizes */
.kl-field input:not([type="checkbox"]),
.kl-field select,
.kl-field textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1.5px solid #d1e8cc;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #1b2d20;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.kl-field input:not([type="checkbox"]):focus,
.kl-field select:focus,
.kl-field textarea:focus {
    border-color: #1c7a39;
    box-shadow: 0 0 0 3px rgba(28, 122, 57, 0.12);
}

.kl-field input::placeholder {
    color: #b0c8b0;
    font-weight: 500;
}

.kl-field input.is-invalid,
.kl-field select.is-invalid,
.kl-field textarea.is-invalid {
    border-color: #d93025;
}

/* Errors */
.kl-error {
    font-size: 0.72rem;
    color: #d93025;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
}

/* Form footer */
.kl-form-footer {
    padding: 16px 24px;
    border-top: 1px solid #e8f3e4;
    background: #f8faf7;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Buttons */
.kl-btn-submit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #1c7a39;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 10px 22px;
    cursor: pointer;
    transition: opacity 0.2s;
    box-shadow: 0 4px 14px rgba(47, 97, 48, 0.25);
}

.kl-btn-submit:hover {
    opacity: 0.88;
}

.kl-btn-cancel {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #fff;
    color: #6b7280;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 9px 18px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.kl-btn-cancel:hover {
    background: #f3f4f6;
    color: #374151;
}

@media (max-width: 768px) {
    .kl-form {
        margin: 0 12px;
    }
}

/* ═══════════════════════════ DESTONE ADD FORM ═══════════════════════════ */

/* PAGE HEADER */
.ds-add-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.ds-add-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #fff;
    color: #2f6130;
    border: 1.5px solid #a3d9a5;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 9px 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

.ds-add-back-btn:hover {
    background: #f0f8ed;
    color: #2f6130;
}

.ds-add-header-title {
    flex: 1;
}

.ds-add-header-title h2 {
    font-size: 1.25rem;
    font-weight: 900;
    color: #0f2018;
    margin: 0 0 3px;
}

.ds-add-header-title p {
    font-size: 0.74rem;
    color: #7a9480;
    margin: 0;
}

.ds-stage-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #1c7a39;
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 0.74rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
}

/* FORM CARD */
.ds-add-card {
    background: #fff;
    border: 1px solid #d8ecd4;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(47, 97, 48, 0.07);
}

.ds-add-card-head {
    background: #1c7a39;
    padding: 18px 26px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ds-add-card-head h3 {
    font-size: 0.98rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
}

.ds-add-card-head p {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.78);
    margin: 4px 0 0;
}

.ds-add-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #fff;
    flex-shrink: 0;
}

.ds-add-card-body {
    padding: 26px;
}

/* SECTION DIVIDER */
.ds-form-section {
    margin-bottom: 24px;
}

.ds-form-section-label {
    font-size: 0.62rem;
    font-weight: 800;
    color: #9aba91;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ds-form-section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5f0e0;
}

/* FORM GRID */
.ds-fg-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.ds-fg-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.ds-fg-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.ds-fg-1 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

@media (max-width: 900px) {
    .ds-fg-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .ds-fg-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {

    .ds-fg-4,
    .ds-fg-3,
    .ds-fg-2 {
        grid-template-columns: 1fr;
    }
}

/* FIELD */
.ds-field label {
    display: block;
    font-size: 0.68rem;
    font-weight: 800;
    color: #3d5e3f;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 6px;
}

.ds-field input,
.ds-field select,
.ds-field textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1.5px solid #d1e8cc;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.84rem;
    font-weight: 600;
    color: #1b2d20;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    appearance: auto;
}

.ds-field input:focus,
.ds-field select:focus,
.ds-field textarea:focus {
    border-color: #4a824e;
    box-shadow: 0 0 0 3px rgba(47, 97, 48, 0.12);
}

.ds-field input::placeholder {
    color: #b0c8b0;
    font-weight: 500;
}

/* OUTPUT FIELD SPECIAL STYLE */
.ds-field.output-field input {
    background: #f0f9f0;
    border-color: #a3d9a5;
    font-weight: 800;
    color: #2f6130;
}

.ds-field.output-field input:focus {
    border-color: #2f6130;
    box-shadow: 0 0 0 3px rgba(47, 97, 48, 0.15);
}

.ds-field.readonly-field input,
.ds-bag-table input[readonly] {
    background: #f4f8f2;
    color: #4d674d;
    border-color: #dcebd8;
}

.output-hint {
    font-size: 0.62rem;
    color: #7a9480;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ds-bag-table-wrap {
    border: 1px solid #e0eedc;
    border-radius: 12px;
    overflow-x: auto;
    background: #fff;
}

.ds-bag-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 860px;
}

.ds-bag-table th {
    padding: 10px 12px;
    background: #f5faf3;
    color: #789475;
    font-size: 0.6rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: left;
    border-bottom: 1px solid #e0eedc;
}

.ds-bag-table td {
    padding: 9px 12px;
    border-bottom: 1px solid #edf5ea;
}

.ds-bag-table tr:last-child td {
    border-bottom: none;
}

.ds-bag-table input {
    width: 100%;
    min-width: 92px;
    box-sizing: border-box;
    border: 1.5px solid #d1e8cc;
    border-radius: 9px;
    padding: 8px 10px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #1b2d20;
    outline: none;
}

.ds-bag-table .output-cell input {
    background: #f0f9f0;
    border-color: #a3d9a5;
    color: #2f6130;
}

.ds-empty-lot {
    border: 1px dashed #bdd9b7;
    border-radius: 12px;
    padding: 22px;
    text-align: center;
    color: #7a9480;
    font-size: 0.78rem;
    font-weight: 700;
    background: #f9fcf8;
}

/* FORM FOOTER */
.ds-add-footer {
    padding: 18px 26px;
    border-top: 1px solid #e8f3e4;
    background: #f8faf7;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.ds-btn-cancel {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #fff;
    color: #6b7280;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.ds-btn-cancel:hover {
    background: #f3f4f6;
    color: #374151;
}

.ds-btn-submit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #1c7a39;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 11px 24px;
    cursor: pointer;
    transition: opacity 0.2s;
    box-shadow: 0 4px 14px rgba(47, 97, 48, 0.28);
}

.ds-btn-submit:hover {
    opacity: 0.88;
}


/* ═══════════════════════════ DESTONE INDEX ═══════════════════════════ */
.ds-hub-hero {
    background: #1c7a39;
    border-radius: 16px;
    padding: 22px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.ds-hub-hero::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    pointer-events: none;
}

.ds-hub-hero-copy h2 {
    font-size: 1.3rem;
    font-weight: 900;
    color: #fff;
    line-height: 1.2;
    margin: 0 0 6px;
}

.ds-hub-hero-copy p {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.82);
    margin: 0;
}

.ds-hub-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 0.74rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    backdrop-filter: blur(4px);
}

/* METRICS */
.ds-hub-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.ds-hub-metric {
    background: #fff;
    border: 1px solid #d8ecd4;
    border-radius: 13px;
    padding: 15px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.ds-hub-metric:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(47, 97, 48, 0.1);
}

.ds-hub-metric-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #1c7a39;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #fff;
    flex-shrink: 0;
}

.ds-hub-metric-label {
    font-size: 0.6rem;
    font-weight: 800;
    color: #7a9480;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    margin-bottom: 3px;
}

.ds-hub-metric-value {
    font-size: 1.3rem;
    font-weight: 900;
    color: #0f2018;
}

/* TABS */
.ds-source-tabs {
    display: flex;
    gap: 0;
    background: #fff;
    border: 1px solid #d8ecd4;
    border-radius: 14px;
    padding: 6px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(47, 97, 48, 0.05);
}

.ds-source-tab {
    flex: 1;
    padding: 14px 16px;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    border: 1.5px solid transparent;
    background: transparent;
    transition: all 0.22s;
    text-decoration: none;
    display: block;
}

.ds-source-tab:hover {
    background: #f0f8ed;
    border-color: #c8e6c0;
}

.ds-source-tab.active {
    background: #1c7a39;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(47, 97, 48, 0.28);
}

.ds-source-tab .tab-name {
    display: block;
    font-size: 0.88rem;
    font-weight: 800;
    color: #0f2018;
    transition: color 0.2s;
}

.ds-source-tab.active .tab-name {
    color: #fff;
}

.ds-source-tab .tab-desc {
    display: block;
    font-size: 0.64rem;
    color: #7a9480;
    margin-top: 3px;
    transition: color 0.2s;
}

.ds-source-tab.active .tab-desc {
    color: rgba(255, 255, 255, 0.7);
}

/* TABLE PANEL */
.ds-hub-panel {
    background: #fff;
    border: 1px solid #d8ecd4;
    border-radius: 14px;
    padding: 20px 22px;
}

.ds-hub-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.ds-hub-panel-title {
    font-size: 0.88rem;
    font-weight: 800;
    color: #0f2018;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ds-hub-stripe {
    width: 3px;
    height: 18px;
    border-radius: 4px;
    background: #1c7a39;
}

.ds-hub-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 11px 20px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
    text-decoration: none;
}

.ds-hub-add-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
    color: #fff;
}

.ds-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #fff;
    color: #2f6130;
    border: 1.5px solid #a3d9a5;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 9px 16px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.ds-btn-secondary:hover {
    background: #f0f8ed;
    color: #2f6130;
}

.ds-hub-tbl-wrap {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid #e5f0e0;
}

.ds-hub-tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.76rem;
}

.ds-hub-tbl thead th {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: #9aba91;
    padding: 10px 12px;
    text-align: left;
    border-bottom: 2px solid #e5f0e0;
    background: #f8faf7;
}

.ds-hub-tbl tbody tr:nth-child(odd) {
    background: #f8faf7;
}

.ds-hub-tbl tbody tr:nth-child(even) {
    background: #fff;
}

.ds-hub-tbl tbody tr:hover {
    background: #ecf5e9;
    transition: background 0.15s;
}

.ds-hub-tbl tbody td {
    padding: 10px 12px;
    color: #1b2d20;
    font-weight: 600;
    border-bottom: 1px solid #f0f5ee;
    vertical-align: middle;
}

/* BADGES & BUTTONS */
.lot-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 800;
}

.lot-report {
    background: #dcfce7;
    color: #15803d;
}

.tbl-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 7px;
    font-size: 0.64rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.18s;
    text-decoration: none;
}

.tbl-btn-view {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.tbl-btn-del {
    background: #fff0f0;
    color: #b74949;
    border: 1px solid #efcaca;
}

.tbl-btn-view:hover {
    background: #0369a1;
    color: #fff;
    border-color: transparent;
}

.tbl-btn-del:hover {
    background: #b74949;
    color: #fff;
    border-color: transparent;
}

.ds-tbl-empty {
    text-align: center;
    color: #9aba91;
    font-size: 0.76rem;
    padding: 40px 0;
}

/* OUTPUT VALUE */
.output-val {
    font-weight: 800;
    color: #2f6130;
}


/* ═══════════════════════ DESTONE REGISTER ═══════════════════════ */

.ds-view-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.ds-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #fff;
    color: #2F7A33;
    border: 1.5px solid #8AAB80;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 9px 14px;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.ds-back-btn:hover {
    background: #f0f8ed;
    color: #2F7A33;
}

.ds-view-header-title {
    flex: 1;
}

.ds-view-header-title h2 {
    font-size: 1.25rem;
    font-weight: 900;
    color: #0f2018;
    margin: 0 0 3px;
}

.ds-view-header-title p {
    font-size: 0.74rem;
    color: #7a9480;
    margin: 0;
}

.ds-stage-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #2F7A33;
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 0.74rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
}

/* ── SUMMARY STRIP ── */
.ds-summary-strip {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.ds-summary-card {
    background: #fff;
    border: 1px solid #d8ecd4;
    border-radius: 13px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.ds-summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(47, 122, 51, 0.1);
}

.ds-summary-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #2F7A33;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.88rem;
    color: #fff;
    flex-shrink: 0;
}

.ds-summary-label {
    font-size: 0.58rem;
    font-weight: 800;
    color: #7a9480;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    margin-bottom: 2px;
}

.ds-summary-val {
    font-size: 1.1rem;
    font-weight: 900;
    color: #0f2018;
}

.ds-summary-unit {
    font-size: 0.56rem;
    color: #9aba91;
    margin-left: 2px;
}

/* ── FILTER BAR ── */
.ds-filter-bar {
    background: #fff;
    border: 1px solid #d8ecd4;
    border-radius: 13px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.ds-filter-bar label {
    font-size: 0.64rem;
    font-weight: 800;
    color: #3d5e3f;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-right: -6px;
}

.ds-filter-bar input,
.ds-filter-bar select {
    border: 1.5px solid #d1e8cc;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 0.76rem;
    font-weight: 600;
    color: #1b2d20;
    background: #f8faf7;
    outline: none;
    transition: border-color 0.2s;
}

.ds-filter-bar input:focus,
.ds-filter-bar select:focus {
    border-color: #2F7A33;
}

.ds-filter-apply {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #2F7A33;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 8px 16px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.ds-filter-apply:hover {
    opacity: 0.88;
}

.ds-filter-reset {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    color: #6b7280;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 8px 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.ds-filter-reset:hover {
    background: #f3f4f6;
    color: #374151;
}

/* ── PRINT BTN ── */
.ds-print-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #fff;
    color: #2F7A33;
    border: 1.5px solid #8AAB80;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 9px 14px;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.ds-print-btn:hover {
    background: #f0f8ed;
}

/* ── TOGGLE BUTTONS ── */
.ds-view-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.ds-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    border: 1.5px solid #8AAB80;
    background: #fff;
    color: #2F7A33;
    transition: all 0.18s;
}

.ds-toggle-btn.active,
.ds-toggle-btn:hover {
    background: #2F7A33;
    color: #fff;
    border-color: #2F7A33;
}

/* ════════════════════════════════════════════════
   REGISTER SHEET — mimics physical blue register
   ════════════════════════════════════════════════ */
.register-section {
    margin-bottom: 32px;
}

.register-sheet {
    border: 2px solid #1a4fcb;
    border-radius: 4px;
    overflow: hidden;
    font-family: Arial, Helvetica, sans-serif;
    background: #ffffff;
    margin-bottom: 24px;
}

.reg-header {
    display: grid;
    grid-template-columns: 1fr auto;
    border-bottom: 2px solid #1a4fcb;
}

.reg-header-left {
    padding: 10px 14px;
    border-right: 2px solid #1a4fcb;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.reg-company-name {
    font-size: 1.05rem;
    font-weight: 900;
    color: #0a1a6e;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: center;
    width: 100%;
}

.reg-header-divider {
    width: 100%;
    border: none;
    border-top: 1.5px solid #1a4fcb;
    margin: 6px 0;
}

.reg-report-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #1a4fcb;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: center;
    width: 100%;
    font-family: Poppins;
}

.reg-header-right {
    display: flex;
    flex-direction: column;
    min-width: 180px;
}

.reg-meta-row {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    gap: 8px;
    border-bottom: 1px solid #1a4fcb;
}

.reg-meta-row:last-child {
    border-bottom: none;
}

.reg-meta-label {
    font-size: 0.65rem;
    font-weight: 900;
    text-transform: uppercase;
    color: #0a1a6e;
    letter-spacing: 0.07em;
    min-width: 38px;
    font-family: Poppins;
}

.reg-meta-val {
    font-size: 0.78rem;
    font-weight: 700;
    color: #1a4fcb;
    border-bottom: 1px solid #1a4fcb;
    min-width: 80px;
    padding-bottom: 1px;
    font-family: Poppins;
}

.reg-col-headers {
    display: grid;
    grid-template-columns: 82px 105px 105px 76px 76px 76px 68px 68px 68px;
    background: #dbeeff;
    border-bottom: 2px solid #1a4fcb;
}

.reg-col-hdr {
    padding: 6px 8px;
    font-size: 0.6rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #0a1a6e;
    text-align: center;
    border-right: 1px solid #1a4fcb;
    font-family: Poppins;
}

.reg-col-hdr:last-child {
    border-right: none;
}

.reg-data-row {
    display: grid;
    grid-template-columns: 82px 105px 105px 76px 76px 76px 68px 68px 68px;
    border-bottom: 1px solid #a3c4f5;
    min-height: 30px;
}

.reg-data-row:nth-child(even) {
    background: #f4f8ff;
}

.reg-data-row:last-child {
    border-bottom: none;
}

.reg-cell {
    padding: 6px 8px;
    font-size: 0.76rem;
    font-weight: 600;
    color: #1b2d20;
    border-right: 1px solid #a3c4f5;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    font-family: Poppins;
}

.reg-cell:first-child {
    justify-content: flex-start;
}

.reg-cell:last-child {
    border-right: none;
}

.reg-total-row {
    display: grid;
    grid-template-columns: 82px 105px 105px 76px 76px 76px 68px 68px 68px;
    border-top: 2px solid #1a4fcb;
    background: #dbeeff;
    min-height: 30px;
}

.reg-total-cell {
    padding: 6px 8px;
    font-size: 0.72rem;
    font-weight: 900;
    color: #0a1a6e;
    border-right: 1px solid #1a4fcb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reg-total-cell:first-child {
    justify-content: flex-start;
}

.reg-total-cell:last-child {
    border-right: none;
}

.reg-grade-pill {
    display: inline-block;
    background: #dbeeff;
    color: #0a1a6e;
    border: 1px solid #a3c4f5;
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 0.62rem;
    font-weight: 800;
    font-family: Poppins;
}

.reg-empty-row .reg-cell {
    color: #e0e8f0;
    font-size: 0.6rem;
}

/* ── TABLE VIEW ── */
.ds-view-panel {
    background: #fff;
    border: 1px solid #d8ecd4;
    border-radius: 14px;
    overflow: hidden;
}

.ds-view-panel-head {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e5f0e0;
    background: #f8faf7;
}

.ds-view-panel-title {
    font-size: 0.88rem;
    font-weight: 800;
    color: #0f2018;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ds-hub-stripe {
    width: 3px;
    height: 18px;
    border-radius: 4px;
    background: #2F7A33;
}

.ds-row-count {
    font-size: 0.68rem;
    font-weight: 700;
    color: #7a9480;
    background: #e8f3e4;
    border: 1px solid #c8e6c0;
    border-radius: 999px;
    padding: 3px 10px;
}

.ds-hub-tbl-wrap {
    overflow-x: auto;
}

.ds-hub-tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.76rem;
}

.ds-hub-tbl thead th {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: #9aba91;
    padding: 10px 12px;
    text-align: left;
    border-bottom: 2px solid #e5f0e0;
    background: #f8faf7;
    white-space: nowrap;
}

.ds-hub-tbl tbody tr {
    transition: background 0.12s;
}

.ds-hub-tbl tbody tr:nth-child(odd) {
    background: #f8faf7;
}

.ds-hub-tbl tbody tr:nth-child(even) {
    background: #fff;
}

.ds-hub-tbl tbody tr:hover {
    background: #ecf5e9;
}

.ds-hub-tbl tbody tr.highlighted {
    background: #fffbe6 !important;
    outline: 2px solid #f59e0b;
}

.ds-hub-tbl tbody td {
    padding: 10px 12px;
    color: #1b2d20;
    font-weight: 600;
    border-bottom: 1px solid #f0f5ee;
    vertical-align: middle;
    white-space: nowrap;
}

.lot-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 800;
}

.lot-report {
    background: #dcfce7;
    color: #15803d;
}

.output-val {
    font-weight: 800;
    color: #2F7A33;
}

.shift-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 0.66rem;
    font-weight: 800;
}

.shift-a {
    background: #dbeafe;
    color: #1d4ed8;
}

.shift-b {
    background: #fef9c3;
    color: #a16207;
}

.shift-c {
    background: #fce7f3;
    color: #be185d;
}

.tbl-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 7px;
    font-size: 0.64rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.18s;
    text-decoration: none;
}

.tbl-btn-del {
    background: #fff0f0;
    color: #b74949;
    border: 1px solid #efcaca;
}

.tbl-btn-del:hover {
    background: #b74949;
    color: #fff;
    border-color: transparent;
}

.ds-hub-tbl tfoot td {
    padding: 10px 12px;
    font-size: 0.72rem;
    font-weight: 900;
    border-top: 2px solid #d8ecd4;
    background: #f0f8ed;
    color: #2F7A33;
}

.ds-tbl-empty {
    text-align: center;
    color: #9aba91;
    font-size: 0.76rem;
    padding: 40px 0;
}

/* ════════════════════════════════════════════════
   PRINT — JS physically moves #register-view onto
   <body> and hides everything else via JS.
   CSS here only handles colours, borders & layout.
   NO display:none rules — JS owns the hiding.
   ════════════════════════════════════════════════ */
@media print {

    body,
    html {
        background: #fff !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Force all colours through to print/PDF */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    /* Ensure register wrapper and sheets are visible & block */
    #ds-print-wrap {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    #register-view {
        display: block !important;
    }

    .register-sheet {
        display: block !important;
        border: 2px solid #1a4fcb !important;
        break-inside: avoid;
        margin-bottom: 18px;
        page-break-inside: avoid;
    }

    /* Layout display values for grid/flex elements */
    .reg-header {
        display: grid !important;
        border-bottom: 2px solid #1a4fcb !important;
    }

    .reg-header-left {
        display: flex !important;
        border-right: 2px solid #1a4fcb !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .reg-header-right {
        display: flex !important;
        flex-direction: column;
    }

    .reg-header-divider {
        display: block !important;
        border-top: 1.5px solid #1a4fcb !important;
        width: 100%;
    }

    .reg-meta-row {
        display: flex !important;
        border-bottom: 1px solid #1a4fcb !important;
    }

    .reg-col-headers {
        display: grid !important;
        background: #dbeeff !important;
        border-bottom: 2px solid #1a4fcb !important;
    }

    .reg-col-hdr {
        display: block !important;
        border-right: 1px solid #1a4fcb !important;
        color: #0a1a6e !important;
    }

    .reg-data-row {
        display: grid !important;
        border-bottom: 1px solid #a3c4f5 !important;
    }

    .reg-data-row:nth-child(even) {
        background: #f4f8ff !important;
    }

    .reg-cell {
        display: flex !important;
        border-right: 1px solid #a3c4f5 !important;
    }

    .reg-total-row {
        display: grid !important;
        background: #dbeeff !important;
        border-top: 2px solid #1a4fcb !important;
    }

    .reg-total-cell {
        display: flex !important;
        border-right: 1px solid #1a4fcb !important;
        color: #0a1a6e !important;
    }

    .reg-grade-pill {
        display: inline-block !important;
        background: #dbeeff !important;
        color: #0a1a6e !important;
        border: 1px solid #a3c4f5 !important;
    }

    .reg-company-name {
        color: #0a1a6e !important;
    }

    .reg-report-title {
        color: #1a4fcb !important;
    }

    .reg-meta-label {
        color: #0a1a6e !important;
    }

    .reg-meta-val {
        color: #1a4fcb !important;
        border-bottom: 1px solid #1a4fcb !important;
    }
}

.master-add-row {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 14px;
}

.master-table-card {
    margin-top: 18px;
    padding: 22px;
    border-radius: 18px;
}

.master-table-head {
    align-items: center;
    margin-bottom: 18px;
}

.master-table-head h3 {
    font-size: 1.05rem;
}

.master-table-head p {
    margin-top: 3px;
    font-size: 0.84rem;
}

.master-table-shell {
    border-radius: 12px;
    overflow: hidden;
}

.master-table {
    width: 100% !important;
    border-collapse: collapse;
    font-size: 0.72rem;
}

.master-table thead tr {
    background: #1c7a39;
}

.master-table th {
    padding: 11px 14px !important;
    color: #fff !important;
    text-align: left;
    font-size: 0.7rem !important;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    border: none;
}

.master-table tbody td {
    padding: 11px 14px !important;
    border-bottom: 1px solid #e8f5e8;
    color: #1a1a1a;
    vertical-align: middle !important;
}

.master-table tbody tr {
    transition: background 0.15s;
}

.master-table tbody tr:hover td {
    background: #f5fbf5;
}

.master-table tbody tr:last-child td {
    border-bottom: none;
}

.master-table tbody tr:nth-child(odd) td {
    background: #fdfefc;
}

.master-table tbody tr:nth-child(odd):hover td {
    background: #f5fbf5;
}

.master-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-start;
    align-items: center;
}

.master-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 9px !important;
    padding: 0 !important;
    font-size: 0.8rem;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-light.master-action-btn {
    background: #f0faf0;
    border: 1px solid #c8e6c8;
    color: #1c7a39;
}

.btn-light.master-action-btn:hover {
    background: #d4ecd4;
}

.btn-danger.master-action-btn {
    background: #fff;
    border: 1px solid #d1d5db;
    color: #6b7280;
}

.btn-danger.master-action-btn:hover {
    background: #f3f4f6;
}

.master-logo {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #d5e8cf;
    background: #f8fcf7;
}

.master-empty {
    text-align: center;
    color: var(--muted);
    padding: 24px !important;
    font-weight: 700;
}

.status-ready-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #dcfce7;
    color: #15803d;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
}

.status-hold-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fee2e2;
    color: #b91c1c;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
}

/* ─── DATATABLES WRAPPER ─── */
.dataTables_wrapper {
    padding: 0;
}

.master-dt-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 20px 16px;
    /* Added left/right padding to prevent stitching */
}

.master-dt-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px 0;
    /* Added left/right padding */
    border-top: 1px solid #edf6eb;
    margin-top: 4px;
}

.dataTables_wrapper .dataTables_length label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
}

.dataTables_wrapper .dataTables_length select {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid #d0e8d0;
    border-radius: 8px;
    padding: 6px 14px 6px 14px;
    font-size: 13px;
    color: #1b2d20;
    background-color: #fff;
    cursor: pointer;
    outline: none;
    min-width: 64px;
    text-align: center;
    transition: border-color 0.18s, box-shadow 0.18s;
}

.dataTables_wrapper .dataTables_length select:focus {
    border-color: #1c7a39;
    box-shadow: 0 0 0 3px rgba(28, 122, 57, 0.12);
}

.dataTables_wrapper .dataTables_filter label {
    position: relative;
    display: flex;
    align-items: center;
}

.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #d0e8d0;
    border-radius: 8px;
    /* Using SVG background for the search icon to avoid font issues */
    background: #fdfdfc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237aaa7a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E") no-repeat 12px center;
    padding: 8px 14px 8px 36px !important;
    /* Force padding to prevent text overlap */
    font-size: 0.78rem;
    outline: none;
    width: 260px;
    /* Made slightly wider for better UI */
    margin-left: 0;
    color: #1b2d20;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.dataTables_wrapper .dataTables_filter input::placeholder {
    color: #a8c8a8;
}

.dataTables_wrapper .dataTables_filter input:focus {
    background-color: #fff;
    border-color: #1c7a39;
    box-shadow: 0 0 0 3px rgba(28, 122, 57, 0.12);
}

.dataTables_wrapper .dataTables_info {
    font-size: 12.5px;
    color: #7a9480;
    font-weight: 500;
}

.dataTables_wrapper .dataTables_paginate {
    display: flex;
    gap: 6px;
    align-items: center;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center;
    gap: 6px;
    padding: 6px 14px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid #d0e8d0 !important;
    background: #fff !important;
    color: #8AAB80 !important;
    transition: all 0.15s;
    line-height: 1 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.current):not(.disabled) {
    background: #f0f8ec !important;
    border-color: #b8d8b0 !important;
    color: #1c7a39 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: #1c7a39 !important;
    border-color: #1c7a39 !important;
    color: #fff !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
    opacity: 0.5;
    cursor: not-allowed !important;
    background: #fff !important;
    color: #b3cbb3 !important;
    border-color: #d0e8d0 !important;
}

@media (max-width: 760px) {
    .master-table-head {
        align-items: stretch;
        flex-direction: column;
    }

    .master-add-row .btn {
        width: 100%;
    }

    .master-dt-top,
    .master-dt-bottom {
        align-items: stretch;
        flex-direction: column;
    }

    .dataTables_wrapper .dataTables_filter input {
        width: 100%;
        margin-left: 0;
    }
}

.kl-form {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
}

.kl-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #1c7a39;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 11px 20px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
    text-decoration: none;
}

.kl-add-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
    color: #fff;
}

/* kl-form structural elements */
.kl-form-head {
    background: #1c7a39;
    padding: 18px 26px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.kl-form-head h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
}

.kl-form-head p {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.78);
    margin: 4px 0 0;
}

.kl-form-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #fff;
    flex-shrink: 0;
}

.kl-form-body {
    padding: 26px;
}

.kl-form-section {
    margin-bottom: 24px;
}

.kl-form-section:last-child {
    margin-bottom: 0;
}

.kl-form-section-label {
    font-size: 0.65rem;
    font-weight: 800;
    color: #9aba91;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kl-form-section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5f0e0;
}

.kl-form-footer {
    padding: 18px 26px;
    border-top: 1px solid #e8f3e4;
    background: #f8faf7;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.kl-form-footer-hint {
    font-size: 0.76rem;
    color: #8aaa95;
    font-weight: 500;
}

.kl-form-footer-actions {
    display: flex;
    gap: 10px;
}

/* ── UNIFIED ACTION BUTTONS ── */
.kl-tbl-btn,
.tbl-btn,
.tbl-icon-btn,
.ef-btn-act {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 32px !important;
    height: 32px !important;
    border: 1px solid transparent !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
    padding: 0 8px !important;
    margin: 0 2px !important;
    gap: 6px !important;
    box-sizing: border-box !important;
}

.kl-tbl-btn:hover,
.tbl-btn:hover,
.tbl-icon-btn:hover,
.ef-btn-act:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06) !important;
}

/* View Button */
.kl-tbl-view,
.tbl-view,
.ef-btn-view,
.tbl-btn-view {
    background: #ecfdf5 !important;
    color: #047857 !important;
    border-color: #d1fae5 !important;
}

.kl-tbl-view:hover,
.tbl-view:hover,
.ef-btn-view:hover,
.tbl-btn-view:hover {
    background: #d1fae5 !important;
    border-color: #a7f3d0 !important;
}

/* Edit Button */
.kl-tbl-edit,
.tbl-edit,
.ef-btn-edit,
.tbl-btn-edit {
    background: #dcfce7 !important;
    color: #15803d !important;
    border-color: #bbf7d0 !important;
}

.kl-tbl-edit:hover,
.tbl-edit:hover,
.ef-btn-edit:hover,
.tbl-btn-edit:hover {
    background: #bbf7d0 !important;
    border-color: #86efac !important;
}

/* Delete Button */
.kl-tbl-del,
.tbl-del,
.ef-btn-del,
.tbl-btn-del {
    background: #fef2f2 !important;
    color: #b91c1c !important;
    border-color: #fecaca !important;
}

.kl-tbl-del:hover,
.tbl-del:hover,
.ef-btn-del:hover,
.tbl-btn-del:hover {
    background: #fee2e2 !important;
    border-color: #fca5a5 !important;
}

/* Print Button */
.kl-tbl-print,
.tbl-print,
.ef-btn-print,
.tbl-btn-print {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
    border-color: #bfdbfe !important;
}

.kl-tbl-print:hover,
.tbl-print:hover,
.ef-btn-print:hover,
.tbl-btn-print:hover {
    background: #dbeafe !important;
    border-color: #93c5fd !important;
}

/* ── PROFILE VIEW STYLES ── */
.profile-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    padding: 0 10px;
}

.profile-page-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1a2e1b;
    margin: 0 0 6px 0;
}

.profile-page-subtitle {
    font-size: 0.8rem;
    color: #6b8a70;
    margin: 0;
}

.profile-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.profile-edit-btn {
    background: #fff;
    border: 1px solid #c5dcc0;
    color: #2F7A33;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.8rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.profile-edit-btn:hover {
    background: #f2f7f3;
    border-color: #8AAB80;
}

.profile-close-btn {
    color: #8AAB80;
    font-size: 1.2rem;
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.profile-close-btn:hover {
    color: #1a2e1b;
}

.profile-main-card {
    background: #fff;
    border: 1px solid #e8f0e9;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.profile-main-layout {
    display: flex;
    gap: 40px;
}

.profile-user-col {
    display: flex;
    gap: 20px;
    align-items: center;
    min-width: 300px;
    padding-right: 40px;
    border-right: 1px solid #e8f0e9;
}

.profile-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--green);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    overflow: hidden;
    flex-shrink: 0;
}

.profile-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-name {
    font-size: 1.3rem;
    font-weight: 800;
    color: #1a2e1b;
    margin: 0;
}

.profile-role-badge {
    font-size: 0.75rem;
    font-weight: 700;
    color: #2F7A33;
    margin-bottom: 6px;
}

.profile-contact-line {
    font-size: 0.8rem;
    color: #4a6650;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.profile-contact-line i {
    width: 14px;
    text-align: center;
    opacity: 0.7;
}

.profile-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px 60px;
    flex: 1;
}

.profile-detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.p-label {
    font-size: 0.7rem;
    color: #8AAB80;
    font-weight: 600;
}

.p-value {
    font-size: 0.85rem;
    color: #1a2e1b;
    font-weight: 700;
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.p-stat-card {
    background: #fff;
    border: 1px solid #e8f0e9;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.p-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #f2f7f3;
    color: #2F7A33;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.p-stat-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.p-stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b8a70;
}

.p-stat-value {
    font-size: 1.2rem;
    font-weight: 800;
    color: #1a2e1b;
    line-height: 1.1;
}

.p-stat-sub {
    font-size: 0.65rem;
    color: #8AAB80;
}

.p-status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    background: #f2f7f3;
    color: #6b8a70;
}

.p-status-badge.active {
    background: #eaf3e5;
    color: #2F7A33;
}

/* ── PROFILE EDIT STYLES ── */
.profile-edit-header {
    background: var(--green);
    color: #fff;
    padding: 24px;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 10px;
}

.profile-edit-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.profile-edit-title {
    color: white;
    font-size: 1.2rem;
    font-weight: 800;
    margin: 0 0 4px 0;
}

.profile-edit-subtitle {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

.profile-edit-body {
    background: #fff;
    border: 1px solid #e8f0e9;
    border-top: none;
    padding: 32px 40px;
}

.profile-section-title {
    font-size: 0.75rem;
    font-weight: 800;
    color: #8AAB80;
    letter-spacing: 0.05em;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
}

.profile-section-title i {
    font-size: 0.9rem;
}

.profile-section-divider {
    height: 1px;
    background: #f0f4f1;
    margin: 32px 0;
}

.profile-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.profile-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-form-group label {
    font-size: 0.7rem;
    font-weight: 800;
    color: #4a6650;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.profile-form-group label span {
    color: #d93025;
}

.profile-input {
    width: 100%;
    border: 1px solid #c5dcc0;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.85rem;
    font-family: inherit;
    color: #1a2e1b;
    font-weight: 600;
    outline: none;
    transition: border-color 0.2s;
}

.profile-input:focus {
    border-color: var(--green);
}

.profile-disabled {
    background: #f8faf7;
    color: #6b8a70;
    cursor: not-allowed;
    border-color: #e8f0e9;
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    padding-right: 40px;
}

.pw-toggle {
    position: absolute;
    right: 14px;
    color: #8AAB80;
    cursor: pointer;
}

.profile-input-help {
    font-size: 0.65rem;
    color: #8AAB80;
}

.profile-file-input-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid #e8f0e9;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.profile-file-input {
    display: none;
}

.profile-file-btn {
    background: #f8faf7;
    border-right: 1px solid #e8f0e9;
    padding: 10px 20px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #4a6650;
    cursor: pointer;
    transition: background 0.2s;
    margin: 0;
}

.profile-file-btn:hover {
    background: #eaf3e5;
    color: var(--green);
}

.profile-file-text {
    padding: 0 16px;
    font-size: 0.85rem;
    color: #8AAB80;
    font-weight: 500;
}

.profile-current-img-preview {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    margin-top: 10px;
    border: 2px solid #eaf3e5;
}

.profile-current-img-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-edit-footer {
    background: #f8faf7;
    border: 1px solid #e8f0e9;
    border-top: none;
    border-radius: 0 0 12px 12px;
    padding: 20px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.profile-footer-text {
    font-size: 0.75rem;
    color: #8AAB80;
    font-weight: 500;
}

.profile-footer-actions {
    display: flex;
    gap: 12px;
}

.profile-btn-cancel {
    background: #fff;
    border: 1px solid #e8f0e9;
    color: #4a6650;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.profile-btn-cancel:hover {
    background: #f8faf7;
    color: #1a2e1b;
}

.profile-btn-save {
    background: var(--green);
    border: none;
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.profile-btn-save:hover {
    background: #14532d;
}

@media (max-width: 900px) {
    .profile-main-layout {
        flex-direction: column;
        gap: 24px;
    }

    .profile-user-col {
        border-right: none;
        border-bottom: 1px solid #e8f0e9;
        padding-right: 0;
        padding-bottom: 24px;
        min-width: auto;
    }

    .profile-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .profile-form-grid {
        grid-template-columns: 1fr;
    }

    .profile-edit-footer {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
}

/* ==============================================================
   RESPONSIVE BREAKPOINTS (Device Specific)
   ============================================================== */

/* Mobile Small (320x568) */
@media (max-width: 320px) {
    .app-shell {
        display: block !important;
    }

    .sidebar {
        position: fixed !important;
        z-index: 1045 !important;
        width: 260px !important;
        background: #f8fcf7 !important;
    }

    .sidebar:not(.show) {
        visibility: hidden !important;
    }

    .main {
        padding: 10px;
    }

    .topbar-wrapper {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        padding: 10px 12px;
    }

    .topbar-title {
        font-size: 1.1rem;
    }

    .user-info {
        display: none !important;
    }

    .user-profile-pill {
        padding: 6px;
        border-radius: 50%;
    }

    .hero-copy h2 {
        font-size: 1.3rem;
    }

    .hero-chips,
    .stats-grid,
    .cards-grid,
    .form-grid,
    .form-grid-3,
    .flow-grid {
        grid-template-columns: 1fr;
    }

    .kl-form-footer {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 16px;
        padding: 16px;
    }

    .kl-form-footer-actions {
        flex-direction: column;
        width: 100%;
    }

    .kl-form-footer-actions>* {
        width: 100% !important;
        justify-content: center;
    }
}

/* Mobile Medium (375x667) */
@media (min-width: 321px) and (max-width: 375px) {
    .app-shell {
        display: block !important;
    }

    .sidebar {
        position: fixed !important;
        z-index: 1045 !important;
        width: 260px !important;
        background: #f8fcf7 !important;
    }

    .sidebar:not(.show) {
        visibility: hidden !important;
    }

    .main {
        padding: 12px;
    }

    .topbar-wrapper {
        flex-direction: row;
        align-items: center;
        gap: 10px;
        padding: 12px 14px;
    }

    .topbar-title {
        font-size: 1.2rem;
    }

    .user-info {
        display: none !important;
    }

    .user-profile-pill {
        padding: 6px;
        border-radius: 50%;
    }

    .hero-copy h2 {
        font-size: 1.4rem;
    }

    .hero-chips,
    .stats-grid,
    .cards-grid,
    .form-grid,
    .form-grid-3,
    .flow-grid {
        grid-template-columns: 1fr;
    }

    .kl-form-footer {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 16px;
        padding: 16px;
    }

    .kl-form-footer-actions {
        flex-direction: column;
        width: 100%;
    }

    .kl-form-footer-actions>* {
        width: 100% !important;
        justify-content: center;
    }
}

/* Mobile Large (414x896) */
@media (min-width: 376px) and (max-width: 414px) {
    .app-shell {
        display: block !important;
    }

    .sidebar {
        position: fixed !important;
        z-index: 1045 !important;
        width: 260px !important;
        background: #f8fcf7 !important;
    }

    .sidebar:not(.show) {
        visibility: hidden !important;
    }

    .main {
        padding: 14px;
    }

    .topbar-wrapper {
        flex-direction: row;
        align-items: center;
        gap: 12px;
        padding: 14px 16px;
    }

    .topbar-title {
        font-size: 1.3rem;
    }

    .user-info {
        display: none !important;
    }

    .user-profile-pill {
        padding: 6px;
        border-radius: 50%;
    }

    .hero-copy h2 {
        font-size: 1.5rem;
    }

    .hero-chips,
    .stats-grid,
    .cards-grid,
    .form-grid,
    .form-grid-3,
    .flow-grid {
        grid-template-columns: 1fr;
    }

    .kl-form-footer {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 16px;
        padding: 16px;
    }

    .kl-form-footer-actions {
        flex-direction: column;
        width: 100%;
    }

    .kl-form-footer-actions>* {
        width: 100% !important;
        justify-content: center;
    }
}

/* Tablet Portrait (768x1024) */
@media (min-width: 415px) and (max-width: 768px) {
    .app-shell {
        display: block !important;
    }

    .sidebar {
        position: fixed !important;
        z-index: 1045 !important;
        width: 300px !important;
        background: #f8fcf7 !important;
    }

    .sidebar:not(.show) {
        visibility: hidden !important;
    }

    .main {
        padding: 16px;
    }

    .hero-chips {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .split-grid,
    .panel-grid {
        grid-template-columns: 1fr;
    }

    .form-grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .kl-form-footer {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 16px;
        padding: 16px;
    }

    .kl-form-footer-actions {
        flex-direction: column;
        width: 100%;
    }

    .kl-form-footer-actions>* {
        width: 100% !important;
        justify-content: center;
    }
}

/* Tablet Landscape (991x768) */
@media (min-width: 769px) and (max-width: 991px) {
    .app-shell {
        display: block !important;
    }

    .sidebar {
        position: fixed !important;
        z-index: 1045 !important;
        width: 300px !important;
        background: #f8fcf7 !important;
    }

    .sidebar:not(.show) {
        visibility: hidden !important;
    }

    .main {
        padding: 20px;
    }

    .hero-chips {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .split-grid,
    .panel-grid {
        grid-template-columns: 1fr;
    }

    .form-grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Laptop Small (1366x768) */
@media (min-width: 992px) and (max-width: 1366px) {
    .app-shell {
        grid-template-columns: 280px 1fr;
    }

    .hero-copy h2 {
        font-size: 1.8rem;
    }

    .stats-grid,
    .cards-grid,
    .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Laptop Medium (1440x900) */
@media (min-width: 1367px) and (max-width: 1440px) {
    .app-shell {
        grid-template-columns: 300px minmax(0, 1fr);
    }
}

/* Desktop (1920x1080) */
@media (min-width: 1441px) {
    .app-shell {
        grid-template-columns: 320px minmax(0, 1fr);
    }
}

/* Status Widget */
.status-widget {
    display: inline-flex;
    border-radius: 6px;
    overflow: hidden;
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1;
    align-items: stretch;
    border: 1px solid transparent;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-widget-label {
    background: #f8fafc;
    color: #64748b;
    padding: 8px 10px;
    border-right: 1px solid transparent;
    display: flex;
    align-items: center;
}

.status-widget-value {
    position: relative;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 95px;
    justify-content: space-between;
}

/* Pending */
.status-widget-pending {
    border-color: #fde68a;
}

.status-widget-pending .status-widget-label {
    border-right-color: #fde68a;
}

.status-widget-pending .status-widget-value {
    background: #fffbeb;
    color: #f59e0b;
}

/* Approved */
.status-widget-approved {
    border-color: #bbf7d0;
}

.status-widget-approved .status-widget-label {
    border-right-color: #bbf7d0;
}

.status-widget-approved .status-widget-value {
    background: #f0fdf4;
    color: #10b981;
}

/* Rejected */
.status-widget-rejected {
    border-color: #fecaca;
}

.status-widget-rejected .status-widget-label {
    border-right-color: #fecaca;
}

.status-widget-rejected .status-widget-value {
    background: #fef2f2;
    color: #ef4444;
}

.status-widget-select {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

/* Simple Dropdown UI (GRN Style) */
.grn-status-select {
    padding: 6px 28px 6px 14px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 800;
    min-width: 120px;
    text-align: left;
    text-transform: uppercase;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: all 0.2s ease;
}

.grn-status-select.status-pending {
    background-color: #fffbeb;
    border: 1px solid #fde68a;
    color: #d97706;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d97706' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

.grn-status-select.status-approved {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23166534' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

.grn-status-select.status-rejected {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #ef4444;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ef4444' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

.grn-status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
    min-width: 100px;
    text-align: center;
}

.grn-status-badge.status-pending {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
}

.grn-status-badge.status-approved {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.grn-status-badge.status-rejected {
    background: #fef2f2;
    color: #ef4444;
    border: 1px solid #fecaca;
}