/* BPDA-BARMM Document Tracking System - Custom Styles */

:root {
    --sidebar-width: 260px;
    --primary: #0d3b66;
    --primary-light: #1a5f9e;
    --accent: #f4a261;
    --success: #2a9d8f;
    --danger: #e76f51;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: #f4f6f9;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    position: sticky;
    top: 0;
    transition: margin-left 0.3s ease;
    background: linear-gradient(180deg, #e76e1dc2 0%, #f05208da 100%) !important;
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

#agency-logo {
    margin-bottom: 10px;
    position: relative;
    top: 0;
    
}

#agency-logo {
    transform: translate(36px, 3px);
}

#agency-logo img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.agency-name {
    margin-top: 5px;
}

.sidebar-header {
    overflow: hidden;
}

/* Only text is animated */
.agency-text {
    width: 100%;
    overflow: hidden;
}

.agency-text-moving {
    width: max-content;
    white-space: nowrap;

    /* Continuous animation */
    animation: moveAgencyText 6s linear infinite;

    /* Important */
    will-change: transform;
}

.agency-text h6 {
    margin: 0;
    font-weight: 700;
    text-transform: uppercase;
}

.agency-text small {
    display: block;
}

@keyframes moveAgencyText {

    0% {
        transform: translateX(-100%);
    }

    50% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(100%);
    }

}

.sidebar .nav-link {
    color: rgba(255,255,255,0.75);
    border-radius: 8px;
    padding: 0.65rem 1rem;
    margin-bottom: 2px;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: #fff;
    background: rgba(255,255,255,0.12);
}

.sidebar .nav-link.active {
    background: rgba(244, 162, 97, 0.25);
    border-left: 3px solid var(--accent);
}

.sidebar-header {
    background: rgba(0,0,0,0.2);
}

#page-content {
    min-width: 0;
    width: 100%;
}

.stat-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}

.stat-card .card-body {
    padding: 1.25rem;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.table thead th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
    font-size: 0.9rem;
}

.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

.bg-orange {
    background-color: #fd7e14 !important;
}

.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dee2e6;
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #0d6efd;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #0d6efd;
}

.timeline-item.completed::before {
    background: #198754;
    box-shadow: 0 0 0 2px #198754;
}

.timeline-item.pending::before {
    background: #ffc107;
    box-shadow: 0 0 0 2px #ffc107;
}

.form-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.form-label {
    font-weight: 500;
    font-size: 0.875rem;
}



/* Core Page Styling */
body.login-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #ffffff;
}

.login-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* ================= Left Panel ================= */
.login-left {
    flex: 1.15;
    position: relative;
    background: url('../../assets/img/bgc.jpg') center center / cover no-repeat;
    min-height: 100vh;
}

.login-left-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(0, 80, 50, 0.82) 0%,
        rgba(0, 100, 60, 0.75) 40%,
        rgba(0, 70, 45, 0.65) 100%
    );

    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2.5rem 3rem 3rem;
}

.agency-header {
    display: flex;
    align-items: flex-start;
}

.agency-logo {
    width: clamp(72px, 8vw, 110px);
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
}

.login-left-content {
    max-width: 420px;
    margin-top: 1.5rem;
}

.agency-title {
    color: #ffffff;
    font-size: 2.35rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 0.6rem;
    letter-spacing: -0.02em;
}

.agency-acronym {
    color: #f0c14b;
    font-size: 2rem;
    font-weight: 800;
    margin: 0 0 1.25rem;
    letter-spacing: 0.04em;
}

.tagline {
    color: rgba(255, 255, 255, 0.92);
    font-size: 1.05rem;
    line-height: 1.45;
    margin: 0;
    font-weight: 400;
}

/* ================= Right Panel ================= */
.login-right {
    flex: 0.95;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2.5rem 2rem 1.5rem;
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
}

.form-wrapper {
    width: 100%;
    max-width: 380px;
    margin-block: auto;
}

.form-logo-wrap {
    text-align: center;
    margin-bottom: 1.25rem;
}

.form-logo {
    width: 88px;
    height: 88px;
    object-fit: contain;
}

.form-title {
    text-align: center;
    font-size: 1.55rem;
    font-weight: 700;
    color: #1a3c2a;
    line-height: 1.3;
    margin: 0 0 0.35rem;
}

.form-subtitle {
    text-align: center;
    color: #2e7d4f;
    font-size: 0.95rem;
    font-weight: 500;
    margin: 0 0 0.5rem;
}

.form-desc {
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.45;
    margin: 0 0 1.75rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.4rem;
}

.input-field-group {
    display: flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background-color: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-field-group:focus-within {
    border-color: #1a7a4c;
    box-shadow: 0 0 0 3px rgba(26, 122, 76, 0.15);
}

.input-icon {
    padding: 0.7rem 0.75rem 0.7rem 0.9rem;
    color: #9ca3af;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
}

.custom-input {
    border: none;
    outline: none;
    width: 100%;
    padding: 0.7rem 0.5rem 0.7rem 0;
    font-size: 0.9rem;
    color: #1f2937;
    background: transparent;
}

.custom-input::placeholder {
    color: #9ca3af;
}

.password-toggle {
    background: none;
    border: none;
    color: #9ca3af;
    padding: 0.7rem 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.password-toggle:hover {
    color: #6b7280;
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: #374151;
    cursor: pointer;
    margin: 0;
}

.remember-me input {
    width: 16px;
    height: 16px;
    accent-color: #1a7a4c;
    cursor: pointer;
}

.forgot-password {
    color: #1a7a4c;
    text-decoration: none;
    font-weight: 500;
}

.forgot-password:hover {
    text-decoration: underline;
}

/* Sign In Button */
.btn-signin {
    width: 100%;
    background-color: #1a7a4c;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-signin:hover {
    background-color: #156b42;
}

.btn-signin:active {
    transform: scale(0.98);
}

/* Footer inside form */
.form-footer {
    margin-top: 1.75rem;
    text-align: center;
}

.or-divider {
    color: #9ca3af;
    font-size: 0.85rem;
    margin: 0 0 1rem;
    position: relative;
}

.or-divider::before,
.or-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: #e5e7eb;
}

.or-divider::before {
    left: 0;
}

.or-divider::after {
    right: 0;
}

.authorized-note {
    color: #1a7a4c;
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0 0 0.4rem;
}

.security-note {
    color: #6b7280;
    font-size: 0.8rem;
    line-height: 1.45;
    margin: 0;
}

/* Page footer */
.page-footer {
    position: static;
    width: 100%;
    flex: 0 0 auto;
    margin-top: 1.5rem;
    text-align: center;
    color: #9ca3af;
    font-size: 0.75rem;
    line-height: 1.4;
}

.page-footer p {
    margin: 0;
}

/* ================= Responsive ================= */
@media (max-width: 992px) {
    .login-wrapper {
        flex-direction: column;
    }

    .login-left {
        min-height: 42vh;
        flex: none;
    }

    .login-left-overlay {
        position: relative;
        min-height: inherit;
        padding: 1.75rem 1.5rem;
    }

    .agency-logo {
        width: 80px;
        height: 80px;
        transform: none;
    }

    .login-left-content {
        margin-top: 1rem;
    }

    .agency-title {
        font-size: 1.75rem;
    }

    .agency-acronym {
        font-size: 1.5rem;
    }

    .login-right {
        flex: none;
        padding: 2rem 1.25rem;
        min-height: auto;
    }

    .page-footer {
        margin-top: 1.5rem;
    }
}

@media (max-width: 480px) {
    .agency-title {
        font-size: 1.45rem;
    }

    .form-title {
        font-size: 1.3rem;
    }

    .form-wrapper {
        max-width: 100%;
    }
}

@media (min-width: 993px) and (max-height: 760px) {
    .login-right {
        padding-block: 1rem;
    }

    .form-logo-wrap {
        margin-bottom: 0.5rem;
    }

    .form-logo {
        width: 64px;
        height: 64px;
    }

    .form-desc {
        margin-bottom: 1rem;
    }

    .login-right form .mb-3 {
        margin-bottom: 0.75rem !important;
    }

    .input-icon,
    .custom-input,
    .password-toggle {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .form-options {
        margin-bottom: 1rem;
    }

    .btn-signin {
        padding-block: 0.65rem;
    }

    .form-footer {
        margin-top: 1rem;
    }

    .or-divider {
        margin-bottom: 0.5rem;
    }

    .page-footer {
        margin-top: 0.5rem;
    }
}

@media print {
    .sidebar, .navbar, .btn, footer, .no-print {
        display: none !important;
    }
    #page-content {
        margin: 0 !important;
        padding: 0 !important;
    }
}

@media (max-width: 768px) {
    .sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
        position: fixed;
    }
    .sidebar.show {
        margin-left: 0;
    }
}

.breadcrumb {
    background: transparent;
    padding: 0;
    font-size: 0.85rem;
}

.qr-container img {
    max-width: 180px;
    border: 4px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.upload-zone {
    border: 2px dashed #ced4da;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    transition: border-color 0.2s;
    cursor: pointer;
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: #0d6efd;
    background: #f8f9ff;
}

/* Mobile layout */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }

    #wrapper,
    #page-content {
        min-width: 0;
        width: 100%;
    }

    .sidebar {
        top: 0;
        bottom: 0;
        height: 100vh;
        height: 100dvh;
        min-height: 0;
        overflow-y: auto;
        box-shadow: 4px 0 18px rgba(0, 0, 0, 0.18);
        -webkit-overflow-scrolling: touch;
    }

    .sidebar #agency-logo {
        transform: none;
    }

    #page-content > .navbar {
        min-height: 56px;
        padding-right: 0.75rem !important;
        padding-left: 0.5rem !important;
    }

    #sidebarToggle {
        flex: 0 0 auto;
        padding: 0.5rem 0.65rem;
    }

    #page-content > .navbar > .ms-auto {
        gap: 0.75rem !important;
    }

    #page-content > .navbar .dropdown-menu[style*="width:320px"] {
        width: min(320px, calc(100vw - 1rem)) !important;
        max-width: calc(100vw - 1rem);
    }

    #page-content > main {
        padding: 1rem !important;
    }

    .stat-card .card-body {
        gap: 0.65rem !important;
        padding: 0.9rem 0.75rem;
    }

    .stat-card .stat-icon {
        width: 40px;
        height: 40px;
        flex: 0 0 40px;
        font-size: 1.05rem;
    }

    .stat-card .stat-value {
        font-size: 1.4rem;
        overflow-wrap: anywhere;
    }

    .stat-card .stat-label {
        font-size: 0.7rem;
        letter-spacing: 0.03em;
    }

    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }

    .table-responsive > .table {
        min-width: 600px;
    }

    .table-responsive > .table:has(th:nth-child(7)) {
        min-width: 760px;
    }

    .pagination {
        flex-wrap: wrap;
    }

    .form-card .card-body,
    .table-card .card-body {
        min-width: 0;
    }

    .upload-zone {
        padding: 1.25rem 0.75rem;
    }
}

@media (max-width: 575.98px) {
    #page-content > main {
        padding: 0.75rem !important;
    }

    #page-content > .navbar > .ms-auto {
        gap: 0.5rem !important;
    }

    #page-content > .navbar .dropdown-menu[style*="width:320px"] {
        position: fixed;
        top: 3.5rem;
        right: 0.5rem;
        left: auto;
    }

    .breadcrumb {
        flex-wrap: wrap;
    }

    .card-header {
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .form-control,
    .form-select,
    .custom-input {
        font-size: 16px;
    }

    .form-options {
        align-items: flex-start;
        gap: 0.75rem;
        flex-wrap: wrap;
    }

    .login-left {
        min-height: 250px;
        min-height: 35svh;
    }

    .login-left-overlay {
        position: relative;
        min-height: inherit;
        padding: 1.5rem;
    }

    .agency-logo {
        width: 64px;
        height: auto;
        transform: none;
    }

    .login-left-content {
        margin-top: 1.25rem;
    }

    .agency-title {
        font-size: 1.4rem;
    }

    .agency-acronym {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }

    .tagline {
        font-size: 0.95rem;
    }

    .login-right {
        padding: 1.5rem 1rem 2rem;
    }

    .page-footer {
        margin-top: 1.5rem;
    }
}