:root {
    --ap-forest: #14532d;
    --ap-forest-dark: #0b3a1f;
    --ap-green: #1c8b4f;
    --ap-green-light: #2fb86a;
    --ap-gold: #f0a824;
    --ap-gold-dark: #d68c0e;
    --ap-cream: #fffaf0;
    --ap-mint: #eafaf1;
    --ap-ink: #16281d;
    --ap-ink-soft: #4a5d51;
    --ap-danger: #d64545;
    --ap-shadow-soft: 0 20px 45px rgba(20, 83, 45, 0.14);
    --ap-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

body {
    background: linear-gradient(135deg, #e8f8f5, #d4efdf, #fcf3cf, #fef9e7);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    min-height: 100vh;
    margin: 0;
}

.page-public,
.page-auth {
    background: linear-gradient(135deg, #e8f8f5, #d4efdf, #fcf3cf, #fef9e7);
    color: #212529;
    overflow-x: hidden;
}

.page-public {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero {
    text-align: center;
    max-width: 900px;
    padding: 40px 20px;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 12px;
    color: #f8c146;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hero h2 {
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 25px;
    color: #343a40;
}

.hero p {
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 35px;
    color: #495057;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.btn-custom {
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-login {
    background: #28a745;
    color: #fff;
}

.btn-login:hover {
    background: #218838;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.btn-contact {
    background: #343a40;
    color: #fff;
}

.btn-contact:hover {
    background: #1d2124;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.login-card {
    max-width: 420px;
    width: 100%;
    background: #fff;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    padding: 40px 35px;
    color: #212529;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
}

.login-logo img {
    max-width: 150px;
    height: auto;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
}

.page-auth .form-control {
    background: #fff;
    border: 1px solid #ced4da;
    color: #212529;
    padding: 12px;
}

.page-auth .form-control:focus {
    background: #fff;
    border-color: #86b7fe;
    box-shadow: none;
    color: #212529;
}

.page-auth .form-control::placeholder {
    color: #6c757d;
}

.page-auth .input-group-text {
    background: #fff;
    border: 1px solid #ced4da;
    color: #6c757d;
    padding-left: 15px;
    padding-right: 15px;
}

.page-auth .text-white-50 {
    color: #6c757d !important;
}

.btn-login-solid {
    font-weight: 600;
    padding: 12px;
    background-color: #fff;
    color: #212529;
    border: none;
    transition: all 0.2s ease;
}

.btn-login-solid:hover {
    background-color: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
}

.transition-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.transition-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.15) !important;
}

.area-select {
    min-width: 160px;
}

.table-col-serial {
    width: 6%;
}

.table-col-actions {
    width: 12%;
}

.is-clickable {
    cursor: pointer;
}

.portfolio-modal {
    max-width: 550px;
}

.profile-avatar {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border: 3px solid #f8c146;
}

.skill-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.skill-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.1);
}

.portfolio-text {
    line-height: 1.6;
    color: #cbd5e1;
}

.progress-thin {
    height: 6px;
}

.progress-85 {
    width: 85%;
}

.progress-88 {
    width: 88%;
}

.progress-90 {
    width: 90%;
}

.portfolio-footnote {
    font-size: 0.75rem;
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.3rem;
    }

    .hero h2 {
        font-size: 1.2rem;
    }
}

/* ========================================================================
   AWAIS POULTRY — LOGIN SCREEN
   Theme: first light over the farm. Soft dawn gradient, drifting feather
   particles, an egg-yolk accent on the primary action.
   ======================================================================== */

.page-auth {
    background: radial-gradient(circle at 15% 20%, #eafaf1 0%, transparent 45%),
                radial-gradient(circle at 85% 15%, #fdf3d6 0%, transparent 50%),
                linear-gradient(150deg, #0f3d24 0%, #14532d 38%, #1c8b4f 72%, #2fb86a 100%);
    position: relative;
    overflow: hidden;
}

.auth-decor {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.auth-decor__glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.55;
    animation: apDrift 16s var(--ap-ease) infinite alternate;
}

.auth-decor__glow--1 {
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(240, 168, 36, 0.55), transparent 70%);
    top: -140px;
    left: -120px;
    animation-delay: 0s;
}

.auth-decor__glow--2 {
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, rgba(47, 184, 106, 0.5), transparent 70%);
    bottom: -160px;
    right: -100px;
    animation-delay: -6s;
}

.auth-decor__glow--3 {
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.35), transparent 70%);
    top: 45%;
    right: 8%;
    animation-delay: -3s;
}

@keyframes apDrift {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 40px) scale(1.12); }
}

.auth-decor__feather {
    position: absolute;
    opacity: 0.5;
    animation: apFeatherFall linear infinite;
}

@keyframes apFeatherFall {
    0% {
        transform: translateY(-10%) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% { opacity: 0.55; }
    90% { opacity: 0.4; }
    100% {
        transform: translateY(110vh) translateX(40px) rotate(200deg);
        opacity: 0;
    }
}

.auth-shell {
    position: relative;
    z-index: 1;
}

.login-card {
    max-width: 420px;
    width: 100%;
    background: #fff;
    border: 1px solid rgba(20, 83, 45, 0.08);
    border-radius: 20px;
    padding: 44px 38px;
    color: var(--ap-ink);
    box-shadow: var(--ap-shadow-soft), 0 2px 8px rgba(0, 0, 0, 0.06);
    position: relative;
    animation: apCardRise 0.7s var(--ap-ease) both;
}

.login-card::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: 21px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(240, 168, 36, 0.6), rgba(28, 139, 79, 0.15), transparent 60%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

@keyframes apCardRise {
    from { opacity: 0; transform: translateY(28px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo {
    animation: apFadeIn 0.6s var(--ap-ease) 0.1s both;
}

.login-logo img {
    max-width: 92px;
    height: auto;
    border-radius: 50%;
    box-shadow: 0 8px 24px rgba(20, 83, 45, 0.25), 0 0 0 6px rgba(240, 168, 36, 0.12);
    animation: apLogoPop 0.8s var(--ap-ease) 0.15s both;
}

@keyframes apLogoPop {
    0%   { opacity: 0; transform: scale(0.5) rotate(-8deg); }
    60%  { opacity: 1; transform: scale(1.08) rotate(3deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.login-logo h4 {
    color: var(--ap-forest);
    font-weight: 700;
    letter-spacing: 0.02em;
}

@keyframes apFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

#loginForm .mb-3,
#loginForm .mb-4 {
    animation: apFadeIn 0.5s var(--ap-ease) both;
}

#loginForm .mb-3 { animation-delay: 0.22s; }
#loginForm .mb-4 { animation-delay: 0.3s; }
#loginForm .btn-login-solid { animation: apFadeIn 0.5s var(--ap-ease) 0.38s both; }

.page-auth .form-control {
    background: #fbfdfb;
    border: 1.5px solid #dde7e1;
    color: var(--ap-ink);
    padding: 12px 14px;
    border-radius: 10px;
    transition: border-color 0.2s var(--ap-ease), box-shadow 0.2s var(--ap-ease), background 0.2s var(--ap-ease);
}

.page-auth .form-control:focus {
    background: #fff;
    border-color: var(--ap-green);
    box-shadow: 0 0 0 4px rgba(28, 139, 79, 0.13);
    color: var(--ap-ink);
}

.page-auth .form-control::placeholder {
    color: #93a29a;
}

.page-auth .input-group-text {
    background: #fbfdfb;
    border: 1.5px solid #dde7e1;
    border-left: none;
    color: #6c8579;
    padding-left: 15px;
    padding-right: 15px;
    border-radius: 0 10px 10px 0;
    transition: all 0.2s var(--ap-ease);
}

.page-auth .input-group:focus-within .input-group-text {
    border-color: var(--ap-green);
    color: var(--ap-green);
}

.page-auth .input-group:focus-within .form-control {
    border-right: none;
}

.page-auth .text-white-50 {
    color: var(--ap-ink-soft) !important;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-size: 0.72rem !important;
}

.btn-login-solid {
    font-weight: 700;
    padding: 13px;
    background: linear-gradient(135deg, var(--ap-gold), var(--ap-gold-dark));
    color: #1a1200;
    border: none;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.02em;
    transition: transform 0.18s var(--ap-ease), box-shadow 0.18s var(--ap-ease), filter 0.18s var(--ap-ease);
    box-shadow: 0 8px 20px rgba(214, 140, 14, 0.35);
}

.btn-login-solid:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(214, 140, 14, 0.45);
    filter: brightness(1.03);
    color: #1a1200;
}

.btn-login-solid:active:not(:disabled) {
    transform: translateY(0);
}

.btn-login-solid:disabled {
    opacity: 0.85;
    cursor: progress;
}

.btn-login-solid .btn-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(26, 18, 0, 0.25);
    border-top-color: #1a1200;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: -3px;
    animation: apSpin 0.7s linear infinite;
}

.btn-login-solid.is-loading .btn-spinner { display: inline-block; }
.btn-login-solid.is-loading .btn-label-icon { display: none; }

@keyframes apSpin {
    to { transform: rotate(360deg); }
}

.login-card.is-shaking {
    animation: apShake 0.45s ease;
}

@keyframes apShake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(3px); }
    30%, 50%, 70% { transform: translateX(-7px); }
    40%, 60% { transform: translateX(7px); }
}

#loginMsg .alert {
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    animation: apFadeIn 0.3s var(--ap-ease) both;
}

.is-clickable {
    cursor: pointer;
    transition: color 0.15s ease, transform 0.15s ease;
}

.is-clickable:active {
    transform: scale(0.9);
}

/* ========================================================================
   AWAIS POULTRY — DASHBOARD
   Theme: cards "hatch" into view; live counters roll up like a feed
   ticker. Icon roundels get a soft coloured glow that lifts on hover.
   ======================================================================== */

.dash-hero {
    animation: apFadeIn 0.5s var(--ap-ease) both;
}

.dash-hero h3 {
    color: var(--ap-forest);
}

.dash-hero .btn-outline-danger {
    border-radius: 10px;
    font-weight: 600;
    transition: transform 0.18s var(--ap-ease), box-shadow 0.18s var(--ap-ease), background 0.18s ease, color 0.18s ease;
}

.dash-hero .btn-outline-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(214, 69, 69, 0.25);
}

.hatch-in {
    opacity: 0;
    transform: translateY(22px) scale(0.96);
    animation: apHatchIn 0.6s var(--ap-ease) forwards;
}

@keyframes apHatchIn {
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.action-card {
    border-radius: 16px !important;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    transition: transform 0.3s var(--ap-ease), box-shadow 0.3s var(--ap-ease);
}

.action-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent 55%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.action-card:hover {
    transform: translateY(-8px) scale(1.015);
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.22) !important;
}

.action-card:hover::after {
    opacity: 1;
}

.action-card .fa-3x {
    transition: transform 0.35s var(--ap-ease);
    display: inline-block;
}

.action-card:hover .fa-3x {
    transform: scale(1.12) rotate(-4deg);
}

.action-card .card-title::after {
    content: "";
    display: block;
    width: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.85);
    margin: 8px auto 0;
    transition: width 0.3s var(--ap-ease);
}

.action-card:hover .card-title::after {
    width: 40%;
}

.stat-card {
    border-radius: 16px !important;
    transition: transform 0.3s var(--ap-ease), box-shadow 0.3s var(--ap-ease);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 28px rgba(20, 83, 45, 0.12) !important;
}

.stat-card .stat-icon-ring {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    margin-bottom: 14px;
    transition: transform 0.3s var(--ap-ease);
}

.stat-card:hover .stat-icon-ring {
    transform: scale(1.08) rotate(6deg);
}

.stat-icon-ring--success {
    background: radial-gradient(circle, rgba(28, 139, 79, 0.14), rgba(28, 139, 79, 0.03));
}

.stat-icon-ring--danger {
    background: radial-gradient(circle, rgba(214, 69, 69, 0.14), rgba(214, 69, 69, 0.03));
}

.stat-icon-ring .fa-3x {
    margin-bottom: 0 !important;
}

.stat-card .stat-value {
    font-variant-numeric: tabular-nums;
    transition: opacity 0.2s ease;
}

.stat-card .stat-value.is-loading {
    color: transparent;
    background: linear-gradient(90deg, #e9efec 25%, #f5f8f6 37%, #e9efec 63%);
    background-size: 400% 100%;
    animation: apShimmer 1.4s ease infinite;
    border-radius: 8px;
    display: inline-block;
    min-width: 64px;
}

@keyframes apShimmer {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

.export-card {
    border-radius: 16px !important;
    transition: transform 0.3s var(--ap-ease), box-shadow 0.3s var(--ap-ease);
}

.export-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 28px rgba(20, 83, 45, 0.12) !important;
}

.export-card .btn-success {
    border-radius: 10px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--ap-green-light), var(--ap-green));
    border: none;
    transition: transform 0.18s var(--ap-ease), box-shadow 0.18s var(--ap-ease);
}

.export-card .btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(28, 139, 79, 0.35);
}

.export-card .fa-file-excel {
    animation: apFloatIcon 3.2s ease-in-out infinite;
}

@keyframes apFloatIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* ========================================================================
   AWAIS POULTRY — BRAND PRELOADER
   Full-screen cover shown while the page and its assets are still
   arriving; a pulsing logo inside a spinning gold ring keeps it feeling
   alive rather than a stalled spinner.
   ======================================================================== */

#ap-preloader {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    background: radial-gradient(circle at 20% 20%, rgba(240, 168, 36, 0.18), transparent 45%),
                linear-gradient(150deg, #0f3d24 0%, #14532d 45%, #1c8b4f 100%);
    transition: opacity 0.45s ease, visibility 0.45s ease;
}

#ap-preloader.ap-preloader--hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.ap-preloader__brand-wrap {
    position: relative;
    width: 116px;
    height: 116px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ap-preloader__ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid rgba(240, 168, 36, 0.22);
    border-top-color: var(--ap-gold);
    animation: apSpin 1s linear infinite;
}

.ap-preloader__logo {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    animation: apPulseLogo 1.3s ease-in-out infinite;
    overflow: hidden;
}

.ap-preloader__logo img {
    width: 62px;
    height: 62px;
    object-fit: contain;
}

@keyframes apPulseLogo {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.ap-preloader__text {
    color: var(--ap-mint);
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.72rem;
    opacity: 0.9;
}

/* ========================================================================
   AWAIS POULTRY — TOP NAVIGATION
   A slim, sticky bar shown on every authenticated page so there is
   always a way back to the dashboard, no matter how deep the page.
   ======================================================================== */

.ap-topbar {
    background: #fff;
    border-bottom: 1px solid rgba(20, 83, 45, 0.08);
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 2px 12px rgba(20, 83, 45, 0.05);
}

.ap-topbar__inner {
    max-width: 1240px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 24px;
}

.ap-topbar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--ap-forest);
    font-weight: 700;
    letter-spacing: 0.01em;
}

.ap-topbar__brand img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(20, 83, 45, 0.25);
    transition: transform 0.3s var(--ap-ease);
}

.ap-topbar__brand:hover img {
    transform: rotate(-8deg) scale(1.06);
}

.ap-topbar__actions {
    display: flex;
    gap: 6px;
}

.ap-topbar__link {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: 8px;
    color: var(--ap-ink-soft);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.18s var(--ap-ease), color 0.18s var(--ap-ease), transform 0.18s var(--ap-ease);
}

.ap-topbar__link:hover {
    background: var(--ap-mint);
    color: var(--ap-forest);
    transform: translateY(-1px);
}

.ap-topbar__link--danger:hover {
    background: #fdeaea;
    color: var(--ap-danger);
}

/* ========================================================================
   AWAIS POULTRY — SHARED APP-PAGE COMPONENTS
   Used across Areas, Wholesalers, Retailers, and Invoice screens so
   every interior page shares the same rhythm as the dashboard.
   ======================================================================== */

.page-fade-in {
    opacity: 0;
    transform: translateY(16px);
}

body.ap-loaded .page-fade-in {
    animation: apPageFadeUp 0.6s var(--ap-ease) forwards;
}

@keyframes apPageFadeUp {
    to { opacity: 1; transform: translateY(0); }
}

.ap-page-header {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
}

.ap-page-header h3 {
    color: var(--ap-forest);
    font-weight: 700;
    margin: 0;
}

.ap-page-header .ap-page-subtitle {
    color: var(--ap-ink-soft);
    font-size: 0.88rem;
    margin: 2px 0 0;
}

.ap-card {
    border: none !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 28px rgba(20, 83, 45, 0.08);
    transition: box-shadow 0.3s var(--ap-ease);
}

.ap-card:hover {
    box-shadow: 0 14px 34px rgba(20, 83, 45, 0.12);
}

.btn-brand {
    background: linear-gradient(135deg, var(--ap-green-light), var(--ap-green));
    border: none;
    color: #fff;
    font-weight: 600;
    border-radius: 10px;
    transition: transform 0.18s var(--ap-ease), box-shadow 0.18s var(--ap-ease);
}

.btn-brand:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(28, 139, 79, 0.3);
    color: #fff;
}

.btn-brand-gold {
    background: linear-gradient(135deg, var(--ap-gold), var(--ap-gold-dark));
    border: none;
    color: #1a1200;
    font-weight: 600;
    border-radius: 10px;
    transition: transform 0.18s var(--ap-ease), box-shadow 0.18s var(--ap-ease);
}

.btn-brand-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(214, 140, 14, 0.35);
    color: #1a1200;
}

.btn {
    transition: transform 0.15s var(--ap-ease), box-shadow 0.15s var(--ap-ease), background 0.15s ease, color 0.15s ease;
}

.btn:active {
    transform: scale(0.96);
}

.btn-sm i {
    transition: transform 0.2s ease;
}

.btn-sm:hover i {
    transform: scale(1.15);
}

/* Tables (plain + DataTables) */
.table thead th {
    background: var(--ap-mint);
    color: var(--ap-forest);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    border-bottom: none !important;
    white-space: nowrap;
}

.table td, .table th {
    vertical-align: middle;
}

.table-hover tbody tr {
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.table-hover tbody tr:hover {
    background-color: #f4fbf6 !important;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border-radius: 8px;
    border: 1.5px solid #dde7e1;
    padding: 6px 10px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
    border-color: var(--ap-green);
    box-shadow: 0 0 0 3px rgba(28, 139, 79, 0.12);
    outline: none;
}

.dataTables_wrapper .dataTables_paginate .page-link {
    border-radius: 8px !important;
    margin: 0 2px;
    color: var(--ap-forest);
    border: none;
}

.dataTables_wrapper .dataTables_paginate .page-item.active .page-link {
    background: var(--ap-green);
    color: #fff;
}

.dataTables_wrapper .dataTables_info {
    color: var(--ap-ink-soft);
    font-size: 0.85rem;
}

.ap-table-loading {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 6px 0;
}

.ap-table-loading__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ap-green);
    animation: apTableDot 1s ease-in-out infinite;
}

.ap-table-loading__dot:nth-child(2) { animation-delay: 0.15s; }
.ap-table-loading__dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes apTableDot {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

.ap-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--ap-ink-soft);
}

.ap-empty-state i {
    font-size: 2.1rem;
    color: #c7d9cd;
    margin-bottom: 10px;
    display: block;
}

/* Modals */
.modal.fade .modal-dialog {
    transform: translateY(24px) scale(0.97);
    transition: transform 0.3s var(--ap-ease), opacity 0.3s ease;
    opacity: 0;
}

.modal.show .modal-dialog {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.modal-content {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
}

.modal-header {
    border-bottom: none;
}

.modal-body .form-label {
    color: var(--ap-ink-soft);
}

.modal-body .form-control:focus,
.modal-body .form-select:focus {
    border-color: var(--ap-green);
    box-shadow: 0 0 0 3px rgba(28, 139, 79, 0.12);
}

/* Balance badges (retailers table) */
.ap-balance-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
}

.ap-balance-badge--due {
    background: #fdeaea;
    color: #c22b2b;
}

.ap-balance-badge--clear {
    background: #e6f7ec;
    color: #167a4d;
}

/* Live-calculation highlight (invoice totals) */
.ap-value-pulse {
    animation: apValuePulse 0.4s var(--ap-ease);
}

@keyframes apValuePulse {
    0% { background-color: rgba(240, 168, 36, 0.35); }
    100% { background-color: transparent; }
}
