:root {
    --kmtc-maroon: #6d1927;
    --kmtc-gold: #fab906;
    --bg: #f8f9fa;
}

body {
    background: var(--bg);
}

.wrapper {
    display: flex;
    min-height: 100vh;
}

#sidebar {
    width: 260px;
    background: var(--kmtc-maroon);
    color: white;
    padding: 20px;
}

.sidebar-logo {
    text-align: center;
    margin-bottom: 30px;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
}

.sidebar-nav li {
    margin-bottom: 8px;
}

.sidebar-nav a {
    color: white;
    text-decoration: none;
    display: block;
    padding: 10px 14px;
    border-radius: 10px;
}

.sidebar-nav a:hover {
    background: rgba(250, 185, 6, 0.2);
}

.sidebar-nav a.active {
    background: #fab906;
    color: #000;
    font-weight: 600;
}

.main-content {
    flex: 1;
    padding: 24px;
}

.btn-kmtc-maroon {
    background: var(--kmtc-maroon);
    color: white;
}

.btn-kmtc-maroon:hover {
    background: #53111d;
    color: white;
}

.bg-kmtc-maroon {
    background: var(--kmtc-maroon) !important;
}

/* Auth / Login Pages */
.auth-body {
    font-family: "Poppins", sans-serif;
    margin: 0;
    overflow-x: hidden;
}

.auth-split {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
}

.auth-brand-panel {
    flex: 1 1 50%;
    background: var(--kmtc-gold);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(24px, 4vw, 48px) clamp(20px, 3vw, 40px);
    text-align: center;
    min-width: 0;
}

.auth-brand-content {
    max-width: min(460px, 100%);
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(16px, 3vw, 24px);
    text-align: center;
}

.auth-brand-tag {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.85;
}

.auth-brand-logo {
    display: flex;
    justify-content: center;
    width: 100%;
}

.auth-brand-logo img {
    display: block;
    width: auto;
    max-width: clamp(120px, 22vw, 200px);
    height: auto;
    margin: 0 auto;
}

.auth-brand-text {
    width: 100%;
    text-align: center;
}

.auth-brand-title {
    text-align: center;
    font-size: clamp(1.35rem, 2.5vw, 2rem);
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 8px;
}

.auth-brand-subtitle {
    font-size: clamp(1.15rem, 2vw, 1.6rem);
    font-weight: 700;
    margin-bottom: 16px;
}

.auth-brand-description {
    font-size: clamp(0.875rem, 1.6vw, 0.95rem);
    line-height: 1.7;
    opacity: 0.9;
    margin-bottom: 0;
    text-align: center;
    max-width: 42ch;
    margin-left: auto;
    margin-right: auto;
}

.auth-brand-welcome {
    font-size: clamp(1.15rem, 2vw, 1.75rem);
    font-weight: 700;
    margin-top: 8px;
    margin-bottom: 0;
}

.auth-form-panel {
    flex: 1 1 50%;
    background: #eceef1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(24px, 4vw, 32px) clamp(16px, 3vw, 24px);
    min-width: 0;
}

.auth-card {
    width: 100%;
    max-width: min(440px, 100%);
    border: none;
    border-radius: 16px;
    background: #fff;
}

.auth-login-title {
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    font-weight: 700;
    color: #333;
    text-align: center;
    margin-bottom: clamp(16px, 3vw, 24px);
}

.auth-mobile-header {
    display: none;
    text-align: center;
    margin-bottom: 20px;
}

.auth-mobile-logo {
    display: block;
    width: auto;
    max-width: 120px;
    height: auto;
    margin: 0 auto 10px;
}

.auth-mobile-app-name {
    font-size: clamp(1.1rem, 4vw, 1.35rem);
    font-weight: 700;
    color: var(--kmtc-maroon);
    margin: 0;
}

.auth-logo {
    text-align: center;
    margin-bottom: 20px;
}

.auth-logo img {
    height: clamp(70px, 12vw, 90px);
    width: auto;
}

.auth-card-heading {
    font-size: clamp(1rem, 2vw, 1.05rem);
    font-weight: 600;
    color: #333;
    text-align: center;
    margin-bottom: clamp(16px, 3vw, 24px);
}

.auth-title {
    font-weight: 700;
    color: var(--kmtc-maroon);
}

.auth-card .form-control,
.auth-card input {
    width: 100%;
    border-radius: 8px;
    padding: clamp(10px, 2vw, 12px) 14px;
    border: 1px solid #dee2e6;
    font-size: 16px;
}

.auth-card .form-control:focus {
    border-color: var(--kmtc-maroon);
    box-shadow: 0 0 0 0.2rem rgba(109, 25, 39, 0.15);
}

.auth-card label {
    font-weight: 600;
    margin-bottom: 6px;
    font-size: clamp(0.85rem, 1.5vw, 0.9rem);
    color: #333;
}

.auth-card .btn {
    min-height: 44px;
}

.auth-forgot-link {
    color: #0d6efd;
    font-size: 0.875rem;
    text-decoration: none;
}

.auth-forgot-link:hover {
    text-decoration: underline;
}

.btn-kmtc-gold {
    background: var(--kmtc-gold);
    color: #fff;
    border: none;
    font-weight: 600;
    border-radius: 8px;
}

.btn-kmtc-gold:hover {
    background: #e0a800;
    color: #fff;
}

/* Tablet — stack panels, keep brand visible */
@media (max-width: 991.98px) and (min-width: 768px) {
    .auth-split {
        flex-direction: column;
    }

    .auth-brand-panel {
        flex: 0 0 auto;
        width: 100%;
    }

    .auth-form-panel {
        flex: 1 1 auto;
        width: 100%;
        align-items: center;
        padding-bottom: max(32px, env(safe-area-inset-bottom, 0px));
    }

    .auth-brand-welcome {
        display: none;
    }
}

/* Phones — login form only */
@media (max-width: 767.98px) {
    .auth-brand-panel {
        display: none;
    }

    .auth-split {
        flex-direction: column;
        min-height: 100dvh;
        min-height: 100svh;
    }

    .auth-form-panel {
        flex: 1 1 auto;
        width: 100%;
        min-height: 100dvh;
        min-height: 100svh;
        align-items: center;
        justify-content: center;
        padding: max(24px, env(safe-area-inset-top, 0px))
            max(16px, env(safe-area-inset-right, 0px))
            max(24px, env(safe-area-inset-bottom, 0px))
            max(16px, env(safe-area-inset-left, 0px));
    }

    .auth-card {
        border-radius: 12px;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08) !important;
    }

    .auth-card .card-body {
        padding: clamp(20px, 5vw, 28px) !important;
    }

    .auth-mobile-header {
        display: block;
    }

    .auth-login-title {
        font-size: clamp(1.15rem, 4vw, 1.35rem);
        margin-bottom: 20px;
    }
}

/* Very small phones */
@media (max-width: 359.98px) {
    .auth-card .card-body {
        padding: 16px !important;
    }
}

/* Large desktops */
@media (min-width: 1400px) {
    .auth-brand-content {
        max-width: 520px;
    }

    .auth-card {
        max-width: 480px;
    }
}

/* Landscape tablets — compact side-by-side */
@media (max-height: 520px) and (orientation: landscape) and (min-width: 768px) {
    .auth-split {
        flex-direction: row;
    }

    .auth-brand-panel {
        flex: 0 0 38%;
        max-width: 38%;
        padding: 16px 20px;
        overflow-y: auto;
    }

    .auth-brand-content {
        gap: 10px;
    }

    .auth-brand-logo img {
        max-width: 72px;
    }

    .auth-brand-title {
        font-size: 1.1rem;
        margin-bottom: 4px;
    }

    .auth-brand-description {
        font-size: 0.75rem;
        line-height: 1.45;
        display: -webkit-box;
        line-clamp: 4;
        -webkit-line-clamp: 4;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .auth-form-panel {
        flex: 1;
        padding: 16px 20px;
        overflow-y: auto;
        align-items: center;
        min-height: auto;
    }

    .auth-login-title {
        font-size: 1.15rem;
        margin-bottom: 12px;
    }

    .auth-card .card-body {
        padding: 16px 20px !important;
    }

    .auth-card .mb-3 {
        margin-bottom: 0.75rem !important;
    }
}

.target-table textarea {
    width: 100%;
    height: 80px;
    min-height: 80px;
    resize: none;
}

.target-table input,
.target-table select {
    width: 100%;
}

.target-table th {
    font-size: 16px;
    font-weight: 600;
    background: #f8f9fa;
}

.target-table td {
    vertical-align: middle;
}

.target-table th {
    text-align: center;
    vertical-align: middle;
    font-weight: 600;
}

.target-table td {
    vertical-align: middle;
}

.serial-number {
    font-size: 15px;
    text-align: center;
    background: #f8f9fa;
}

.target-table tfoot {
    font-weight: 700;
    background: #fff8e1;
}

.mid-year-table textarea {
    width: 100%;
    height: 70px;
    resize: vertical;
}

.mid-year-table input,
.mid-year-table select {
    width: 100%;
}

.mid-year-table th {
    text-align: center;
    vertical-align: middle;
}

.mid-year-table td {
    vertical-align: middle;
}

.appraisal-timeline {
    position: relative;
    padding-left: 8px;
}

.timeline-item {
    position: relative;
    padding-left: 28px;
    padding-bottom: 20px;
    border-left: 2px solid #e5e7eb;
}

.timeline-item:last-child {
    border-left-color: transparent;
    padding-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -7px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ced4da;
    border: 2px solid #fff;
}

.timeline-item.state-done .timeline-marker {
    background: #198754;
}

.timeline-item.state-current .timeline-marker {
    background: var(--kmtc-maroon);
}

.timeline-item.state-waiting .timeline-marker {
    background: #ffc107;
}

.timeline-item.state-locked {
    opacity: 0.65;
}

.notification-dropdown {
    min-width: 320px;
    max-width: 360px;
}

.notification-dropdown .dropdown-item {
    white-space: normal;
}
