:root {
    --primary-color: #F97316;
    --primary-hover: #EA580C;
    --primary-light: #FFF7ED;
    --secondary-color: #4B5563;
    --background-color: linear-gradient(129deg,rgba(18, 18, 18, 1) 0%, rgba(13, 26, 46, 1) 50%, rgba(66, 55, 38, 1) 100%);
    --surface-color: #FFFFFF;
    --border-radius: 6px;
    --box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
    --box-shadow-hover: rgba(0, 0, 0, 0.479) 0px 5px 15px;
    --transition: all 0.2s ease-in-out;
    --sidebar-width: 250px;
    --header-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--background-color);
    color: #111827;
    line-height: 1.6;
    font-size: 14px;
}

/* Disable transitions during initial render */
.no-transition * {
    transition: none !important;
}

body:not(.loaded) .main-content,
body:not(.loaded) .content-area,
body:not(.loaded) .sidebar {
    transition: none !important;
}

/* Loader styles */
.loader {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: spin 1s linear infinite;
    z-index: 1200;
    display: none;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.loading .loader {
    display: block;
}

.loading #dashboardPage,
.loading #loginPage {
    opacity: 0;
}

/* Login Page Styles */
.login-container {
    min-height: 100vh;
    background: var(--background-color);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.login-card {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 28px;
    box-shadow: var(--box-shadow);
    width: 100%;
    max-width: 380px;
    transition: var(--transition);
}

.login-logo {
    text-align: center;
    margin-bottom: 20px;
}

.login-logo h1 {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 26px;
    margin-bottom: 4px;
}

.login-logo p {
    color: var(--secondary-color);
    font-size: 13px;
    margin: 0;
}

/* Dashboard Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: var(--surface-color);
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    transform: translateX(-100%);
    transition: var(--transition);
    z-index: 1000;
    overflow-y: auto;
}

.sidebar.active {
    transform: translateX(0);
    box-shadow: var(--box-shadow);
}

.sidebar-header {
    padding: 18px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.sidebar-header h3 {
    color: var(--primary-color);
    margin: 0;
    font-weight: 600;
    font-size: 18px;
}

.sidebar-nav {
    padding: 10px 0;
}

.sidebar-nav .nav-link {
    color: var(--secondary-color);
    padding: 8px 18px;
    display: flex;
    align-items: center;
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    margin: 0 8px;
    border-radius: 4px;
    transition: var(--transition);
}

.sidebar-nav .nav-link:hover {
    background: var(--primary-light);
    color: var(--primary-color);
    transform: translateX(3px);
}

.sidebar-nav .nav-link.active {
    background: var(--primary-color);
    color: #FFFFFF;
}

.sidebar-nav .nav-link i {
    margin-right: 8px;
    width: 16px;
    font-size: 15px;
}

.main-content {
    margin-left: 0;
    min-height: 100vh;
    transition: var(--transition);
    background: var(--background-color);
}

.main-content.sidebar-open {
    margin-left: var(--sidebar-width);
}

.top-header {
    background: var(--surface-color);
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 18px;
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 999;
}

.content-area {
    padding: 20px;
    transition: var(--transition);
    transition: opacity 0.3s ease-in-out;
}

.content-area.loading {
    opacity: 0.5;
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
    }

    .main-content.sidebar-open {
        margin-left: 0;
    }

    .sidebar.active + .main-content .content-area {
        transform: translateX(var(--sidebar-width));
    }

    .sidebar:not(.active) + .main-content .content-area {
        transform: translateX(0);
    }
}

.page-section {
    display: none;
}

.page-section.active {
    display: block;
}

.stats-card {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 18px;
    box-shadow: var(--box-shadow);
    margin-bottom: 16px;
    transition: var(--transition);
}

.stats-card:hover {
    box-shadow: var(--box-shadow-hover);
}

.stats-number {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer; /* Add pointer cursor to indicate clickability */
    width: 100%; /* Ensure button fills the column */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.stats-number:hover {
    transform: scale(1.001);
    box-shadow: var(--box-shadow);
    background-color: #ffffff;
}

.stats-number:active {
    background: var(--primary-color); /* Match primary button color on click */
    color: #FFFFFF; /* White text on click for contrast */
    border-color: var(--primary-color);
}

.stats-number i,
.stats-number h3,
.stats-number p {
    transition: var(--transition); /* Ensure content transitions smoothly */
}

.stats-number:active i,
.stats-number:active h3,
.stats-number:active p {
    color: #FFFFFF; /* Ensure icon and text turn white when clicked */
}

.stats-number i {
    color: var(--primary-color);
    font-size: 32px;
    margin-bottom: 10px;
    display: block;
}

.stats-number h3 {
    color: #111827;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
}

.stats-number p {
    color: var(--secondary-color);
    font-size: 12px;
    font-weight: 500;
    margin: 0;
    letter-spacing: 0.3px;
}

.file-item {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 14px;
    margin-bottom: 10px;
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.file-item:hover {
    box-shadow: var(--box-shadow-hover);
    background-color: #fcfcfc;
    border: 1px solid #ff9100;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 4px;
    transition: var(--transition);
}

.fileslist {
    margin-top: 35px;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: var(--box-shadow);
}

.btn-primary:active {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 4px;
    transition: var(--transition);
}

.btn-outline-primary:hover {
    background-color: var(--primary-light);
    color: var(--primary-hover);
}

.btn-outline-primary:active {
    background-color: var(--primary-color) !important;
    color: #FFFFFF !important;
    border-color: var(--primary-color) !important;
}

.btn-outline-secondary {
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 4px;
    transition: var(--transition);
}

.btn-outline-secondary:active {
    background-color: var(--primary-color) !important;
    color: #FFFFFF !important;
    border-color: var(--primary-color) !important;
}

.btn-secondary {
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 4px;
    transition: var(--transition);
}

.btn-secondary:active {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.btn-link {
    font-weight: 500;
    transition: var(--transition);
}

.btn-link:active {
    color: var(--primary-color) !important;
}

.btn:active {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.btn:visited {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.btn:hover {
    border-color: var(--primary-color) !important;
}

.form-control {
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 8px 12px;
    font-size: 13px;
    transition: var(--transition);
    background: var(--surface-color);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.1);
}

.form-label {
    font-weight: 500;
    color: #111827;
    margin-bottom: 5px;
    font-size: 12px;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 999;
    display: none;
}

.overlay.active {
    display: block;
}

.custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    padding: 16px;
}

.custom-modal.active {
    display: flex;
}

.modal-content-custom {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 20px;
    max-width: 460px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--box-shadow-hover);
}

.table {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.table thead th {
    background: var(--surface-color);
    font-weight: 500;
    color: #111827;
    padding: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.table tbody td {
    padding: 10px;
    border-color: rgba(0, 0, 0, 0.05);
    vertical-align: middle;
    font-size: 13px;
}

.c-pill {
    align-items: center;
    font-family: "Open Sans", Arial, Verdana, sans-serif;
    font-weight: bold;
    font-size: 11px;
    display: inline-flex;
    height: auto;
    white-space: nowrap;
    width: auto;
    position: relative;
    border-radius: 100px;
    line-height: 1.25rem;
    padding: 1px 8px;
    text-overflow: ellipsis;
    color: #ffffff;
    word-break: break-word;
}

.c-pill--success {
    background: #1b8557;
}

.c-pill--warning {
    background: #ff9100;
}

.c-pill--danger {
    background: #ff1500bd;
}

.list-group-item {
    border: none;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.list-group-item .d-flex {
    align-items: center;
}

.list-group-item i {
    font-size: var(--icon-size, 16px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-right: 8px;
}

.list-group-item:last-child {
    border-bottom: none;
}

.list-item:hover {
    background-color: #e4e4e4;
    border-radius: 7.5px;
    cursor: pointer;
}

h2 {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
}

h5 {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

h6 {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
    }

    .main-content.sidebar-open {
        margin-left: 0;
    }

    .content-area {
        padding: 14px;
    }

    .login-card {
        margin: 10px;
        padding: 20px;
    }

    .top-header {
        padding: 0 14px;
    }

    .stats-card {
        padding: 14px;
        margin-bottom: 12px;
    }

    .stats-number {
        padding: 16px;
    }
}

.text-muted {
    color: #6c757d !important;
}

/* Custom dropdown arrow styling */
.form-control.dropdown-arrow {
    position: relative;
    padding-right: 30px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: var(--surface-color);
}

.dropdown-arrow-wrapper {
    position: relative;
    display: inline-block;
}

.dropdown-arrow-wrapper::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%) rotate(0deg);
    color: var(--secondary-color);
    pointer-events: none;
    z-index: 1;
    transition: transform 0.2s ease-in-out;
}

.dropdown-arrow-wrapper[data-expanded="true"]::after {
    transform: translateY(-50%) rotate(180deg);
}

.form-control.dropdown-arrow:focus,
.form-control.dropdown-arrow:active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.1);
}

.doc-data::before {
    content: "•\a0";
}