@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --peacock-gradient: var(--di-grad-brand);
    --peacock-glow: var(--di-grad-soft);
}

[data-theme="dark"], .dark {
    --bg-main: #020617;
    --bg-sidebar: #0F172A;
    --bg-card: rgba(15,23,42,0.75);
    --bg-glass: rgba(15,23,42,0.55);
    --border-color: rgba(255,255,255,0.08);
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --gradient-main: linear-gradient(135deg, #1E3A8A, #14B8A6);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Premium Background Glow Shapes */
body::before, body::after {
    content: "";
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.15;
    pointer-events: none;
}

body::before {
    top: -200px;
    right: -200px;
    background: var(--di-brand-gradient);
}

body::after {
    bottom: -200px;
    left: -200px;
    background: linear-gradient(135deg, var(--peacock-aqua), var(--peacock-teal));
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Dashboard Specific Styles (Legacy cleanup) */
.dashboard-container {
    padding: 0;
}

.login-page-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    font-family: 'Inter', sans-serif;
    background: radial-gradient(circle at 20% 20%, rgba(37,99,235,0.25), transparent 40%), radial-gradient(circle at 80% 80%, rgba(16,185,129,0.2), transparent 40%), url('/assets/Images/Login/Login_Background_Image.png') center/cover no-repeat;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
}

.login-page-body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: radial-gradient( circle 200px at var(--x, 50%) var(--y, 50%), rgba(37, 99, 235, 0.25), transparent 70% );
    pointer-events: none;
    z-index: 1;
}

.login-page-body::after {
    content: "";
    position: fixed;
    inset: 0;
    background: linear-gradient( 270deg, rgba(37,99,235,0.2), rgba(16,185,129,0.2), rgba(29,182,203,0.2) );
    background-size: 600% 600%;
    animation: gradientWave 12s ease infinite;
    z-index: 0;
}

@keyframes gradientWave {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
}

.particles span {
    position: absolute;
    display: block;
    width: 6px;
    height: 6px;
    background: rgba(255,255,255,0.4);
    border-radius: 50%;
    animation: floatParticles linear infinite;
}

.particles span:nth-child(1) {
    left: 10%;
    animation-duration: 12s;
    animation-delay: 0s;
}

.particles span:nth-child(2) {
    left: 30%;
    animation-duration: 18s;
    animation-delay: 2s;
}

.particles span:nth-child(3) {
    left: 50%;
    animation-duration: 15s;
    animation-delay: 4s;
}

.particles span:nth-child(4) {
    left: 70%;
    animation-duration: 20s;
    animation-delay: 1s;
}

.particles span:nth-child(5) {
    left: 90%;
    animation-duration: 17s;
    animation-delay: 3s;
}

@keyframes floatParticles {
    0% {
        top: 100%;
        opacity: 0;
        transform: translateY(0) scale(1);
    }

    20% {
        opacity: 1;
    }

    100% {
        top: -10%;
        opacity: 0;
        transform: translateY(-1000px) scale(0.5);
    }
}

.login-main-card {
    display: flex;
    width: 100%;
    max-width: 60%;
    min-height: 520px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.12);
    /* overflow: hidden; */
    position: relative;
    z-index: 2;
    margin: 15px 0;
}

.login-page-body .grid-overlay {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

.login-left {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-left-inner {
    width: 100%;
    max-width: 420px;
}

.login-logo {
    width: 130px;
    margin-bottom: 20px;
}

.login-title {
    font-size: 2.1rem;
    font-weight: 800;
    color: #0F172A;
    margin-bottom: 5px;
}

.login-subtitle {
    font-size: 0.9rem;
    color: #64748B;
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 15px;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

.input-container {
    position: relative;
}

.input-container i:first-child {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94A3B8;
    font-size: 0.95rem;
}

.toggle-password {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #94A3B8;
}

.form-control {
    width: 100%;
    height: 52px;
    padding: 0 45px;
    border-radius: 12px;
    border: 1px solid #E2E8F0;
    background: #F8FAFC;
    font-size: 0.95rem;
    transition: 0.25s;
}

.form-control:focus {
    background: #fff;
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
}

.remember-me input {
    accent-color: #2563EB;
}

.remember-me label {
    font-size: 0.85rem;
    color: #64748B;
}

.forgot-link {
    font-size: 0.85rem;
    color: #2563EB;
    font-weight: 600;
    text-decoration: none;
}

.forgot-link:hover {
    text-decoration: underline;
}

.btn-login {
    width: 100%;
    height: 54px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563EB, #1DB6CB);
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: 0.3s;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(37, 99, 235, 0.3);
}

.login-error {
    color: #EF4444;
    text-align: center;
    margin-top: 12px;
    font-size: 0.85rem;
}

.login-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 0.75rem;
    color: #94A3B8;
}

.login-right {  
    flex: 0 0 45%;
    position: relative;
    overflow: hidden;
    border-top-right-radius: 30px;
    border-bottom-right-radius: 30px;
    cursor: pointer;
}

.login-right-bg {
    position: absolute;
    inset: 0;
    background: url('/assets/Images/Login/Login_Image_Side_1.png') center/cover no-repeat;
    transform: scale(1.15);
    transition: transform 0.3s ease-out;
    z-index: 1;
}

.login-right-light {
    position: absolute;
    inset: 0;
    background: radial-gradient( circle at var(--x, 50%) var(--y, 50%), rgba(255,255,255,0.25), transparent 60% );
    opacity: 0.6;
    z-index: 2;
    pointer-events: none;
}

.login-right::before {
    content: "";
    position: absolute;
    inset: 0;
    box-shadow: inset -50px 0 80px rgba(0,0,0,0.2);
    z-index: 2;
}

.login-right::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.3), transparent 60%);
    z-index: 2;
}

.login-right-overlay {
    position: absolute;
    top: 40px;
    right: 40px;
    text-align: right;
    z-index: 3;
}

.login-right-overlay h3 {
    font-size: 1.3rem;
    font-weight: 700;
    border-left: 3px solid #2563EB;
    padding-left: 12px;
    color: #1E293B;
}

.login-right-overlay p {
    font-size: 0.95rem;
    color: #475569;
}

@media (max-width: 991px) {
    .login-main-card {
        flex-direction: column;
        width: 100%;
        max-width: 500px;
        min-height: auto;
        margin: 20px;
    }

    .login-right {
        display: none;
    }

    .login-left {
        padding: 40px 30px;
    }
    
    .login-title {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .login-main-card {
        margin: 8px auto;
        border-radius: 16px;
        width: 92%;
        max-width: 360px;
    }
    
    .login-left {
        padding: 15px 12px;
    }
    
    .login-logo {
        width: 80px;
        margin-bottom: 12px;
    }
    
    .login-title {
        font-size: 1.3rem;
        letter-spacing: -0.5px;
    }
    
    .login-subtitle {
        font-size: 0.8rem;
        margin-bottom: 12px;
    }

    .form-group {
        margin-bottom: 10px;
    }
    
    .form-label {
        font-size: 0.75rem;
        margin-bottom: 4px;
    }

    .form-control {
        height: 42px;
        padding: 0 38px;
        font-size: 0.85rem;
        border-radius: 10px;
    }

    .input-container i:first-child,
    .toggle-password {
        left: 10px;
        font-size: 0.85rem;
    }
    .toggle-password {
        right: 10px;
        left: auto;
    }

    .login-options {
        margin-bottom: 12px;
    }
    
    .label-text, .forgot-link {
        font-size: 0.8rem;
    }

    .btn-login {
        height: 44px;
        font-size: 0.85rem;
        border-radius: 10px;
    }

    .login-footer {
        margin-top: 12px;
    }

    .login-sep-container {
        margin-bottom: 8px;
    }

    .login-footer-text {
        margin-bottom: 8px;
        font-size: 0.7rem;
        line-height: 1.4;
    }
    
    .login-copyright {
        font-size: 0.65rem;
    }
}

/* Login Page Refinements */
.login-error-msg { color: #EF4444; margin-top: 15px; text-align: center; font-size: 0.9rem; font-weight: 500; }
.login-sep-container { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 20px; }
.login-sep-line { flex: 1; border: none; border-top: 1px solid #E2E8F0; }
.login-sep-icon { color: #94A3B8; }
.login-footer-text { margin-bottom: 30px; line-height: 1.6; }
.login-copyright { font-size: 0.8rem; color: #94A3B8; }

.custom-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.custom-checkbox input {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid #CBD5F5;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.checkmark::after {
    content: "";
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform 0.2s ease;
}

.custom-checkbox:hover .checkmark {
    border-color: #2563EB;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.custom-checkbox input:checked + .checkmark {
    background: linear-gradient(135deg, #2563EB, #1DB6CB);
    border-color: transparent;
}

.custom-checkbox input:checked + .checkmark::after {
    transform: rotate(45deg) scale(1);
}

.label-text {
    font-size: 0.9rem;
    color: #64748B;
}

/* Mobile Header - Hidden on Desktop by Default */
.mobile-header {
    display: none;
    padding: 1rem;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1001;
    justify-content: space-between;
    align-items: center;
}

/* Sidebar Refinement */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    padding: 0.5rem;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Prevent page scroll */
}

/* Scrollable container for the actual page content */
.di-content-wrapper {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 5px;
}

/* Top Header - Sticky Refinement */
.top-header {
    height: var(--header-height);
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-main);
    position: sticky;
    top: 0;
    z-index: 999;
    border-bottom: 1px solid transparent; /* Keep it clean */
}

@media (max-width: 991px) {
    .mobile-header {
        display: flex;
    }
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .top-header {
        display: none; /* Hide topbar on mobile in favor of mobile-header */
    }
}

/* Mobile Sidebar Backdrop */
.di-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.di-sidebar-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

/* Utility for responsive hiding */
.di-d-none-desktop {
    display: none !important;
}

@media (max-width: 991px) {
    .di-d-none-desktop {
        display: block !important;
    }
}

.di-flex { display: flex; }
.di-align-center { align-items: center; }
.di-gap-3 { gap: 15px; }

/* Responsive Typography */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    .di-header-left h1 {
        font-size: 1.8rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade {
    animation: fadeIn 0.5s ease-out forwards;
}

/* ==========================================================================
   Standard Master Page Layout
   ========================================================================== */

.di-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    animation: fadeIn 0.6s ease-out;
}

.di-header-left h1 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -1px;
    margin-bottom: 6px;
}

.di-header-left p {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
}

.di-action-bar {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 2rem;
}

/* Glass Search Container */
.di-search-wrapper {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    width: 400px;
    height: 54px;
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
}

.di-search-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
    width: 450px;
}

.di-search-wrapper i {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.di-search-wrapper input {
    border: none;
    outline: none;
    background: transparent;
    padding: 0 15px;
    width: 100%;
    font-size: 0.95rem;
    font-weight: 500;
}

/* Master Data Grid */
.di-master-card {
    background: white;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    animation: fadeIn 0.8s ease-out;
}

.di-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.di-table th {
    background: #F8FAFC;
    padding: 20px 24px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border-color);
}

.di-table td {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
}

.di-table tr:hover td {
    background: #F1F5F9;
    color: var(--primary);
}

.di-table tr:last-child td {
    border-bottom: none;
}

/* Status Pills */
.di-badge {
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 10rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.di-badge-active {
    background: #DCFCE7;
    color: #15803D;
}

.di-badge-inactive {
    background: #FEE2E2;
    color: #B91C1C;
}

.di-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* Action Buttons */
.di-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 24px;
    height: 48px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    border: none;
}

.di-btn-primary {
    background: linear-gradient(135deg, #2563EB, #1DB6CB);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.di-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.di-btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 10px;
    background: #F1F5F9;
    color: var(--text-secondary);
}

.di-btn-icon:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.di-btn-edit { color: var(--primary); }
.di-btn-delete { color: var(--danger); }

/* Form Card */
.di-form-card {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.di-form-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    text-align: center;
}

/* Pagination Custom */
.di-pagination {
    display: flex;
    justify-content: flex-end;
    background: #F8FAFC;
    border-top: 1px solid var(--border-color);
}

.di-input {
    width: 100%;
    height: 56px;
    padding: 0 20px 0 52px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: var(--transition);
}

.di-input:focus {
    background: #FFFFFF;
    border-color: var(--primary);
    box-shadow: var(--di-shadow-glow);
    outline: none;
}

.di-input:focus + .di-input-icon {
    color: var(--primary);
}

/* Button Protocols */
.di-btn {
    height: 56px;
    padding: 0 32px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-decoration: none;
}

.di-btn-primary {
    background: linear-gradient(135deg, #2563EB, #12B4C5);
    color: white;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.25);
}

.di-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(37, 99, 235, 0.35);
}

.di-btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.di-btn-ghost:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

/* Data Registry Table */
.di-table-container {
    background: white;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
}

.di-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.di-table th {
    background: #FAFBFC;
    padding: 20px 30px;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border-color);
}

.di-table td {
    padding: 24px 30px;
    border-bottom: 1px solid #F1F5F9;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: var(--transition);
}

.di-table tr:hover td {
    background: #F8FAFC;
    color: var(--text-primary);
}

/* Badge Protocols */
.di-badge {
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
}

.di-badge-active {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.di-badge-inactive {
    background: rgba(239, 68, 68, 0.1);
    color: #DC2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.di-badge-code {
    background: var(--primary-soft);
    color: var(--primary);
    border: 1px solid rgba(37, 99, 235, 0.1);
}

/* Helper Text */
.di-text-bold { font-weight: 700; color: var(--text-primary); }
.di-text-sm { font-size: 0.85rem; font-weight: 600; }
.di-text-tiny { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

/* Table Helpers */
.flag-capsule {
    width: 44px;
    height: 32px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
}

.flag-capsule span {
    width: 100%;
    height: 100%;
    display: block;
    background-size: cover;
}

.text-end { text-align: right; }

.di-action-group {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.di-action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.di-action-btn.edit { background: #EEF2FF; color: var(--primary); }
.di-action-btn.edit:hover { background: var(--primary); color: white; }

.di-action-btn.delete { background: #FEF2F2; color: var(--danger); }
.di-action-btn.delete:hover { background: var(--danger); color: white; }

.di-table-footer {
    padding: 24px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #FAFBFC;
    border-top: 1px solid var(--border-color);
    position: sticky;
    bottom: 0;
    z-index: 10;
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 14px;
}

.di-pagination {
    display: flex;
    gap: 8px;
}

.di-page-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #E2E8F0;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: var(--transition);
}

.di-page-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
}

/* Create/Edit Specifics */
.di-form-container {
    max-width: 900px;
    margin: 0 auto;
}

.di-status-bar {
    background: #F8FAFC;
    padding: 20px 30px;
    border-radius: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.di-switch-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 800;
    font-size: 0.8rem;
    color: var(--text-primary);
}

.di-preview-box {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Layout Helpers */
.di-layout-split {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
}

/* Added Card System for Master Pages */
.di-card {
    background: var(--bg-card, #ffffff);
    border-radius: var(--radius-xl, 24px);
    border: 1px solid var(--border-color, #e6ecf5);
    box-shadow: var(--shadow-md, 0 10px 30px rgba(0,0,0,0.06));
    overflow: hidden;
    position: relative;
    transition: var(--transition, all 0.3s ease);
}
.di-card:hover {
    box-shadow: var(--shadow-lg, 0 20px 40px rgba(0,0,0,0.1));
}
.di-card-header {
    padding: 24px 30px;
    border-bottom: 1px solid var(--border-color, #e6ecf5);
    background: rgba(255, 255, 255, 0.4);
}
.di-card-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary, #0F172A);
    margin: 0;
}
.di-card-body {
    padding: 30px;
}
.di-card-footer {
    padding: 24px 30px;
    background: #FAFBFC;
    border-top: 1px solid var(--border-color, #e6ecf5);
}

/* Master Form Elements */
.di-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.di-form-group {
    display: flex;
    flex-direction: column;
}
.di-form-group.di-span-2 {
    grid-column: span 2;
}
.di-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary, #475569);
    margin-bottom: 8px;
}
.di-error {
    font-size: 0.75rem;
    color: var(--danger, #EF4444);
    margin-top: 4px;
}
.di-mt-20 {
    margin-top: 20px;
}
.di-textarea {
    resize: vertical;
    min-height: 100px;
    border-radius: 16px;
    padding: 16px 20px;
}

/* Toggles & Meta */
.di-toggle-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.di-toggle-info p {
    margin: 0;
}
.di-toggle-label {
    font-weight: 700;
    color: var(--text-primary);
}
.di-toggle-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.di-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}
.di-switch.mini {
    width: 32px;
    height: 18px;
}
.di-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.di-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .4s;
    border-radius: 34px;
}
.di-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
.di-slider.mini:before {
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
}
.di-switch input:checked + .di-slider {
    background-color: var(--accent, #10B981);
}
.di-switch input:checked + .di-slider:before {
    transform: translateX(26px);
}
.di-switch.mini input:checked + .di-slider:before {
    transform: translateX(14px);
}
.di-audit-item i {
    color: var(--primary);
}

.di-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 35px;
    padding-top: 25px;
    border-top: 1px solid var(--border-color);
}

.di-audit-strip {
    margin-top: 30px;
    padding: 20px 35px;
    background: rgba(0,0,0,0.02);
    border-radius: 18px;
    display: flex;
    gap: 30px;
}

@media (max-width: 768px) {
    .di-layout-split {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .di-form-grid {
        grid-template-columns: 1fr;
    }
    .di-form-group.di-span-2 {
        grid-column: span 1;
    }
    .di-form-actions {
        flex-direction: column-reverse;
        gap: 15px;
    }
    .di-btn {
        width: 100%;
    }
    .di-page-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
}

/* Table Responsiveness Utility */
.di-table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
}

.di-table-responsive .di-table {
    min-width: 800px; /* Force scroll on small screens */
}

/* Sidebar Nav Lists */
.di-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Header & Profile Components */
.di-profile-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.di-profile-info {
    text-align: right;
}

.di-profile-name {
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--text-primary);
    margin: 0;
}

.di-profile-role {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    display: block;
}

.di-top-icon {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1.1rem;
    transition: var(--transition);
    text-decoration: none;
}

.di-top-icon:hover {
    color: var(--primary);
}

/* Tool/Utility Buttons (Export, Print) */
.di-utility-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

.di-btn-tool {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-soft);
}

.di-btn-tool:hover {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.di-btn-tool i {
    font-size: 1.1rem;
}

/* ==========================================================================
   Premium Glass Modals (RBAC/Global)
   ========================================================================== */
/* Ensure Modals are always on top of EVERYTHING */
.modal-backdrop.show {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background-color: rgba(15, 23, 42, 0.4);
    z-index: 10000 !important; /* Above sidebar */
}

.di-modal-glass.modal {
    z-index: 10001 !important; /* Above backdrop */
}

/* Force Modal Centering regardless of layout constraints */
.di-modal-glass .modal-dialog {
    max-width: 480px;
    margin: 0 auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 100vh !important;
}
@media (min-width: 576px) {
    .di-modal-glass .modal-dialog {
        display: flex;
        align-items: center;
        min-height: calc(100% - 3.5rem);
    }
}

.di-modal-glass .modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 1);
    border-radius: 32px;
    box-shadow: 0 50px 100px rgba(15, 23, 42, 0.25);
    overflow: hidden;
    padding: 20px;
}

.di-modal-glass .modal-header {
    border-bottom: none;
    padding: 30px 40px 10px 40px;
    text-align: center;
    justify-content: center;
}

.di-modal-glass .modal-title {
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--text-primary);
    flex-direction: column;
    gap: 15px;
}

.di-modal-glass .modal-body {
    padding: 20px 40px;
    font-size: 1.05rem;
    text-align: center;
    color: var(--text-secondary);
}

.di-modal-glass .modal-footer {
    border-top: none;
    padding: 30px 40px 40px 40px;
    display: flex;
    justify-content: center;
    gap: 12px;
}

.di-modal-glass .di-btn {
    flex: 1;
    height: 54px;
    font-weight: 800;
    font-size: 0.9rem;
    border-radius: 16px;
    padding: 0 20px;
}

#di-notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.di-notification {
    min-width: 300px;
    max-width: 400px;
    padding: 16px 20px;
    border-radius: 16px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    animation: slideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 9999;
}

.di-notification i {
    font-size: 1.2rem;
    margin-right: 12px;
}

.di-notification span {
    flex: 1;
}

.di-success {
    background: linear-gradient(135deg, #059669, #10b981) !important;
}

.di-danger, .di-error {
    background: linear-gradient(135deg, #dc2626, #ef4444) !important;
}

/* Removed legacy notification styles - moved to GlobalDI.css elite system */


@keyframes slideIn {
    from {
        transform: translateX(30px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.di-notification.hide {
    animation: slideOut 0.3s ease forwards;
}

@keyframes slideOut {
    to {
        transform: translateX(40px);
        opacity: 0;
    }
}

/* --- MODERN GRID SWITCHES (iOS Style) --- */
.di-grid-switch {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 18px;
}

.di-grid-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.di-grid-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(100, 116, 139, 0.2);
    transition: .3s;
    border-radius: 20px;
}

.di-grid-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.di-grid-switch input:checked + .di-grid-slider {
    background-color: var(--di-primary, #0F6CBD);
}

.di-grid-switch input:checked + .di-grid-slider:before {
    transform: translateX(14px);
}

.di-grid-switch input:disabled + .di-grid-slider {
    opacity: 0.8;
}
