/* --------------------------------------------------
   GLOBAL BASE STYLES
-------------------------------------------------- */
html, body {
    font-family: 'Inter', 'Segoe UI', 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--light-bg);
    color: #334155;
    overflow-x: hidden;
}

/* Fade-in animation for smooth component entry */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* --------------------------------------------------
   LOGIN PAGE STYLES (Refined)
-------------------------------------------------- */

.login-background {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
    animation: fadeIn 0.8s ease-out;
    background: linear-gradient(to right, #203a43, #2c5364);
    padding: 16px; /* responsive padding for small screens */
}

.login-container {
    background-color: #ffffff;
    box-shadow: var(--shadow-lg);
    max-width: 400px;
    width: 100%;
    border-radius: 14px;
    padding: 40px 28px;
    text-align: left;
    animation: fadeIn 1s ease-out;
    transition: var(--transition);
}

    .login-container:hover {
        transform: translateY(-3px);
        box-shadow: var(--shadow-md);
    }

.login-logo {
    display: block;
    margin: 0 auto 28px auto;
    max-width: 130px;
    height: auto;
}

/* Input fields */
.login-container input[type="text"],
.login-container input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 18px;
    border: 1px solid #e2e8f0;
    border-radius: var(--border-radius);
    font-size: 15px;
    background-color: #f9fafb;
    transition: var(--transition);
    outline: none;
    box-sizing: border-box;
}

.login-container input:focus {
    border-color: var(--primary-color);
    background-color: #ffffff;
    box-shadow: 0 0 0 2px rgba(94, 40, 212, 0.2);
}

/* Login button */
.login-container button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(to right, #5E28D4, #7C4FDE);
    color: #ffffff;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

    .login-container button:hover {
        background: linear-gradient(to right, #7C4FDE, #5E28D4);
        transform: scale(1.03);
    }

/* Links below login */
.login-links {
    margin-top: 18px;
    text-align: center;
    font-size: 14px;
    color: #64748b;
}

    .login-links a {
        color: var(--primary-dark);
        text-decoration: none;
        margin: 0 8px;
        transition: all 0.25s ease;
    }

        .login-links a:hover {
            color: #3D1A89; /* darker purple */
            text-decoration: underline;
        }

/* Footer text */
.login-footer {
    margin-top: 28px;
    font-size: 13px;
    color: #6b7280;
    text-align: center;
    line-height: 1.6;
}

    .login-footer strong {
        color: var(--primary-dark);
        font-weight: 600;
    }

/* Responsive adjustments */
@media (max-width: 500px) {
    .login-container {
        padding: 32px 20px;
    }

    .login-logo {
        max-width: 110px;
        margin-bottom: 24px;
    }

    .login-links {
        font-size: 13px;
    }
}

/* --------------------------------------------------
   BUTTON STYLES
-------------------------------------------------- */
.btn-primary, .btn-danger {
    border: none;
    border-radius: var(--border-radius);
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

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

    .btn-primary:hover {
        background: var(--primary-dark);
    }

.btn-danger {
    background-color: #dc2626;
    color: white;
}

    .btn-danger:hover {
        background-color: #b91c1c;
    }

/* --------------------------------------------------
   TILE CARD STYLES
-------------------------------------------------- */
.tile-card {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border: 1px solid #cbd5e1;
    width: 200px;
    height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 15px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    animation: fadeIn 1s ease-out;
}

    .tile-card:hover {
        transform: translateY(-5px);
        box-shadow: var(--shadow-lg);
        background: linear-gradient(135deg, #e0e7ef, #d1dbe5);
    }

    .tile-card i {
        font-size: 40px;
        margin-bottom: 10px;
        color: var(--primary-color);
    }

    .tile-card h5 {
        color: #334155;
        font-size: 14px;
        margin: 0;
    }

.tile-nextline {
    font-size: 12px;
    color: #64748b;
}

/* --------------------------------------------------
   TABLE STYLES
-------------------------------------------------- */
.custom-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: white;
    box-shadow: var(--shadow-sm);
    font-size: 13px;
}

    .custom-table thead {
        background: var(--primary-dark);
        color: white;
        text-transform: uppercase;
        font-weight: 600;
    }

        .custom-table thead th {
            padding: 10px;
            text-align: left;
            font-size: 12px;
            border-bottom: 1px solid #e2e8f0;
        }

    .custom-table tbody tr {
        border-bottom: 1px solid #e2e8f0;
        transition: var(--transition);
    }

        .custom-table tbody tr:hover {
            background-color: #f8fafc;
        }

    .custom-table td {
        padding: 10px;
        color: #475569;
        font-size: 13px;
    }

/* Dashboard Cards */
.dashboard-card {
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .dashboard-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    }

/* Icon Boxes */
.icon-box {
    width: 56px;
    height: 56px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 12px;
}

/* Custom Badge Colors */
.badge-success-custom {
    background: #5E28D4; /* deep purple */
    color: #fff;
}

.badge-danger-custom {
    background: #A855F7; /* lighter purple accent */
    color: #fff;
}

.badge-warning-custom {
    background: #9CA3AF; /* grayish */
    color: #111;
}

.badge-info-custom {
    background: #7C3AED; /* violet-blue */
    color: #fff;
}

/* Table Hover */
.data-table tbody tr:hover {
    background: #F3F4F6;
}

/* Table Styling */
.data-table th {
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.data-table td {
    font-size: 0.9rem;
    color: #4B5563;
}

.glass-card {
    background: linear-gradient(145deg, #ffffff 0%, #f3f4f7 100%);
    border-radius: 20px;
    padding: 35px 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
    transition: all 0.35s ease;
    color: #212529;
}

.glass-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(0,123,255,0.15), rgba(0,255,255,0.1));
    opacity: 0;
    transition: opacity 0.35s ease;
}

.glass-card:hover::before {
    opacity: 1;
}

.glass-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 12px 25px rgba(0,0,0,0.15);
}

.card-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #fff;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    margin-bottom: 20px;
    transition: all 0.4s ease;
}

.glass-card:hover .card-icon {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.card-content h5 {
    font-weight: 700;
    margin-bottom: 5px;
    letter-spacing: 0.3px;
}

.card-content p {
    font-size: 0.9rem;
    color: #6c757d;
    margin: 0;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, #007bff, #00c6ff);
}
.bg-gradient-success {
    background: linear-gradient(135deg, #28a745, #00e676);
}
.bg-gradient-warning {
    background: linear-gradient(135deg, #ffc107, #ff8f00);
}

@media (max-width: 768px) {
    .glass-card {
        padding: 25px 15px;
    }
    .card-icon {
        width: 65px;
        height: 65px;
        font-size: 1.7rem;
    }
}

.modern-table-card {
    background: linear-gradient(145deg, #ffffff, #f3f4f7);
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.table-header {
    background: linear-gradient(135deg, #007bff, #00c6ff);
    color: #fff;
    padding: 1rem 1.5rem;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}

.table-header h5 {
    margin: 0;
    font-weight: 600;
    display: flex;
    align-items: center;
}

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

.modern-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.95rem;
    color: #333;
}

.modern-table thead tr {
    background: rgba(0, 123, 255, 0.05);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.8rem;
}

.modern-table th,
.modern-table td {
    padding: 1rem 1.25rem;
    text-align: left;
}

.modern-table th {
    color: #0d6efd;
    font-weight: 700;
    border-bottom: 2px solid rgba(0, 123, 255, 0.15);
}

.modern-table tbody tr {
    transition: all 0.3s ease;
}

.modern-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(13,110,253,0.06), rgba(0,255,255,0.05));
    transform: scale(1.01);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.modern-table tbody td {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    vertical-align: middle;
}

.table-link {
    color: #0d6efd;
    text-decoration: none;
    transition: all 0.2s ease;
}

.table-link:hover {
    color: #0070f3;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .modern-table thead {
        display: none;
    }

    .modern-table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border-radius: 10px;
        background: #fff;
        box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
    }

    .modern-table td {
        display: flex;
        justify-content: space-between;
        padding: 0.75rem 1rem;
    }

    .modern-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #0d6efd;
    }
}

.dataTables_length,
.dataTables_info {
    color: #333;
    font-size: 0.9rem;
    margin: 10px 15px;
}

.dataTables_length select {
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 5px 10px;
    background: #fff;
    color: #333;
    transition: all 0.3s ease;
}

.dataTables_length select:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 5px rgba(13, 110, 253, 0.3);
}

.dataTables_paginate {
    margin: 15px;
    display: flex;
    justify-content: center;
    gap: 6px;
}

.dataTables_paginate .paginate_button {
    border: none !important;
    border-radius: 10px !important;
    background: #ffffff !important;
    color: #333 !important;
    padding: 6px 12px !important;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.dataTables_paginate .paginate_button:hover {
    background: linear-gradient(135deg, #007bff, #00c6ff) !important;
    color: #fff !important;
    transform: translateY(-2px);
}

.dataTables_paginate .paginate_button.current {
    background: linear-gradient(135deg, #007bff, #00c6ff) !important;
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.25);
}

.dataTables_filter {
    display: none !important;
}

.dataTables_info {
    color: #6c757d;
    font-size: 0.85rem;
}

.dataTables_processing {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(6px);
    border-radius: 10px;
    padding: 10px 20px;
    color: #0d6efd;
    font-weight: 500;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

/* ============================ */
/* GLOBAL ROLE MANAGEMENT STYLES */
/* ============================ */

/* Page Header Modern */
.page-header-modern {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 16px;
    padding: 2rem;
    color: white;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.2);
}

.page-icon-wrapper {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-right: 1.5rem;
}

.page-title-modern {
    font-size: 1.75rem;
    font-weight: 700;
}

.page-subtitle-modern {
    font-size: 0.95rem;
    opacity: 0.9;
}

/* Modern Nav Pills */
.nav-pills-modern .nav-link {
    border-radius: 10px;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: all 0.2s ease;
}

.nav-pills-modern .nav-link:hover {
    background: var(--primary-light);
}

.nav-pills-modern .nav-link.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Role List Items */
.role-item {
    cursor: pointer;
    transition: all 0.2s ease;
}

.role-item:hover {
    background-color: var(--primary-light) !important;
    border-color: var(--primary-color) !important;
}

.role-item.active {
    background-color: var(--primary-color) !important;
    color: white !important;
    border-color: var(--primary-color) !important;
}

.role-item.active * {
    color: white !important;
}

/* Permission Cards */
.permission-card {
    cursor: pointer;
    transition: all 0.2s ease;
    border-color: var(--border-color) !important;
}

.permission-card:hover {
    border-color: var(--primary-color) !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.permission-card.checked {
    background-color: var(--primary-light) !important;
    border-color: var(--primary-color) !important;
}

.permission-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
}

/* Avatar Circle */
.avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
}

/* Responsive Table */
@media (max-width: 768px) {
    .custom-table thead {
        display: none;
    }

    .custom-table tbody tr {
        display: block;
        margin-bottom: 8px;
        border: 1px solid #ddd;
        border-radius: 6px;
        padding: 6px;
        box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.08);
    }

    .custom-table tbody td {
        display: block;
        text-align: right;
        font-size: 12px;
        position: relative;
        padding-left: 45%;
    }

        .custom-table tbody td::before {
            content: attr(data-label);
            position: absolute;
            left: 8px;
            font-weight: bold;
            text-transform: uppercase;
            color: #343a40;
        }
}
