/* === START: Global Variables & Body === */
:root {
    --kkc-primary: #0b3d91;
    --kkc-secondary: #d98310;
    --kkc-light: #f8f9fa;
    --kkc-dark: #212529;
}

body {
    font-size: .875rem;
    background-color: #f5f7f9;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* === END: Global === */


/* === START: Main Layout (Navbar & Sidebar) === */
.navbar {
    background-color: var(--kkc-primary);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    z-index: 1020;
    /* Ensure navbar is above the sidebar */
}

.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    /* Behind navbar */
    padding: 48px 0 0;
    /* Match navbar height */
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
    background-color: var(--kkc-dark);
}

.sidebar-sticky {
    height: calc(100vh - 48px);
    overflow-x: hidden;
    overflow-y: auto;
    /* Enable scrolling for the sidebar if its content is tall */
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.75rem 1rem;
}

.sidebar .nav-link:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link.active {
    color: white;
    background-color: var(--kkc-secondary);
}

.navbar-toggler {
    padding: 0.25rem 0.75rem;
    font-size: 1.25rem;
    line-height: 1;
    background-color: black;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 0.25rem;
    transition: box-shadow 0.15s ease-in-out;
}

.navbar-toggler:focus {
    text-decoration: none;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25);
}

/* === END: Main Layout === */


/* === START: Components (Cards, Tables, Buttons, etc.) === */
.card {
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    border: none;
}

.card-header {
    background-color: var(--kkc-primary);
    color: white;
    border-radius: 8px 8px 0 0 !important;
}

.logo-container {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 15px 20px 15px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.logo-img {
    max-width: 100%;
    height: auto;
    max-height: 80px;
}

.card .table th,
.card .table td {
    vertical-align: middle;
}

thead th a {
    color: inherit;
    text-decoration: none;
    margin-left: 5px;
}

.required-field::after {
    content: " *";
    color: red;
}

.btn-kkc {
    background-color: var(--kkc-secondary);
    color: white;
}

.btn-kkc:hover {
    background-color: #bf7410;
    color: white;
}

/* Styling for Dashboard Stat Cards */
.stat-card {
    text-align: center;
    padding: 20px;
    border-radius: 8px;
    background-color: #fff;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.12);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--kkc-primary);
}

.stat-title {
    font-size: 1rem;
    color: #6c757d;
    margin-top: 5px;
}

/* === NEW: Badge Styles for Activity Log Actions === */
.action-create,
.action-user_created,
.action-data_exported {
    /* Uses underscore */
    display: inline-block;
    padding: 0.25em 0.6em;
    font-size: 0.85em;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.375rem;
    color: #fff;
    background-color: #198754;
    /* Green */
}

.action-update,
.action-user_updated,
.action-report_generated,
.action-report_viewed {
    /* Uses underscore */
    display: inline-block;
    padding: 0.25em 0.6em;
    font-size: 0.85em;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.375rem;
    color: #fff;
    background-color: #0d6efd;
    /* Blue */
}

.action-delete,
.action-user_deleted,
.action-report_deleted {
    /* Uses underscore */
    display: inline-block;
    padding: 0.25em 0.6em;
    font-size: 0.85em;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.375rem;
    color: #fff;
    background-color: #dc3545;
    /* Red */
}

/* Gray for standard session events */
.action-login,
.action-logout {
    display: inline-block;
    padding: 0.25em 0.6em;
    font-size: 0.85em;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.375rem;
    color: #fff;
    background-color: #6c757d;
}

/* Yellow/Warning for Timeout events */
.action-timeout {
    display: inline-block;
    padding: 0.25em 0.6em;
    font-size: 0.85em;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.375rem;
    color: #000;
    background-color: #ffc107;
}

/* === END: New Log Styles & Other Components === */


/* --- Custom Styles for Sidebar COLLAPSIBLE Sub-menu --- */
.sidebar a[data-bs-toggle="collapse"] {
    position: relative;
}

.sidebar a[data-bs-toggle="collapse"]::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free', FontAwesome;
    font-weight: 900;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.2s ease-in-out;
}

.sidebar a[aria-expanded="true"]::after {
    transform: translateY(-50%) rotate(-180deg);
}

.sidebar .collapse .nav-link {
    padding-left: 3rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.65);
}

/* --- END: Sidebar Collapsible Styles --- */

/* --- Styles for Collapsible Dashboard Panels --- */
.card-header[data-bs-toggle="collapse"] {
    cursor: pointer;
    position: relative;
}

.card-header[data-bs-toggle="collapse"] .fa-chevron-down {
    transition: transform 0.2s ease-in-out;
}

.card-header[data-bs-toggle="collapse"]:not(.collapsed) .fa-chevron-down {
    transform: rotate(-180deg);
}

/* --- END: Collapsible Panel Styles --- */

/* --- Style for Clickable Dashboard List Items --- */
.dashboard-list-item {
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

.dashboard-list-item:hover {
    background-color: #f8f9fa;
    /* A light gray for hover effect */
}

/* --- Styles for PMS Notification Dropdown --- */
.pms-dropdown {
    width: 350px;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.175);
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 0.5rem;
}

.pms-dropdown .dropdown-item {
    white-space: normal;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #dee2e6;
}

.pms-dropdown .dropdown-item:last-child {
    border-bottom: none;
}

.pms-dropdown-reason {
    font-size: 0.85em;
}

.pms-dropdown .dropdown-header {
    font-weight: bold;
    color: var(--kkc-primary);
}