@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
@import url('https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css');

/* Element Plus Light Theme Variables Overrides */
:root, html, body {
    --el-bg-color: #ffffff !important;
    --el-bg-color-overlay: #ffffff !important;
    --el-text-color-primary: #0f172a !important;
    --el-text-color-regular: #334155 !important;
    --el-text-color-secondary: #64748b !important;
    --el-text-color-placeholder: #94a3b8 !important;
    --el-border-color: #cbd5e1 !important;
    --el-border-color-light: #e2e8f0 !important;
    --el-border-color-lighter: #f1f5f9 !important;
    --el-fill-color-blank: #ffffff !important;
    --el-fill-color-light: #f8fafc !important;
    --el-mask-color: rgba(255, 255, 255, 0.9) !important;
}

/* Global Font & Background */
body, #app, html {
    font-family: 'Inter', sans-serif !important;
    background-color: #f1f5f9 !important;
    color: #334155 !important;
    font-size: 14px !important;
}

/* Typography & Headings */
h1, h2, h3, h4, h5, h6, .el-dialog__title, .el-card__header {
    font-weight: 700 !important;
    color: #0f172a !important;
    letter-spacing: -0.02em !important;
}

/* Sidebar & Menu */
.sidebar-container {
    width: 220px !important;
}
.sidebar-container, .el-menu, .el-aside {
    background-color: #ffffff !important;
    border-right: 1px solid #e2e8f0 !important;
}
.el-menu-item, .el-sub-menu__title, .el-submenu__title {
    color: #475569 !important;
    font-weight: 500 !important;
    font-size: 15px !important;
    transition: all 0.2s ease;
}
.el-menu-item:hover, .el-sub-menu__title:hover, .el-submenu__title:hover, .el-menu-item.is-active {
    background-color: #f0f9ff !important;
    color: #0284c7 !important;
    font-weight: 700 !important;
}

/* Navbar / Header */
.navbar, .el-header {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(8px) !important;
    border-bottom: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* Main Content Area */
.app-main, .main-container {
    background-color: #f1f5f9 !important;
    padding: 10px !important;
}

/* Tab Bar / Header Tags */
.header-tags {
    background-color: #f8fafc !important;
    border-bottom: 1px solid #cbd5e1 !important;
    padding: 6px 10px !important;
    display: flex !important;
    gap: 6px !important;
    align-items: center !important;
    height: auto !important;
}

.el-tag.tag {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #475569 !important;
    font-weight: 500 !important;
    border-radius: 6px !important;
    height: 28px !important;
    line-height: 26px !important;
    padding: 0 12px !important;
    font-size: 13px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.el-tag.tag:hover {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
}

/* Active tag / tab */
.el-tag.tag.el-tag--dark {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%) !important;
    color: white !important;
    border-color: #0284c7 !important;
    font-weight: 600 !important;
}

/* Tables (Grids) to fit screen */
.el-table {
    background-color: #ffffff !important;
    color: #334155 !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    width: 100% !important;
    font-size: 13px !important;
}
.el-table .cell {
    padding-left: 5px !important;
    padding-right: 5px !important;
    white-space: nowrap !important;
}
.el-table th, .el-table tr {
    background-color: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

.el-table--enable-row-hover .el-table__body tr:hover>td {
    background-color: #f8fafc !important;
}
.el-table::before {
    display: none;
}

/* Form Controls & Inputs Contrast Fix */
.el-form-item__label,
.el-checkbox__label,
.el-radio__label,
.el-switch__label,
.el-descriptions__label,
.el-descriptions__content,
.el-dialog__body,
.el-dialog__header,
.el-card__header,
.el-form-item__content,
.el-text,
.el-table__empty-text,
.el-alert__title,
.el-alert__description {
    color: #334155 !important;
}

/* Correct Styling on Element Plus Wrapper divs */
.el-input__wrapper {
    background-color: #ffffff !important;
    background-image: none !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: none !important;
    border-radius: 6px !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
    padding: 1px 11px !important;
    box-sizing: border-box !important;
}

.el-input__inner {
    color: #0f172a !important;
    font-weight: 500 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    height: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

.el-textarea__inner {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: none !important;
    color: #0f172a !important;
    font-weight: 500 !important;
    border-radius: 6px !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
    padding: 5px 11px !important;
    box-sizing: border-box !important;
}

.el-select__wrapper {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: none !important;
    border-radius: 6px !important;
    color: #0f172a !important;
}

/* Focus States */
.el-input__wrapper.is-focus,
.el-textarea__inner:focus,
.el-select__wrapper.is-focused {
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.1) !important;
}

.el-select__placeholder,
.el-input__inner::placeholder,
.el-textarea__inner::placeholder {
    color: #94a3b8 !important;
}

/* Dropdown selections */
.el-select-dropdown__item {
    color: #334155 !important;
}
.el-select-dropdown__item.hover, 
.el-select-dropdown__item:hover {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
}
.el-select-dropdown__item.selected {
    color: #0284c7 !important;
    font-weight: 700 !important;
    background-color: #f0f9ff !important;
}

/* Icons inside inputs */
.el-input__icon,
.el-icon {
    color: #64748b !important;
}

/* Buttons (Vibrant Gradients) */
.el-button {
    border-radius: 6px !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    padding: 8px 15px !important;
}
.el-table .el-button {
    padding: 5px 10px !important;
    font-size: 14px !important;
    margin-left: 2px !important;
    margin-right: 2px !important;
}

/* Default / Secondary / Inactive Button Border fix */
.el-button:not(.el-button--primary):not(.el-button--success):not(.el-button--danger):not(.admin-icon-btn) {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #475569 !important;
}
.el-button:not(.el-button--primary):not(.el-button--success):not(.el-button--danger):not(.admin-icon-btn):hover {
    background-color: #f8fafc !important;
    border-color: #0284c7 !important;
    color: #0284c7 !important;
}

.el-button--primary {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 2px 4px rgba(2, 132, 199, 0.2) !important;
}
.el-button--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(2, 132, 199, 0.3) !important;
}
.el-button--success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2) !important;
}
.el-button--success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3) !important;
}
.el-button--danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: white !important;
    border: none !important;
}

/* Cards & Dialogs */
.el-card, .box-card, .el-dialog {
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    color: #334155 !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05) !important;
}

/* Pagination */
.el-pagination {
    margin-top: 15px !important;
    font-weight: 500 !important;
}
.el-pagination button:disabled, .el-pagination .btn-next, .el-pagination .btn-prev, .el-pager li {
    background-color: #ffffff !important;
    color: #475569 !important;
    border: 1px solid #cbd5e1 !important;
    margin: 0 2px;
    border-radius: 4px;
}
.el-pager li.active {
    background-color: #f0f9ff !important;
    color: #0284c7 !important;
    border-color: #0284c7 !important;
}

/* GRID BORDERS LIKE THE SAMPLE */
.el-table {
    border: 1px solid #e2e8f0 !important;
    border-radius: 4px !important;
}

.el-table th, .el-table td {
    border-right: 1px solid #e2e8f0 !important;
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 10px 8px !important;
}

.el-table th:last-child, .el-table td:last-child {
    border-right: none !important;
}

/* Ensure header background matches the clean grid look */
.el-table th {
    background-color: #f8fafc !important;
    color: #64748b !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

/* Sticky Actions Column Class Injection */
.admin-actions-column {
    position: sticky !important;
    right: 0 !important;
    background-color: #ffffff !important;
    z-index: 5 !important;
    box-shadow: -4px 0 10px -5px rgba(0, 0, 0, 0.15) !important;
    border-right: none !important;
    
    /* Fixed width to exactly fit 4 buttons (4 * 32px + margins) */
    width: 180px !important;
    min-width: 180px !important;
    max-width: 180px !important;
    text-align: center !important;
}
th.admin-actions-column {
    background-color: #f8fafc !important;
    z-index: 6 !important;
}
.admin-actions-column.is-hidden {
    visibility: visible !important;
    display: table-cell !important;
}
/* Center the buttons inside the cells */
.admin-actions-column .cell {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
}
/* Ensure fixed-right and fixed-left wrappers are completely hidden and do not block layout */
.el-table__fixed-right, .el-table__fixed {
    display: none !important;
}

/* Hide any web client buttons or links */
a[href*="webclient"], button[onclick*="webclient"], [title*="Web"], [title*="web"], button[title*="Web"], a[title*="Web"] {
    display: none !important;
}

