﻿/* ============================================================
   REUSABLE COMPONENTS — built on your CSS variables
   ============================================================ */

/* ── PAGE HEADER BAR ── */
.page-header-bar {
    background: var(--color-dark);
    color: #e6d87a;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1.5px;
    padding: 11px 13px;
    text-transform: uppercase;
    margin-bottom: 0;
}

/* ── TOOLBAR ── */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 12px 16px;
    background: #fff;
    border-bottom: 1px solid #e2eade;
    gap: 8px;
}

    .toolbar input[type="text"],
    .toolbar select {
        border: 1px solid #ccc;
        border-radius: 4px;
        padding: 7px 10px;
        font-size: 13px;
        color: #333;
        outline: none;
        transition: border-color .2s;
    }

        .toolbar input[type="text"]:focus,
        .toolbar select:focus {
            border-color: var(--color-light);
            box-shadow: 0 0 0 2px rgba(0,177,64,.12);
        }

    .toolbar input[type="text"] {
        width: 200px;
    }

/* ── BUTTONS ── */
.btn-primary {
    background: var(--color-light);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}

    .btn-primary:hover {
        background: var(--color-medium);
    }

    .btn-primary:disabled {
        background: #aaa;
        cursor: not-allowed;
    }

.btn-secondary {
    background: #fff;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 7px 16px;
    font-size: 13px;
    cursor: pointer;
    transition: background .2s;
}

    .btn-secondary:hover {
        background: #f5f5f5;
    }

.btn-danger {
    background: #e24b4a;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}

    .btn-danger:hover {
        background: #a32d2d;
    }

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}

    .btn-icon:hover {
        background: var(--color-light);
    }

/* ── CARD ── */
.card-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

#listContainer {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

    #listContainer > div[style*="overflow-x"] {
        flex: 1;
        overflow-x: auto;
        overflow-y: auto;
    }

/* ── TABLE ── */
.table-responsive-wrapper {
    flex: 1;
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.app-table {
    width: 100%;
    min-width: 700px;
    border-collapse: collapse;
}

    .app-table thead tr {
        background: var(--color-dark);
    }

    .app-table thead th {
        color: #fff;
        font-size: 11px;
        font-weight: 600;
        letter-spacing: .5px;
        padding: 11px 13px;
        text-align: left;
        text-transform: uppercase;
        white-space: nowrap;
    }

    .app-table tbody tr {
        border-bottom: 1px solid #e8f0e4;
        transition: background .15s;
    }

        .app-table tbody tr:nth-child(even) {
            background: #f0f7ed;
        }

        .app-table tbody tr:hover {
            background: #ddf0d5;
        }

    .app-table tbody td {
        padding: 10px 13px;
        font-size: 13px;
        color: #222;
    }

    .app-table .col-actions {
        text-align: right;
        white-space: nowrap;
    }

/* ── BADGES ── */
.badge-active {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    background: #d4f0dc;
    color: #1a7a3a;
}

.badge-inactive {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    background: #fde8e8;
    color: #a32d2d;
}

.badge-pending {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    background: #fef3cd;
    color: #856404;
}

/* ── EMPTY / LOADING ROW ── */
.empty-row {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 32px;
    font-size: 13px;
}

/* ── MODAL OVERLAY ── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

    .modal-overlay.open {
        display: flex;
    }

/* ── MODAL BOX ── */
.modal-box {
    background: #fff;
    border-radius: 6px;
    width: 460px;
    max-width: 96vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,.18);
    animation: modalIn .18s ease;
}

    .modal-box.modal-sm {
        width: 360px;
    }

    .modal-box.modal-lg {
        width: 580px;
    }

    .modal-box.modal-xl {
        width: 900px;
        max-width: 96vw;
    }

    .modal-box.modal-xxl {
        width: 1100px;
        max-width: 96vw;
    }

@keyframes modalIn {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-head {
    background: var(--color-dark);
    color: #e6d87a;
    padding: 13px 18px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .modal-head .btn-close-modal {
        background: none;
        border: none;
        color: #e6d87a;
        font-size: 20px;
        cursor: pointer;
        line-height: 1;
        padding: 0 2px;
    }

.modal-body {
    padding: 18px 20px 10px;
    overflow-y: auto;
    flex: 1;
}

/* ── MODAL FOOT (Single definition) ── */
.modal-foot {
    padding: 12px 20px;
    border-top: 1px solid #e0e0e0;
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    background: #fff;
}

/* ── FORM GROUPS ── */
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-col-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.form-col-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.form-col-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.form-col-5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.fgroup {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 13px;
}

    .fgroup label {
        font-size: 11px;
        color: #555;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: .4px;
    }

    .fgroup .req {
        color: #e24b4a;
    }

    .fgroup input,
    .fgroup select,
    .fgroup textarea {
        border: 1px solid #ccc;
        border-radius: 4px;
        padding: 7px 10px;
        font-size: 13px;
        color: #333;
        outline: none;
        width: 100%;
        transition: border-color .2s;
    }

        .fgroup input:focus,
        .fgroup select:focus,
        .fgroup textarea:focus {
            border-color: var(--color-light);
            box-shadow: 0 0 0 2px rgba(0,177,64,.12);
        }

.form-error {
    display: none;
    background: #fde8e8;
    color: #a32d2d;
    border: 1px solid #f5c1c1;
    border-radius: 4px;
    padding: 7px 12px;
    font-size: 14px;
    margin-bottom: 8px;
}

/* ── SECTION TITLE (Single definition) ── */
.section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-dark);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--color-light);
    display: inline-block;
}

/* ── TOAST NOTIFICATION ── */
.app-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 11px 18px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    z-index: 9999;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .3s, transform .3s;
    pointer-events: none;
}

    .app-toast.show {
        opacity: 1;
        transform: translateY(-30px);
    }

    .app-toast.toast-success {
        background: var(--color-light);
    }

    .app-toast.toast-danger {
        background: #a32d2d;
    }

    .app-toast.toast-warning {
        background: #856404;
    }

/* ============================================
   EMPLOYEE CARD - UPDATED DESIGN
   ============================================ */

/* Main Card Container */
.emp-card {
    display: flex;
    align-items: stretch;
    gap: 24px;
    background: #fff;
    border: 1px solid #d8e8d2;
    border-radius: 10px;
    padding: 20px 26px;
    margin-top: 12px;
    margin-bottom: 12px;
    min-height: 160px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* Avatar Wrapper - Spans full height */
/* Avatar Container with upload overlay - CLEAN VERSION */
.emp-avatar-container {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 12px;
    overflow: hidden;
    border: 3px solid var(--color-light);
    flex-shrink: 0;
    cursor: pointer;
    background: #e8f5e8;
}

.emp-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.emp-avatar {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 34px;
    color: var(--color-medium);
    text-transform: uppercase;
    background: #e8f5e8;
}

.avatar-upload-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 8px;
    text-align: center;
    font-size: 10px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    backdrop-filter: blur(2px);
}

.avatar-upload-overlay i {
    font-size: 14px;
}

.emp-avatar-container:hover .avatar-upload-overlay {
    opacity: 1;
}

.emp-avatar-container:hover .emp-avatar {
    filter: brightness(0.9);
}

.emp-avatar-container:hover .emp-avatar-img {
    filter: brightness(0.85);
}

.emp-avatar-wrapper {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    min-height: 120px;

}

/* Employee Info Section */
.emp-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 4px 0;
}

/* Name Row with Actions */
.emp-name-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.emp-name {
    font-size: 20px;
    font-weight: 700;
    color: #222;
    letter-spacing: -0.3px;
}

/* Actions Container - Groups status badge and reset button */
.emp-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Position */
.emp-position {
    font-size: 15px;
    color: #666;
    font-weight: 500;
}

/* Meta Items */
.emp-meta-item {
    font-size: 13px;
    color: #888;
}

    .emp-meta-item span {
        color: #222;
        font-weight: 600;
    }

/* Status Badge */
.emp-status-badge {
    padding: 5px 16px;
    font-size: 12px;
    border-radius: 20px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    display: inline-flex;
    align-items: center;
}

    .emp-status-badge.active {
        background: #e8f7ee;
        color: #1a7f37;
        border-color: #bfe8cc;
    }

        .emp-status-badge.active:hover {
            background: #d0f0d8;
            transform: scale(1.02);
        }

    .emp-status-badge.inactive {
        background: #fde8e8;
        color: #b42318;
        border-color: #f5c2c2;
    }

        .emp-status-badge.inactive:hover {
            background: #fcd5d5;
            transform: scale(1.02);
        }

/* Reset Password Button */
.emp-reset-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #c8dfc8;
    background: #fff;
    color: #444;
    padding: 5px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

    .emp-reset-btn:hover {
        background: #f0f7f0;
        border-color: var(--color-light);
        color: var(--color-medium);
        transform: scale(1.02);
    }

    .emp-reset-btn i {
        color: var(--color-light);
        font-size: 13px;
    }

/* Password Modal Enhancements */
#cp_password,
#cp_confirmPassword {
    font-size: 14px;
    letter-spacing: 0.5px;
}

    #cp_password:focus,
    #cp_confirmPassword:focus {
        border-color: var(--color-light);
        box-shadow: 0 0 0 3px rgba(0,177,64,0.1);
    }



/* ── INFO CARD ── */
.info-card {
    background: #fff;
    border: 1px solid #d8e8d2;
    border-radius: 10px;
    padding: 20px 26px;
    margin-bottom: 12px;
}

.info-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.info-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #2a7a2a;
}

.info-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #c8dfc8;
    background: #fff;
    color: #333;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background .2s;
}

    .info-edit-btn:hover {
        background: #f0f7f0;
    }

    .info-edit-btn i {
        color: #3B6D11;
        font-size: 12px;
    }

.info-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px 20px;
}

.info-row-divider {
    padding-bottom: 14px;
    border-bottom: 1px solid #e8f0e4;
    margin-bottom: 14px;
}

.info-field label {
    display: block;
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-bottom: 4px;
    font-weight: 500;
}

.info-field span {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #222;
}

.info-col-span-2 {
    grid-column: span 2;
}

/* Tabs Styling */
.tabs-container {
    width: 100%;
}

.tabs-header {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 20px;
    gap: 5px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px 4px 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .tab-btn i {
        font-size: 16px;
    }

    .tab-btn:hover {
        background-color: #f5f5f5;
        color: var(--color-medium);
    }

    .tab-btn.active {
        color: var(--color-medium);
        border-bottom: 2px solid var(--color-medium);
        margin-bottom: -2px;
        background-color: #f9f9f9;
    }

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

    .tab-content.active {
        display: block;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 14px 0;
}

.req {
    color: #a32d2d;
}

/* ============================================
   REUSABLE CARD GRID SYSTEM
   ============================================ */

/* Grid layouts */
.grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

/* Card base styles */
.card {
    background: #fff;
    border: 1px solid #e8f0e4;
    border-radius: 10px;
    padding: 16px;
    transition: all 0.2s ease;
    position: relative;
}

    .card:hover {
        border-color: var(--color-light);
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e8f0e4;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
}

.card-subtitle {
    font-size: 13px;
    color: var(--color-light);
    font-weight: 600;
    margin-top: 4px;
}

.card-dates {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
    font-size: 13px;
    color: #666;
}

    .card-dates i {
        width: 18px;
        color: var(--color-light);
    }

.card-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
    font-style: italic;
}

    .empty-state i {
        font-size: 48px;
        margin-bottom: 16px;
        opacity: 0.3;
    }

    .empty-state p {
        margin: 0;
    }

    .empty-state .small {
        font-size: 12px;
    }


.btn-icon-sm {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    color: #888;
}

    .btn-icon-sm:hover {
        background: #f0f7ed;
    }

    .btn-icon-sm.btn-edit:hover {
        color: var(--color-light);
    }

    .btn-icon-sm.btn-delete:hover {
        color: #e24b4a;
    }

.suggest-box {
    position: relative;
}

.suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: none;
}

    .suggestions-list.show {
        display: block;
    }

.suggestion-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

    .suggestion-item:hover,
    .suggestion-item.selected {
        background: #e8f0e8;
    }

.suggestion-name {
    font-weight: 500;
    color: #333;
}

.suggestion-detail {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}

.suggestion-highlight {
    background: #ffeb3b;
    font-weight: bold;
}

.suggestion-empty {
    padding: 10px 12px;
    color: #999;
    text-align: center;
}

