/* =========================================================================
   ENTITY — Enterprise Records Management
   Custom theme layered on top of AdminLTE 4 / Bootstrap 5.3
   ========================================================================= */

:root {
    --entity-primary: #1d2b45;
    --entity-primary-rgb: 29, 43, 69;
    --entity-accent: #c9a96e;
    --entity-accent-rgb: 201, 169, 110;
    --entity-dark: #16203a;
    --entity-muted: #6c757d;
    --entity-sidebar-bg: #16203a;
    --entity-sidebar-hover: #1d2b45;
}

body {
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    background-color: #f4f6f9;
}

/* ---- Brand / Sidebar ---------------------------------------------------- */
.app-sidebar {
    background: var(--entity-sidebar-bg) !important;
}

.sidebar-brand {
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}


.brand-logo {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: linear-gradient(135deg, #c9a96e, #e8c98a);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    letter-spacing: .5px;
    box-shadow: 0 4px 10px rgba(var(--entity-accent-rgb), .35);
}

.sidebar-logo-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1.5px solid rgba(201, 169, 110, .35);
}

.sidebar-wordmark {
    font-family: "Georgia", "Times New Roman", serif;
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: .14em;
    color: rgba(255, 255, 255, .90);
    text-transform: uppercase;
    line-height: 1;
}

.app-sidebar .nav-link {
    color: #b8c2cc !important;
    border-radius: 8px;
    margin: 2px 8px;
    transition: all .15s ease;
}

.app-sidebar .nav-link:hover {
    background: var(--entity-sidebar-hover) !important;
    color: #fff !important;
}

.sidebar-logout-btn {
    color: #b8c2cc !important;
}

.sidebar-logout-btn:hover {
    color: #ff6b6b !important;
    background: rgba(255, 107, 107, .12) !important;
}

.app-sidebar .nav-link.active {
    background: rgba(201, 169, 110, .18) !important;
    color: #fff !important;
    box-shadow: inset 3px 0 0 #c9a96e;
}

.app-sidebar .nav-header {
    color: #5d7081 !important;
    text-transform: uppercase;
    font-size: .68rem;
    letter-spacing: 1px;
    font-weight: 700;
    padding-top: 14px;
}

/* ---- Top navbar --------------------------------------------------------- */
.app-header {
    background: #16203a !important;
    border-bottom: 1px solid rgba(201, 169, 110, .15);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .20);
}

.app-header .navbar-nav .nav-link { color: rgba(255, 255, 255, .75) !important; }
.app-header .navbar-nav .nav-link:hover { color: #ffffff !important; }
.app-header .fw-semibold { color: rgba(255, 255, 255, .90) !important; }
.app-header .text-muted { color: rgba(255, 255, 255, .45) !important; }
.app-header .badge.text-bg-light {
    background: rgba(255, 255, 255, .08) !important;
    color: rgba(255, 255, 255, .70) !important;
    border: 1px solid rgba(255, 255, 255, .10);
}

/* ---- Cards -------------------------------------------------------------- */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
}

.card .card-header {
    background: #fff;
    border-bottom: 1px solid #eef0f3;
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
}

/* ---- Stat / KPI cards --------------------------------------------------- */
.stat-card {
    border-radius: 12px;
    color: #fff;
    overflow: hidden;
    position: relative;
    transition: transform .15s ease, box-shadow .15s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .14);
}

.stat-card .stat-icon {
    position: absolute;
    right: -6px;
    bottom: -10px;
    font-size: 4.6rem;
    opacity: .18;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .07em;
    opacity: .8;
}

.bg-gradient-primary { background: linear-gradient(135deg, #2c3e50, #4a6278); }
.bg-gradient-success { background: linear-gradient(135deg, #27ae60, #1e8449); }
.bg-gradient-warning { background: linear-gradient(135deg, #f39c12, #e08e0b); }
.bg-gradient-info    { background: linear-gradient(135deg, #3498db, #2980b9); }
.bg-gradient-danger  { background: linear-gradient(135deg, #e74c3c, #c0392b); }

/* ---- Avatars ------------------------------------------------------------ */
.entity-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e9ecef;
}

.entity-avatar-lg {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .15);
}

/* ---- Action icons (table rows) ----------------------------------------- */
.action-icon {
    background: none;
    border: none;
    padding: 2px 5px;
    cursor: pointer;
    font-size: .88rem;
    opacity: .75;
    transition: opacity .15s, transform .1s;
    text-decoration: none;
}
.action-icon:hover { opacity: 1; transform: scale(1.15); }

/* ---- Buttons ------------------------------------------------------------ */
.btn-primary {
    --bs-btn-bg: var(--entity-primary);
    --bs-btn-border-color: var(--entity-primary);
    --bs-btn-hover-bg: #22303c;
    --bs-btn-hover-border-color: #22303c;
    --bs-btn-active-bg: #1a252f;
}

.btn-accent {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--entity-accent);
    --bs-btn-border-color: var(--entity-accent);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #b8924e;
    --bs-btn-hover-border-color: #b8924e;
}

.btn-outline-entity {
    --bs-btn-color: var(--entity-primary);
    --bs-btn-border-color: var(--entity-primary);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--entity-primary);
    --bs-btn-hover-border-color: var(--entity-primary);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--entity-primary);
}

/* ---- Pill badges & kebab menus (Clients / Businesses cards) -------------- */
.cat-badge {
    display: inline-block;
    padding: .3em .65em;
    border-radius: 50rem;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .03em;
    line-height: 1.2;
}
/* Client category (name prefix) */
.cat-ntt { background: #EEEDFE; color: #3C3489; }
.cat-ckf { background: #FAEEDA; color: #633806; }
.cat-maf { background: #E3F0FB; color: #1B4A7A; }
.cat-smz { background: #FBE9EF; color: #7A1B40; }
/* Business service (tax return status) */
.svc-bookkeep    { background: #E6F1FB; color: #0C447C; }
.svc-nonbookkeep { background: #E0F5F8; color: #0B5D6B; }
/* Business type */
.type-badge { background: #F1F3F5; color: #495057; }

.kebab-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    color: #6c757d;
    background: #fff;
}
.kebab-btn:hover {
    background: #f8f9fb;
    color: var(--entity-primary);
}

/* ---- Tables ------------------------------------------------------------- */
table.dataTable thead th {
    background: #f8f9fb;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: #586472;
    border-bottom: 2px solid #e9ecef !important;
}

.dt-buttons .btn {
    margin-right: 4px;
}

/* =========================================================================
   LOGIN PAGE — Two-panel premium layout (elp- prefix = entity-login-page)
   All rules scoped to .elp-* → zero bleed into dashboard / sidebar.
   ========================================================================= */

.elp-body { margin: 0; padding: 0; overflow: hidden; }

/* ── Two-panel page wrapper ───────────────────────────────────────────── */
.elp-page {
    display: flex;
    flex-direction: row;
    min-height: 100vh;
    width: 100%;
}

/* ══ LEFT PANEL ══════════════════════════════════════════════════════════ */
.elp-left {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;

    background: #1d2b45;
    background-image:
        radial-gradient(ellipse at 10% 15%, rgba(41, 68, 120, .50) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 80%, rgba(10, 16, 34, .65) 0%, transparent 55%);
}

/* Mini logo — top-left corner */
.elp-left-logo {
    position: absolute;
    top: 36px;
    left: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 2;
}

.elp-left-logo-img {
    height: 36px;
    width: auto;
    object-fit: contain;
}

.elp-badge {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}
.elp-badge svg { width: 100%; height: 100%; }

/* Larger badge for left panel mini logo */
.elp-badge--sm {
    width: 36px;
    height: 36px;
}

.elp-left-wordmark {
    font-family: "Georgia", "Times New Roman", serif;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: .16em;
    color: rgba(255, 255, 255, .90);
    text-transform: uppercase;
    line-height: 1;
}

/* Hero content — vertically centered */
.elp-left-hero {
    padding: 0 10% 0 40px;
    z-index: 2;
}

.elp-left-label {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: #c9a96e;
    margin: 0 0 18px;
}

.elp-left-title {
    font-family: "Georgia", "Times New Roman", serif;
    font-size: clamp(2.8rem, 5vw, 4.8rem);
    font-weight: 700;
    color: #ffffff;
    line-height: 1.0;
    letter-spacing: .06em;
    text-transform: uppercase;
    margin: 0 0 20px;
}

.elp-left-desc {
    font-size: .95rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, .58);
    max-width: 340px;
    margin: 0 0 32px;
}

.elp-left-divider {
    width: 48px;
    height: 3px;
    background: linear-gradient(90deg, #c9a96e, #e8c98a);
    border-radius: 2px;
    margin-bottom: 28px;
}

/* Feature pills */
.elp-left-features {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.elp-left-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .78rem;
    color: rgba(255, 255, 255, .55);
    letter-spacing: .02em;
}

.elp-left-pill i {
    color: #c9a96e;
    font-size: .8rem;
    width: 14px;
    text-align: center;
}

/* Large decorative watermark — centered behind left panel content */
.elp-left-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 720px;
    height: 720px;
    pointer-events: none;
    z-index: 1;
    opacity: .12;
}
.elp-left-watermark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ══ RIGHT PANEL ═════════════════════════════════════════════════════════ */
.elp-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 32px;

    background: #16203a;
    background-image:
        radial-gradient(ellipse at 80% 10%, rgba(41, 68, 120, .30) 0%, transparent 60%);
}

/* The white login card */
.elp-form-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 18px;
    box-shadow:
        0 28px 70px rgba(0, 0, 0, .45),
        0 4px 16px rgba(0, 0, 0, .20);
    overflow: hidden;
    position: relative;
}

/* Tan/gold accent bar at top of card */
.elp-form-card::before {
    content: '';
    display: block;
    height: 4px;
    background: linear-gradient(90deg, #c9a96e 0%, #e8c98a 50%, #c9a96e 100%);
}

/* Card header section */
.elp-form-header {
    padding: 44px 40px 0;
}

.elp-welcome-label {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: #c9a96e;
    margin: 0 0 6px;
}

.elp-sign-title {
    font-family: "Georgia", "Times New Roman", serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2a44;
    margin: 0 0 6px;
    line-height: 1.1;
}

.elp-sign-sub {
    font-size: .83rem;
    color: #8a95a8;
    margin: 0;
}

/* ── Form wrapper ─────────────────────────────────────────────────────── */
.elp-form-wrap {
    padding: 32px 40px 28px;
}

/* Error alert */
.elp-alert {
    background: #fff5f5;
    border: 1px solid #fcd0d0;
    border-radius: 10px;
    color: #c0392b;
    font-size: .85rem;
    padding: 10px 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Field groups */
.elp-field-group {
    margin-bottom: 24px;
}

.elp-label {
    display: block;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #7b8698;
    margin-bottom: 7px;
}

/* The unified input well: icon | divider | input | (eye) */
.elp-field {
    display: flex;
    align-items: center;
    background: #f1f4f8;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.elp-field:focus-within {
    background: #ffffff;
    border-color: #2a3a5c;
    box-shadow: 0 0 0 3px rgba(42, 58, 92, .10);
}

.elp-field--error {
    border-color: #e74c3c;
}

.elp-field-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    color: #5b6e8a;
    font-size: .9rem;
    flex-shrink: 0;
    border-right: 1.5px solid #dce3ed;
    align-self: stretch;
    transition: color .18s ease, border-color .18s ease;
}

.elp-field:focus-within .elp-field-icon {
    color: #2a3a5c;
    border-right-color: #c5cfe0;
}

.elp-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 13px 14px;
    font-size: .93rem;
    color: #1f2a44;
    font-family: inherit;
}

.elp-input::placeholder { color: #aab4c4; }

/* Eye-toggle button inside the field */
.elp-eye-btn {
    background: none;
    border: none;
    padding: 0 14px;
    color: #aab4c4;
    cursor: pointer;
    font-size: .9rem;
    display: flex;
    align-items: center;
    align-self: stretch;
    transition: color .15s ease;
}
.elp-eye-btn:hover { color: #2a3a5c; }

/* Remember me */
.elp-remember {
    margin-bottom: 22px;
}

.elp-check-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: .83rem;
    color: #6b7a90;
    user-select: none;
}

.elp-check-input {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    accent-color: #2a3a5c;
    cursor: pointer;
}

/* Submit button — navy gradient, uppercase, hover lift */
.elp-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #2a3a5c 0%, #1d2b45 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
    box-shadow: 0 4px 14px rgba(29, 43, 69, .35);
}

.elp-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(29, 43, 69, .45);
    background: linear-gradient(135deg, #34496e 0%, #253347 100%);
}

.elp-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(29, 43, 69, .30);
}

/* Footer */
.elp-footer {
    text-align: center;
    font-size: .75rem;
    color: #a0aab8;
    padding: 0 40px 40px;
    margin: 0;
}

.elp-footer strong {
    color: #6b7a90;
    font-weight: 600;
}

/* Top loader bar — login submit feedback */
#elp-top-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #c9a96e, #e8c98a, #c9a96e);
    z-index: 9999;
    border-radius: 0 2px 2px 0;
    opacity: 0;
    transition: opacity .15s ease;
}

#elp-top-loader.elp-loading {
    opacity: 1;
    animation: elpBarProgress 2.5s ease-out forwards;
}

@keyframes elpBarProgress {
    0%   { width: 0%; }
    25%  { width: 55%; }
    60%  { width: 80%; }
    100% { width: 92%; }
}

/* Top loader bar — dashboard navigation/logout */
#app-top-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #c9a96e, #e8c98a, #c9a96e);
    z-index: 9999;
    border-radius: 0 2px 2px 0;
    opacity: 0;
    transition: opacity .15s ease;
}

#app-top-loader.app-loading {
    opacity: 1;
    animation: elpBarProgress 2.5s ease-out forwards;
}

/* Responsive ─────────────────────────────────────────────────────────── */

/* Tablet: shrink left panel content slightly */
@media (max-width: 1024px) {
    .elp-left-hero    { padding: 0 6% 0 32px; }
    .elp-left-logo    { top: 28px; left: 32px; }
    .elp-left-title   { font-size: clamp(2.2rem, 4vw, 3.5rem); }
    .elp-right        { padding: 32px 24px; }
}

/* Mobile: hide left panel, full-width form on navy bg */
@media (max-width: 768px) {
    .elp-body { overflow: auto; }
    .elp-page  { flex-direction: column; }
    .elp-left  { display: none; }
    .elp-right {
        flex: unset;
        min-height: 100vh;
        width: 100%;
        padding: 24px 16px;
    }
    .elp-form-card     { max-width: 100%; }
    .elp-form-header   { padding: 24px 28px 0; }
    .elp-form-wrap     { padding: 20px 28px 16px; }
    .elp-footer        { padding: 0 28px 24px; }
}

/* ---- Misc --------------------------------------------------------------- */
.page-title {
    font-weight: 700;
    color: var(--entity-primary);
}

.required-asterisk::after {
    content: " *";
    color: #e74c3c;
}

.permission-group {
    border: 1px solid #eef0f3;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 14px;
    background: #fcfdfe;
}

.diff-old { background: #fdecec; color: #c0392b; }
.diff-new { background: #fdf6ea; color: #b8924e; }
