/* ============================================
   Sistem Informasi BAPAS Pekanbaru
   CSS Styles - Design Figma
   ============================================ */

:root {
    --primary-blue: #2563eb;
    --primary-blue-dark: #1e40af;
    --primary-blue-light: #3b82f6;
    --accent-yellow: #FFD700;
    --accent-yellow-dark: #FFA500;
    --success-green: #10b981;
    --warning-yellow: #f59e0b;
    --danger-red: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --white: #ffffff;
    --black: #000000;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

/* Pastikan semua elemen tidak memiliki batasan width di mobile */
* {
    max-width: 100%;
}

/* Kecuali untuk elemen tertentu yang memang perlu dibatasi */
img,
video,
iframe {
    max-width: 100%;
    height: auto;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--gray-800);
    background-color: var(--gray-50);
    line-height: 1.6;
    position: relative;
}

* {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ============================================
   AUTH PAGE (LOGIN)
   ============================================ */

.auth-page {
    min-height: 100vh;
    display: flex;
    overflow: hidden;
}

.login-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
    background: var(--white);
}

.login-left {
    flex: 1;
    background: var(--white);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow: hidden;
}

.ellips-svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.login-right {
    flex: 1;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
}

.login-form-container {
    width: 100%;
    max-width: 450px;
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-logo {
    width: 80px;
    height: auto;
    margin-bottom: 1.5rem;
}

.login-subtitle {
    color: var(--gray-500);
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

.login-form-container h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
    text-align: center;
}

/* Responsive Login */
@media (max-width: 992px) {
    .login-container {
        flex-direction: column;
    }

    .login-left {
        display: none;
    }

    .login-right {
        padding: 2rem;
        align-items: center;
    }

    .login-form-container {
        max-width: 100%;
        width: 100%;
    }
}

.login-form .form-group {
    margin-bottom: 1.5rem;
}

.login-form .form-group label {
    display: block;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    color: var(--gray-600) !important;
    z-index: 1 !important;
    width: 2.5rem !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(16, 185, 129, 0.1) !important;
    border-radius: 0.5rem 0 0 0.5rem !important;
    pointer-events: none !important;
    font-size: 1rem !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.role-pk .input-icon {
    background: rgba(16, 185, 129, 0.1);
}

.role-admin .input-icon,
body:not(.role-pk) .input-icon {
    background: rgba(37, 99, 235, 0.1);
}

.input-wrapper input,
.input-wrapper select,
.input-wrapper textarea {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3.5rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--white);
}

/* Login form specific input styling */
.auth-page .input-wrapper {
    position: relative;
}

.auth-page .input-wrapper input {
    border: 1px solid #000;
    padding: 0.875rem 1rem 0.875rem 3.5rem;
    border-radius: 2rem;
    width: 100%;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--white);
    color: var(--gray-900);
}

.auth-page .input-wrapper input[type="password"],
.auth-page .input-wrapper input[type="text"][id="password"] {
    padding-right: 3rem;
}

.auth-page .input-wrapper input::placeholder {
    color: var(--gray-400);
}

.auth-page .input-icon-svg {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    z-index: 1;
    pointer-events: none;
}

.auth-page .input-wrapper input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-wrapper input:focus,
.input-wrapper select:focus,
.input-wrapper textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.role-pk .input-wrapper input:focus,
.role-pk .input-wrapper select:focus,
.role-pk .input-wrapper textarea:focus {
    border-color: var(--success-green);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.toggle-password {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-600);
    cursor: pointer;
    z-index: 2;
    font-size: 1.125rem;
    transition: color 0.2s ease;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-password:hover {
    color: var(--gray-800);
}

.auth-page .input-wrapper input[type="password"]~.toggle-password,
.auth-page .input-wrapper input[type="text"]~.toggle-password {
    right: 1rem;
}

.btn-login {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(90deg, #1B56FD 39%, #FF27E9 100%);
    color: var(--white);
    border: none;
    border-radius: 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(27, 86, 253, 0.3);
    background: linear-gradient(90deg, #0d47e8 39%, #e91ed6 100%);
}

.btn-login:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Login Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px) scale(1.02);
    }

    50% {
        transform: translateY(-10px) scale(1.05);
    }

    100% {
        transform: translateY(0px) scale(1.02);
    }
}

.login-left {
    animation: fadeInLeft 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.ellips-svg {
    animation: float 8s ease-in-out infinite;
    transform-origin: center;
}

.login-form-container {
    opacity: 0;
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.3s forwards;
}

.login-form .form-group:nth-child(1) {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out 0.5s forwards;
}

.login-form .form-group:nth-child(2) {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out 0.7s forwards;
}

.btn-login {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out 0.9s forwards;
}

/* ============================================
   ADMIN PANEL LAYOUT
   ============================================ */

/* Main Layout Container */
.main-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    padding: 0;
    overflow: hidden;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    transition: width 0.3s ease, left 0.3s ease;
    z-index: 999;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.sidebar-header .logo {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    width: 100%;
}

.sidebar-header .logo-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-header .logo-text {
    transition: opacity 0.3s ease;
    overflow: visible;
    flex: 1;
    min-width: 0;
}

.sidebar.collapsed .sidebar-header .logo-text {
    opacity: 0;
    width: 0;
    height: 0;
    overflow: hidden;
}

.sidebar-header .logo-text h1 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0 0 0.2rem 0;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.sidebar-header .logo-text p {
    font-size: 0.65rem;
    color: var(--gray-500);
    margin: 0;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.sidebar.collapsed .sidebar-header {
    padding: 1.5rem 0;
    display: flex;
    justify-content: center;
}

.sidebar.collapsed .sidebar-header .logo {
    justify-content: center;
    gap: 0;
}

.sidebar-menu-label {
    padding: 1rem 1.5rem;
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .sidebar-menu-label {
    opacity: 0;
    height: 0;
    padding: 0;
    overflow: hidden;
}

/* Sidebar Account Info (untuk PK) */
.sidebar-account {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.account-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.account-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.account-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 2rem;
    flex-shrink: 0;
}

.account-details {
    flex: 1;
    min-width: 0;
}

.account-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-role {
    font-size: 0.75rem;
    color: var(--gray-600);
    font-weight: 500;
}

.sidebar.collapsed .sidebar-account {
    padding: 1rem 0.5rem;
}

.sidebar.collapsed .account-label,
.sidebar.collapsed .account-details {
    opacity: 0;
    height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.sidebar.collapsed .account-avatar {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    margin: 0 auto;
}

/* Content Wrapper */
.content-wrapper {
    flex: 1;
    margin-left: 280px;
    transition: margin-left 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: calc(100% - 280px);
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: visible;
    position: relative;
    height: 100vh;
}

.main-layout.sidebar-collapsed .content-wrapper {
    margin-left: 80px;
    width: calc(100% - 80px);
    max-width: 100%;
}

/* Header (Inside Content Wrapper) */
.header {
    background: var(--white);
    padding: 1.2rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid var(--gray-200);
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 999;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    flex-shrink: 0;
    margin: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--gray-700);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1002;
    position: relative;
}

.sidebar-toggle:hover {
    background: var(--gray-100);
    color: var(--primary-blue);
}

.sidebar-toggle:active {
    transform: scale(0.95);
}

.header-title h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.header-title p {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin: 0.25rem 0 0 0;
}

.role-badge {
    background: var(--primary-blue);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.role-badge i {
    font-size: 0.875rem;
}

/* Warna hijau untuk role badge PK */
.role-pk .role-badge {
    background: var(--success-green);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: var(--gray-700);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    gap: 1rem;
    justify-content: flex-start;
}

.sidebar.collapsed .nav-item {
    padding: 1rem;
    justify-content: center;
    position: relative;
}

.sidebar.collapsed .nav-item:hover::after {
    content: attr(data-title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: var(--gray-800);
    color: var(--white);
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    white-space: nowrap;
    margin-left: 0.5rem;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    pointer-events: none;
}

.sidebar.collapsed .nav-item:hover::before {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: var(--gray-800);
    z-index: 1001;
    margin-left: -0.5rem;
    pointer-events: none;
}

.nav-item i:first-child {
    width: 20px;
    text-align: center;
}

.nav-item span {
    flex: 1;
    white-space: nowrap;
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .nav-item span {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* Dropdown Menu Styles */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    cursor: pointer;
}

.nav-dropdown.active .nav-dropdown-toggle {
    background: var(--primary-blue);
    color: var(--white);
    font-weight: 600;
    border-radius: 0.5rem;
    margin: 0 0.75rem;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.role-pk .nav-dropdown.active .nav-dropdown-toggle {
    background: var(--success-green);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.nav-dropdown-icon {
    margin-left: auto;
    transition: transform 0.3s ease;
    font-size: 0.75rem;
}

.nav-dropdown.active .nav-dropdown-icon {
    transform: rotate(90deg);
}

.nav-dropdown-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    background: var(--gray-50);
    padding: 0.5rem 0.75rem;
}

.nav-dropdown.active .nav-dropdown-menu {
    max-height: 500px;
    opacity: 1;
    padding: 0.5rem 0.75rem;
}

.nav-dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    margin: 0.25rem 0;
    color: var(--gray-700);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    gap: 1rem;
    font-size: 0.9rem;
    border-radius: 0.5rem;
    background: transparent;
}

.nav-dropdown-item:hover {
    background: var(--gray-100);
    color: var(--primary-blue);
    transform: translateX(4px);
}

.nav-dropdown-item.active {
    background: linear-gradient(135deg, var(--primary-blue) 0%, #2563eb 100%);
    color: var(--white);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    transform: translateX(4px);
}

.role-pk .nav-dropdown-item.active {
    background: linear-gradient(135deg, var(--success-green) 0%, #059669 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.nav-dropdown-item.active::before {
    content: '';
    position: absolute;
    left: -0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: var(--primary-blue-dark);
    border-radius: 0 4px 4px 0;
}

.role-pk .nav-dropdown-item.active::before {
    background: #047857;
}

.nav-dropdown-item i {
    width: 18px;
    text-align: center;
    font-size: 0.875rem;
}

/* Collapsed sidebar - hide dropdown menu */
.sidebar.collapsed .nav-dropdown-menu {
    display: none;
}

.sidebar.collapsed .nav-dropdown.active .nav-dropdown-toggle::after {
    content: attr(data-title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: var(--gray-800);
    color: var(--white);
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    white-space: nowrap;
    margin-left: 0.5rem;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    pointer-events: none;
}

.sidebar.collapsed .nav-dropdown.active .nav-dropdown-toggle::before {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: var(--gray-800);
    z-index: 1001;
    margin-left: -0.5rem;
    pointer-events: none;
}

.nav-item .fa-chevron-right {
    font-size: 0.75rem;
    margin-left: auto;
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .nav-item .fa-chevron-right {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.nav-item:hover {
    background: var(--gray-50);
    color: var(--primary-blue);
}

.nav-item.active {
    background: var(--primary-blue);
    color: var(--white);
    font-weight: 600;
    border-radius: 0.5rem;
    margin: 0 0.75rem;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
    transition: all 0.3s ease;
}

/* Warna hijau untuk active menu role PK */
.role-pk .nav-item.active {
    background: var(--success-green);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.sidebar.collapsed .nav-item.active {
    margin: 0 0.5rem;
}

.nav-item.logout {
    margin-top: auto;
    color: var(--danger-red);
}

.nav-item.logout:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 0;
    border-top: 1px solid var(--gray-200);
    background: var(--white);
    margin-top: auto;
    display: flex;
    flex-shrink: 0;
    visibility: visible;
    opacity: 1;
    position: sticky;
    bottom: 0;
    z-index: 10;
    width: 100%;
}

.sidebar-footer .nav-item {
    margin-top: 0;
    border-radius: 0;
    width: 100%;
    display: flex;
    visibility: visible;
    opacity: 1;
}

.sidebar.collapsed .sidebar-footer {
    padding: 0;
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--gray-50);
    min-height: calc(100vh - 80px - 80px);
    width: 100%;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

/* Main Footer */
.main-footer {
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    padding: 1rem 2rem;
    margin-top: auto;
    position: relative;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    transform: translateY(0);
    opacity: 1;
    z-index: 10;
    display: block;
    visibility: visible;
    flex-shrink: 0;
}

.main-footer.footer-hidden {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.footer-content {
    text-align: center;
}

.footer-content p {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin: 0.25rem 0;
    line-height: 1.5;
}

.footer-content p:first-child {
    font-weight: 500;
    color: var(--gray-700);
}

.main-content h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 2rem;
}

/* ============================================
   ALERTS
   ============================================ */

.alert {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-green);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ============================================
   STATISTICS CARDS
   ============================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid;
    border-left: 1px solid;
    border-right: 4px solid;
    border-bottom: 4px solid;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-card .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    z-index: 1;
    background: transparent;
}

.stat-card .stat-icon i {
    font-size: 1.25rem;
}

.stat-green {
    border-top-color: rgba(16, 185, 129, 0.2);
    border-left-color: rgba(16, 185, 129, 0.2);
    border-right-color: #10b981;
    border-bottom-color: #10b981;
}

.stat-green .stat-icon {
    background: transparent;
    border-color: #10b981;
    color: #10b981;
}

.stat-blue {
    border-top-color: rgba(59, 130, 246, 0.2);
    border-left-color: rgba(59, 130, 246, 0.2);
    border-right-color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.stat-blue .stat-icon {
    background: transparent;
    border-color: #3b82f6;
    color: #3b82f6;
}

.stat-yellow {
    border-top-color: rgba(245, 158, 11, 0.2);
    border-left-color: rgba(245, 158, 11, 0.2);
    border-right-color: #f59e0b;
    border-bottom-color: #f59e0b;
}

.stat-yellow .stat-icon {
    background: transparent;
    border-color: #f59e0b;
    color: #f59e0b;
}

.stat-cyan {
    border-top-color: rgba(6, 182, 212, 0.2);
    border-left-color: rgba(6, 182, 212, 0.2);
    border-right-color: #06b6d4;
    border-bottom-color: #06b6d4;
}

.stat-cyan .stat-icon {
    background: transparent;
    border-color: #06b6d4;
    color: #06b6d4;
}

.stat-content {
    flex: 1;
}

.stat-content h3 {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-900);
    margin: 0 0 0.5rem 0;
}

.stat-number-wrapper {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
    line-height: 1.2;
    flex: 1;
}

.stat-link {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    border: 1px solid var(--gray-300);
    border-radius: 9999px;
    color: var(--gray-700);
    text-decoration: none;
    font-size: 0.6875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    background: var(--white);
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 2.1rem;
}

.stat-link:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
    color: var(--gray-900);
}

/* ============================================
   TABLES
   ============================================ */

.dashboard-tables {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.table-card {
    background: var(--white);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.table-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--gray-50);
}

.data-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.875rem;
    border-bottom: 2px solid var(--gray-200);
}

.data-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-700);
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

.text-center {
    text-align: center;
}

/* ============================================
   BADGES
   ============================================ */

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-green);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-yellow);
}

.badge-info {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-blue);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-red);
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* ============================================
   PAGE HEADER
   ============================================ */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.page-title {
    flex: 1;
}

.page-title h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-700);
    margin: 0;
}

/* Form Header dengan Green Banner */
.form-header {
    margin-bottom: 1.5rem;
}

.form-header-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0 0 1rem 0;
}

.form-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--success-green);
    color: var(--white);
    border-radius: 0.75rem 0.75rem 0 0;
    margin-bottom: 0;
}

.role-pk .form-banner {
    background: var(--success-green);
}

.role-admin .form-banner,
body:not(.role-pk) .form-banner {
    background: var(--primary-blue);
}

.form-banner i {
    font-size: 1.25rem;
}

.form-banner span {
    font-size: 1.125rem;
    font-weight: 600;
}

.page-actions {
    display: flex;
    gap: 1rem;
}

/* ============================================
   CARDS
   ============================================ */

.card {
    background: var(--white);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: 0.5rem;
}

.card-header-left,
.card-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.entries-label {
    font-size: 0.875rem;
    color: var(--gray-700);
    font-weight: 500;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-box {
    position: relative;
    min-width: 250px;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    z-index: 1;
}

.search-input {
    padding-left: 2.5rem !important;
    padding-right: 1rem;
    width: 100%;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
}

/* ============================================
   FORMS
   ============================================ */

.form-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--gray-200);
}

.form-section:last-child {
    border-bottom: none;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.section-header i {
    font-size: 1.25rem;
    color: var(--primary-blue);
}

.role-pk .section-header i {
    color: var(--success-green);
}

.section-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.section-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--primary-blue);
    color: var(--white);
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.role-pk .section-banner {
    background: var(--success-green);
}

.section-banner i {
    font-size: 1.5rem;
}

.section-banner span {
    font-size: 1.125rem;
    font-weight: 600;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.form-group .required {
    color: var(--danger-red);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--gray-200);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control-inline {
    display: inline-block;
    width: auto;
    min-width: 60px;
    padding: 0.5rem 0.75rem;
    margin: 0 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.25rem;
    background: var(--white);
    font-size: 0.875rem;
}

.form-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

/* Form Error Styles */
.form-control.is-invalid {
    border-color: var(--danger-red);
    background-color: #fef2f2;
}

.form-control.is-invalid:focus {
    border-color: var(--danger-red);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.error-message {
    color: var(--danger-red);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.file-upload-wrapper {
    position: relative;
}

.file-upload-wrapper input[type="file"] {
    padding: 0.875rem 1rem 0.875rem 3.5rem !important;
    border: 2px solid var(--gray-200) !important;
    border-radius: 0.5rem !important;
    font-size: 1rem !important;
    transition: all 0.3s ease !important;
    background: var(--white) !important;
    width: 100% !important;
}

.file-upload-wrapper input[type="file"]:focus {
    outline: none !important;
    border-color: var(--primary-blue) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
}

.role-pk .file-upload-wrapper input[type="file"]:focus {
    border-color: var(--success-green) !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

/* ============================================
   DETAIL VIEW
   ============================================ */

.detail-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--gray-200);
}

.detail-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.detail-section .section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-blue);
}

.detail-section .section-header i {
    font-size: 1.25rem;
    color: var(--primary-blue);
}

.detail-section .section-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.detail-item label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 1rem;
    color: var(--gray-800);
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: 0.5rem;
    border: 1px solid var(--gray-200);
    min-height: 2.5rem;
    display: flex;
    align-items: center;
}

.detail-value:empty::before {
    content: '-';
    color: var(--gray-400);
}

/* Quill Content Styling - Render HTML properly */
.quill-content {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.quill-content h1,
.quill-content h2,
.quill-content h3,
.quill-content h4,
.quill-content h5,
.quill-content h6 {
    margin: 1rem 0 0.5rem 0;
    font-weight: 600;
    color: var(--gray-900);
    line-height: 1.4;
}

.quill-content h1 {
    font-size: 1.75rem;
}

.quill-content h2 {
    font-size: 1.5rem;
}

.quill-content h3 {
    font-size: 1.25rem;
}

.quill-content h4 {
    font-size: 1.125rem;
}

.quill-content h5 {
    font-size: 1rem;
}

.quill-content h6 {
    font-size: 0.875rem;
}

.quill-content p {
    margin: 0.75rem 0;
    line-height: 1.6;
    color: var(--gray-700);
}

.quill-content ul,
.quill-content ol {
    margin: 0.75rem 0;
    padding-left: 2rem;
    line-height: 1.6;
    color: var(--gray-700);
}

.quill-content li {
    margin: 0.5rem 0;
}

.quill-content strong,
.quill-content b {
    font-weight: 600;
    color: var(--gray-900);
}

.quill-content em,
.quill-content i {
    font-style: italic;
}

.quill-content u {
    text-decoration: underline;
}

.quill-content s,
.quill-content strike {
    text-decoration: line-through;
}

.quill-content blockquote {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    border-left: 4px solid var(--primary-blue);
    background: var(--gray-50);
    color: var(--gray-700);
    font-style: italic;
}

.quill-content code {
    background: var(--gray-100);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: var(--gray-800);
}

.quill-content pre {
    background: var(--gray-100);
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.quill-content pre code {
    background: none;
    padding: 0;
}

.quill-content a {
    color: var(--primary-blue);
    text-decoration: underline;
}

.quill-content a:hover {
    color: var(--primary-blue-dark);
}

.quill-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

.quill-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.quill-content table th,
.quill-content table td {
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
}

.quill-content table th {
    background: var(--gray-100);
    font-weight: 600;
}

/* Quill font classes */
.quill-content .ql-font-serif {
    font-family: Georgia, serif;
}

.quill-content .ql-font-monospace {
    font-family: 'Courier New', monospace;
}

/* Quill size classes */
.quill-content .ql-size-small {
    font-size: 0.875rem;
}

.quill-content .ql-size-large {
    font-size: 1.25rem;
}

.quill-content .ql-size-huge {
    font-size: 1.5rem;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-blue);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-blue-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

/* Warna hijau untuk button primary role PK */
.role-pk .btn-primary {
    background: var(--success-green);
}

.role-pk .btn-primary:hover {
    background: #059669;
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-info {
    background: #0ea5e9;
    color: var(--white);
}

.btn-info:hover {
    background: #0284c7;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(14, 165, 233, 0.3);
}

/* Warna hijau untuk button info role PK */
.role-pk .btn-info {
    background: var(--success-green);
}

.role-pk .btn-info:hover {
    background: #059669;
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background: var(--danger-red);
    color: var(--white);
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-icon {
    padding: 0.5rem;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
}

.btn-icon a,
a.btn-icon {
    text-decoration: none !important;
}

/* ============================================
   TABLES
   ============================================ */

.table-responsive {
    overflow-x: auto;
}

/* Styling untuk tabel biasa (bukan DataTables) */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    background: var(--white);
    border-radius: 0.5rem;
    overflow: hidden;
}

.table thead {
    background: var(--gray-50);
}

.table th {
    padding: 0.875rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.875rem;
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
    background: var(--gray-50);
}

.table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-700);
    font-size: 0.875rem;
}

.table tbody tr:hover {
    background: var(--gray-50);
}

.table-striped tbody tr:nth-of-type(odd) {
    background: var(--white);
}

.table-striped tbody tr:nth-of-type(even) {
    background: var(--gray-50);
}

.table-bordered {
    border: 1px solid var(--gray-200);
}

.table-bordered th,
.table-bordered td {
    border: 1px solid var(--gray-200);
}

.table-bordered thead th {
    border-bottom: 2px solid var(--gray-300);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.data-table thead {
    background: var(--gray-50);
}

.data-table th {
    padding: 0.875rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.875rem;
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
    background: var(--gray-50);
}

.data-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-700);
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

.table-info {
    font-size: 0.875rem;
    color: var(--gray-600);
    font-weight: 500;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pagination button,
.pagination a,
.pagination-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-300);
    background: var(--white);
    color: var(--gray-700);
    border-radius: 0.25rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    min-width: 36px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pagination button:hover:not(:disabled),
.pagination a:hover,
.pagination-btn:hover {
    background: var(--gray-50);
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination .active,
.pagination-btn.active {
    background: var(--primary-blue);
    color: var(--white);
    border-color: var(--primary-blue);
}

.pagination .page-info {
    padding: 0.5rem 0.75rem;
    color: var(--gray-600);
    font-size: 0.875rem;
}

/* ============================================
   ACTION BUTTONS
   ============================================ */

.action-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Memastikan semua link di dalam tabel tidak memiliki underline */
.data-table a,
.data-table .btn-icon,
.data-table .action-buttons a,
.data-table .action-buttons .btn-icon {
    text-decoration: none !important;
    border-bottom: none !important;
}

.data-table a:hover,
.data-table a:focus,
.data-table a:active,
.data-table a:link,
.data-table a:visited {
    text-decoration: none !important;
    border-bottom: none !important;
}

.action-buttons a,
.action-buttons .btn-icon,
.action-buttons a.btn-icon,
.action-buttons a:hover,
.action-buttons a:focus,
.action-buttons a:active,
.action-buttons a:link,
.action-buttons a:visited {
    text-decoration: none !important;
    border-bottom: none !important;
    outline: none !important;
}

/* Memastikan untuk semua role - khusus kepala_bapas */
.role-admin .action-buttons a,
.role-admin .action-buttons .btn-icon,
body:not(.role-pk) .action-buttons a,
body:not(.role-pk) .action-buttons .btn-icon,
body.role-admin .action-buttons a,
body.role-admin .action-buttons .btn-icon,
body.role-admin .action-buttons a.btn-icon,
body.role-admin .action-buttons a:hover,
body.role-admin .action-buttons a:focus,
body.role-admin .action-buttons a:active,
body.role-admin .action-buttons a:link,
body.role-admin .action-buttons a:visited {
    text-decoration: none !important;
    border-bottom: none !important;
    outline: none !important;
}

.btn-view {
    color: var(--primary-blue);
    background: rgba(37, 99, 235, 0.1);
    border: none;
    text-decoration: none !important;
}

/* Warna hijau untuk button view role PK */
.role-pk .btn-view {
    color: var(--success-green);
    background: rgba(16, 185, 129, 0.1);
    text-decoration: none !important;
}

/* Make btn-view consistent everywhere */
.action-buttons .btn-view {
    color: var(--primary-blue);
    background: rgba(37, 99, 235, 0.1);
}

.role-pk .action-buttons .btn-view {
    color: var(--success-green);
    background: rgba(16, 185, 129, 0.1);
}

.role-pk .btn-view:hover,
.role-pk .btn-view:focus,
.role-pk .btn-view:active {
    text-decoration: none !important;
    border-bottom: none !important;
}

.btn-edit {
    color: var(--warning-yellow);
    background: rgba(245, 158, 11, 0.1);
    border: none;
}

.btn-delete {
    color: var(--danger-red);
    background: rgba(239, 68, 68, 0.1);
    border: none;
}

.btn-download {
    color: var(--success-green);
    background: rgba(16, 185, 129, 0.1);
    border: none;
}

.btn-view:hover,
.btn-edit:hover,
.btn-delete:hover,
.btn-download:hover {
    opacity: 0.8;
    transform: scale(1.1);
    text-decoration: none !important;
    border-bottom: none !important;
}

/* Khusus untuk role kepala_bapas - memastikan tidak ada underline */
body.role-admin .btn-view,
body.role-admin .btn-edit,
body.role-admin .btn-delete,
body.role-admin .btn-download,
body.role-admin .btn-icon,
body:not(.role-pk) .btn-view,
body:not(.role-pk) .btn-edit,
body:not(.role-pk) .btn-delete,
body:not(.role-pk) .btn-download,
body:not(.role-pk) .btn-icon {
    text-decoration: none !important;
    border-bottom: none !important;
}

body.role-admin .btn-view:hover,
body.role-admin .btn-edit:hover,
body.role-admin .btn-delete:hover,
body.role-admin .btn-download:hover,
body.role-admin .btn-icon:hover,
body:not(.role-pk) .btn-view:hover,
body:not(.role-pk) .btn-edit:hover,
body:not(.role-pk) .btn-delete:hover,
body:not(.role-pk) .btn-download:hover,
body:not(.role-pk) .btn-icon:hover {
    text-decoration: none !important;
    border-bottom: none !important;
}

.btn-icon {
    border-radius: 0.25rem;
    transition: all 0.2s ease;
    text-decoration: none !important;
    border-bottom: none !important;
}

.btn-icon:hover {
    transform: scale(1.1);
    text-decoration: none !important;
    border-bottom: none !important;
}

.btn-icon i {
    text-decoration: none !important;
}

/* Global: Pastikan semua link di dalam btn-icon tidak memiliki underline */
a.btn-icon,
a.btn-icon:hover,
a.btn-icon:focus,
a.btn-icon:active,
a.btn-icon:link,
a.btn-icon:visited {
    text-decoration: none !important;
    border-bottom: none !important;
}

/* Khusus untuk role kepala_bapas */
body.role-admin a.btn-icon,
body:not(.role-pk) a.btn-icon {
    text-decoration: none !important;
    border-bottom: none !important;
}

/* ============================================
   FORM ACTIONS
   ============================================ */

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Tablet dan Mobile (max-width: 1024px) */
@media (max-width: 1024px) {
    .main-content {
        padding: 1.5rem;
    }

    .header {
        padding: 1rem 1.5rem;
        position: -webkit-sticky !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 999 !important;
        background: var(--white) !important;
        flex-shrink: 0 !important;
    }

    .header-title h2 {
        font-size: 1.25rem;
    }

    .header-title p {
        font-size: 0.8rem;
    }
}

/* Tablet (max-width: 768px) */
@media (max-width: 768px) {

    /* Login Page */
    .login-container {
        flex-direction: column;
    }

    .login-left {
        min-height: 40vh;
    }

    .login-right {
        padding: 2rem 1.5rem;
    }

    .login-form-container {
        max-width: 100%;
    }

    /* Pastikan semua container full width */
    .container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 1rem;
    }

    /* Pastikan semua card dan container full width */
    .card,
    .table-card,
    .stat-card,
    .page-header,
    .form-actions,
    .table-footer {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    /* Pastikan semua table responsive */
    .data-table-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table {
        width: 100% !important;
        min-width: 100%;
    }

    /* Pastikan semua wrapper full width */
    .stats-grid,
    .dashboard-tables {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Pastikan form elements full width */
    .form-row,
    .form-group,
    .form-control,
    .input-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    /* Pastikan semua card dan container full width */
    .card,
    .table-card,
    .stat-card {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Pastikan semua table responsive */
    .data-table-wrapper {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table {
        width: 100%;
        min-width: 100%;
    }

    /* Main Layout */
    .main-layout {
        position: relative;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Sidebar - Hidden by default, show as overlay when active */
    .sidebar {
        position: fixed !important;
        left: -100% !important;
        top: 0 !important;
        width: 280px !important;
        height: 100vh !important;
        z-index: 1001 !important;
        transition: left 0.3s ease !important;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1) !important;
        background: var(--white) !important;
        margin-left: 0 !important;
        visibility: visible !important;
        opacity: 1 !important;
        display: flex !important;
        transform: translateX(0) !important;
        flex-direction: column !important;
        justify-content: space-between !important;
    }

    .sidebar.active {
        left: 0 !important;
        visibility: visible !important;
        opacity: 1 !important;
        display: flex !important;
        transform: translateX(0) !important;
        flex-direction: column !important;
        height: 100vh !important;
        overflow: hidden !important;
        justify-content: flex-start !important;
    }

    /* Sidebar Nav - Scrollable area */
    .sidebar-nav {
        flex: 1 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        min-height: 0 !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* Sidebar Footer - Sticky at bottom, always visible */
    .sidebar-footer {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: sticky !important;
        bottom: 0 !important;
        z-index: 10 !important;
        flex-shrink: 0 !important;
        width: 100% !important;
        background: var(--white) !important;
        border-top: 1px solid var(--gray-200) !important;
        padding: 0 !important;
        margin-top: auto !important;
        box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.05) !important;
    }

    .sidebar-footer .nav-item {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        padding: 1rem 1.5rem !important;
        color: var(--danger-red) !important;
        align-items: center !important;
        gap: 1rem !important;
    }

    .sidebar-footer .nav-item i,
    .sidebar-footer .nav-item span {
        display: inline-block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .sidebar-footer .nav-item i {
        font-size: 1rem !important;
    }

    .sidebar-footer .nav-item span {
        font-size: 0.9rem !important;
    }

    /* Ensure body overflow doesn't hide fixed sidebar */
    body {
        overflow-x: hidden !important;
    }

    body.sidebar-open {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
    }

    /* Overlay untuk sidebar di mobile */
    .sidebar-overlay {
        display: none !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        background: rgba(0, 0, 0, 0.5) !important;
        z-index: 1000 !important;
        opacity: 0 !important;
        transition: opacity 0.3s ease, display 0s 0.3s !important;
        cursor: pointer !important;
    }

    .sidebar-overlay.active {
        display: block !important;
        opacity: 1 !important;
        transition: opacity 0.3s ease, display 0s 0s !important;
    }

    /* Content wrapper - full width di mobile */
    .content-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden;
        overflow-y: visible !important;
        position: relative;
        height: 100vh;
        display: flex !important;
        flex-direction: column !important;
    }

    .main-layout.sidebar-collapsed .content-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Header - More compact and sticky */
    .header {
        padding: 1rem;
        flex-wrap: wrap;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        position: -webkit-sticky !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 999 !important;
        background: var(--white) !important;
        flex-shrink: 0 !important;
        align-self: flex-start !important;
        margin: 0 !important;
    }

    /* Ensure main-content is scrollable container for sticky to work */
    .main-content {
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch;
    }

    .header-left {
        flex: 1;
        min-width: 0;
    }

    .header-title {
        min-width: 0;
        flex: 1;
    }

    .header-title h2 {
        font-size: 1.1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .header-title p {
        font-size: 0.75rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .header-right {
        flex-shrink: 0;
    }

    .role-badge {
        font-size: 0.75rem;
        padding: 0.4rem 0.75rem;
    }

    .sidebar-toggle {
        font-size: 1.1rem;
        padding: 0.5rem;
        margin-right: 0.5rem;
    }

    /* Main Content */
    .main-content {
        padding: 1rem;
        min-height: calc(100vh - 60px - 60px);
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .main-content h1 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    /* Stats Grid */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .stat-content h3 {
        font-size: 0.875rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .stat-link {
        font-size: 0.75rem;
    }

    /* Dashboard Tables */
    .dashboard-tables {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Page Header */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    /* Forms */
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    .form-group label {
        font-size: 0.875rem;
    }

    .form-control {
        font-size: 0.875rem;
        padding: 0.625rem 0.875rem;
    }

    /* Card Header */
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1rem;
    }

    .card-header h3 {
        font-size: 1.125rem;
    }

    /* Table Footer */
    .table-footer {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    /* Form Actions */
    .form-actions {
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 1.5rem;
        padding-top: 1rem;
    }

    .form-actions .btn {
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    /* Buttons */
    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }

    .btn-sm {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }

    /* Footer */
    .main-footer {
        padding: 1rem !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        z-index: 10 !important;
        background: var(--white) !important;
        border-top: 1px solid var(--gray-200) !important;
        margin-top: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        flex-shrink: 0 !important;
    }

    .footer-content {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .footer-content p {
        font-size: 0.75rem;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* Sidebar Account */
    .sidebar-account {
        padding: 0.75rem 1rem;
    }

    .account-info {
        gap: 0.75rem;
    }

    .account-avatar {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .account-name {
        font-size: 0.875rem;
    }

    .account-role {
        font-size: 0.75rem;
    }

    /* Nav Items */
    .nav-item {
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
    }

    .nav-item i {
        font-size: 1rem;
    }

    /* Data Tables */
    .data-table {
        font-size: 0.875rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }

    /* Quill Editor */
    .quill-editor-container {
        font-size: 0.875rem;
    }

    .quill-editor-container .ql-toolbar {
        padding: 0.5rem;
    }

    .quill-editor-container .ql-toolbar .ql-formats {
        margin-right: 0.5rem;
    }

    .quill-editor-container .ql-container {
        font-size: 0.875rem;
        min-height: 150px;
    }

    .quill-editor-container .ql-editor {
        min-height: 150px;
        padding: 0.75rem;
    }
}

/* Mobile (max-width: 480px) */
@media (max-width: 480px) {

    /* Login */
    .login-left {
        min-height: 30vh;
    }

    .login-right {
        padding: 1.5rem 1rem;
    }

    .login-form-container h2 {
        font-size: 1.5rem;
    }

    /* Header - Sticky for mobile */
    .header {
        padding: 0.75rem;
        position: -webkit-sticky !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 999 !important;
        background: var(--white) !important;
        flex-shrink: 0 !important;
        align-self: flex-start !important;
    }

    .header-title h2 {
        font-size: 1rem;
    }

    .header-title p {
        font-size: 0.7rem;
    }

    .role-badge {
        font-size: 0.7rem;
        padding: 0.35rem 0.6rem;
    }

    .role-badge i {
        font-size: 0.7rem;
    }

    /* Main Content */
    .main-content {
        padding: 0.75rem;
    }

    .main-content h1 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }

    /* Sidebar */
    .sidebar {
        width: 260px;
    }

    .sidebar-header {
        padding: 1rem;
    }

    .sidebar-header .logo-icon {
        width: 40px;
        height: 40px;
    }

    .sidebar-header .logo-text h1 {
        font-size: 0.85rem;
    }

    .sidebar-header .logo-text p {
        font-size: 0.6rem;
    }

    /* Stats */
    .stat-card {
        padding: 0.875rem;
    }

    .stat-icon {
        width: 45px;
        height: 45px;
        font-size: 1.25rem;
    }

    .stat-content h3 {
        font-size: 0.8rem;
    }

    .stat-number {
        font-size: 1.25rem;
    }

    /* Buttons */
    .btn {
        padding: 0.625rem 0.875rem;
        font-size: 0.8rem;
    }

    /* Cards */
    .card {
        padding: 1rem;
    }

    .card-header {
        padding: 0.875rem;
    }

    .card-header h3 {
        font-size: 1rem;
    }

    /* Forms */
    .form-control {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }

    /* Tables */
    .data-table {
        font-size: 0.8rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.4rem;
    }

    /* Badges */
    .badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }

    /* Footer */
    .main-footer {
        padding: 0.75rem !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        z-index: 10 !important;
        background: var(--white) !important;
        border-top: 1px solid var(--gray-200) !important;
        margin-top: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        flex-shrink: 0 !important;
    }

    .footer-content {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        text-align: center !important;
    }

    .footer-content p {
        font-size: 0.7rem;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        margin: 0.25rem 0 !important;
    }
}

/* Small Mobile (max-width: 360px) */
@media (max-width: 360px) {
    .header-title h2 {
        font-size: 0.9rem;
    }

    .main-content h1 {
        font-size: 1.1rem;
    }

    .stat-number {
        font-size: 1.1rem;
    }

    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }

    .form-control {
        font-size: 0.75rem;
    }
}


/* ============================================
   MODERN FILE UPLOAD
   ============================================ */

.modern-file-upload {
    position: relative;
    width: 100%;
    margin-bottom: 1rem;
}

.file-drop-area {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 250px;
    padding: 2rem;
    border: 2px dashed var(--gray-300);
    border-radius: 0.75rem;
    background-color: var(--gray-50);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    overflow: hidden;
}

.file-drop-area.is-dragover {
    border-color: var(--primary-blue);
    background-color: rgba(37, 99, 235, 0.05);
    transform: scale(1.01);
}

.file-drop-area.has-preview {
    border-style: solid;
    border-color: var(--gray-300);
    padding: 0;
    /* Remove padding to let image fill if needed, though image-preview-area covers it */
}

.file-drop-area.has-preview .upload-content {
    display: none;
}

.file-drop-area:hover {
    border-color: var(--primary-blue-light);
    background-color: var(--white);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.file-input {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s ease;
    z-index: 5;
    pointer-events: none;
    /* Let clicks pass through to input */
}

.upload-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 1.5rem;
    color: var(--gray-400);
    transition: all 0.3s ease;
    background: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.upload-icon i {
    font-size: 2rem;
}

.file-drop-area:hover .upload-icon {
    color: var(--primary-blue);
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.upload-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.upload-hint {
    font-size: 0.875rem;
    color: var(--gray-500);
    max-width: 80%;
    line-height: 1.5;
}

.browse-btn {
    color: var(--primary-blue);
    font-weight: 600;
    position: relative;
    z-index: 6;
    pointer-events: none;
}

/* Preview Area */
.image-preview-area {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    background-color: var(--gray-50);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.image-preview-area.has-image {
    display: flex;
}

.preview-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.remove-image-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--white);
    border: 1px solid var(--gray-200);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--danger-red);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    z-index: 25;
    transition: all 0.2s ease;
}

.remove-image-btn:hover {
    transform: scale(1.1);
    background: var(--danger-red);
    color: var(--white);
    border-color: var(--danger-red);
}

.file-info {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    pointer-events: none;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-preview-area:hover .file-info {
    opacity: 1;
}