/* ==================== USERS GRID ==================== */
.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    width: 100%;
}

.user-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.user-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 16px;
}

.user-card-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #ff6b6b);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    font-weight: 600;
    flex-shrink: 0;
    overflow: hidden;
}

.user-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-card-info {
    flex: 1;
    min-width: 0;
}

.user-card-name {
    font-weight: 600;
    font-size: 16px;
    color: #fff;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-card-position {
    color: #888;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-card-details {
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.user-card-detail {
    font-size: 13px;
    color: #999;
    margin-bottom: 6px;
}

.user-card-detail:last-child {
    margin-bottom: 0;
}

.user-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-card-actions {
    display: flex;
    gap: 4px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 14px;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
}

/* ==================== ROLES GRID ==================== */
.roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    width: 100%;
}

.role-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 4px solid #3B82F6;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s ease;
}

.role-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.role-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.role-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.role-card-info {
    flex: 1;
    min-width: 0;
}

.role-card-name {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.role-card-code {
    font-size: 12px;
    color: #888;
    font-family: 'Monaco', 'Consolas', monospace;
}

.role-badge {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 500;
}

.role-badge.system {
    background: rgba(255, 255, 255, 0.1);
    color: #aaa;
}

.role-card-desc {
    margin: 0 0 16px;
    font-size: 13px;
    color: #999;
    line-height: 1.5;
}

.role-card-actions {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.role-card-actions .btn {
    flex: 1;
    justify-content: center;
    padding: 8px 12px;
    font-size: 13px;
}

.role-card-actions .btn-danger {
    flex: 0;
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.role-card-actions .btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
}

/* ==================== PERMISSION CARDS ==================== */
.permission-module-card {
    transition: all 0.2s ease;
}

.permission-module-card:hover {
    background: rgba(255,255,255,0.08) !important;
    border-color: rgba(255,255,255,0.15) !important;
}

.permission-item {
    transition: all 0.2s ease !important;
}

.permission-item:hover {
    background: rgba(255,255,255,0.15) !important;
    border-color: var(--primary-color) !important;
    transform: translateY(-1px);
}

.permission-item:has(input:checked) {
    background: rgba(220,20,60,0.15) !important;
    border-color: var(--primary-color) !important;
    color: #fff !important;
}

/* ==================== FORMS ==================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.08);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* ==================== BUTTONS ==================== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #ff1744 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 20, 60, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-add {
    background: linear-gradient(135deg, var(--primary-color) 0%, #ff1744 100%);
    color: white;
}

.btn-add:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 20, 60, 0.3);
}

.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 8px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.btn-icon:hover {
    opacity: 1;
}

.btn-logout {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* ==================== CARDS ==================== */
.card {
    background: rgba(26, 26, 26, 0.8);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.card-body {
    color: var(--text-secondary);
}

/* ==================== TABLES ==================== */
.table-container {
    overflow-x: auto;
    border-radius: 8px;
    background: rgba(26, 26, 26, 0.6);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: rgba(220, 20, 60, 0.1);
}

thead th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
}

tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

tbody tr:hover {
    background: rgba(220, 20, 60, 0.05);
}

tbody td {
    padding: 14px 16px;
    color: var(--text-secondary);
}

.table-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.table-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* ==================== MODALS ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.modal-close {
    font-size: 28px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
}

/* Modal XL - Full Featured Modals */
.modal-content.modal-xl {
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-xl .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.modal-xl .modal-footer {
    position: sticky;
    bottom: 0;
    background: var(--bg-card);
    z-index: 10;
    flex-shrink: 0;
}

/* Template Form Layout */
.template-form-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 24px;
}

.template-form-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.template-form-config {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Card Section Styling */
.card-section {
    background: rgba(30, 30, 30, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.card-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: rgba(40, 40, 40, 0.5);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.card-section-header:hover {
    background: rgba(50, 50, 50, 0.6);
}

.card-section-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-section-header .section-count {
    background: var(--primary-color);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.card-section-toggle {
    font-size: 12px;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.card-section.collapsed .card-section-toggle {
    transform: rotate(-90deg);
}

.card-section-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card-section.collapsed .card-section-body {
    display: none;
}

/* Dynamic Item Cards */
.item-card {
    background: rgba(45, 45, 45, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 14px;
    position: relative;
}

.item-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.item-card-number {
    background: var(--primary-color);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.item-card-delete {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 18px;
    line-height: 1;
    transition: all 0.2s;
}

.item-card-delete:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.item-card-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.item-card-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.item-card-row .form-group {
    flex: 1;
    min-width: 120px;
    margin-bottom: 0;
}

.item-card-row input,
.item-card-row select,
.item-card-row textarea {
    font-size: 13px;
    padding: 8px 12px;
}

/* Checkbox Options Row */
.checkbox-options {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    padding-top: 4px;
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}

.checkbox-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Empty State */
.section-empty {
    text-align: center;
    padding: 24px 16px;
    color: var(--text-muted);
    font-size: 13px;
}

.section-empty-icon {
    font-size: 28px;
    margin-bottom: 8px;
    opacity: 0.5;
}

/* Add Button */
.add-item-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px;
    background: rgba(220, 20, 60, 0.08);
    border: 1px dashed rgba(220, 20, 60, 0.3);
    border-radius: 6px;
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.add-item-btn:hover {
    background: rgba(220, 20, 60, 0.15);
    border-color: rgba(220, 20, 60, 0.5);
}

/* Basic Info Form */
.basic-info-form {
    padding: 20px;
}

.basic-info-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.basic-info-form .form-group {
    margin-bottom: 0;
}

.basic-info-form .form-group.full-width {
    grid-column: 1 / -1;
}

/* Responsive for Template Modal */
@media (max-width: 960px) {
    .template-form-container {
        grid-template-columns: 1fr;
        padding: 16px;
        gap: 16px;
    }
    
    .modal-content.modal-xl {
        max-width: 100%;
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .basic-info-form .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .item-card-row {
        flex-direction: column;
    }
    
    .item-card-row .form-group {
        min-width: 100%;
    }
    
    .checkbox-options {
        flex-direction: column;
        gap: 10px;
    }
}

/* ==================== BADGES ==================== */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-pending {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
}

.badge-in-progress {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.badge-completed {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.badge-cancelled {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* ==================== FILTERS BAR ==================== */
.filters-bar {
    background: rgba(26, 26, 26, 0.6);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s;
    cursor: pointer;
}

.filter-group select {
    background-image: url('data:image/svg+xml;utf8,<svg fill="white" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 20px;
    padding-right: 36px;
    appearance: none;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(220, 20, 60, 0.15);
}

.filter-group select:hover {
    border-color: rgba(220, 20, 60, 0.5);
    background: rgba(255, 255, 255, 0.07);
}

/* Custom Dropdown */
.custom-dropdown {
    position: relative;
    width: 100%;
}

.custom-dropdown-input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s;
    cursor: pointer;
}

.custom-dropdown-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(220, 20, 60, 0.15);
    cursor: text;
}

.custom-dropdown-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(30, 30, 30, 0.98);
    border: 1px solid var(--primary-color);
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    list-style: none;
    margin: 0;
    padding: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.custom-dropdown-list.open {
    display: block;
}

.custom-dropdown-list li {
    padding: 10px 14px;
    cursor: pointer;
    color: var(--text-primary);
    transition: background 0.2s;
}

.custom-dropdown-list li:hover {
    background: rgba(220, 20, 60, 0.2);
}

.custom-dropdown-list li.selected {
    background: rgba(220, 20, 60, 0.3);
    font-weight: 600;
}

/* ==================== ERROR/SUCCESS MESSAGES ==================== */
.message {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-weight: 500;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.error,
.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
}

.message.success,
.success-message {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success-color);
    color: var(--success-color);
}

/* ==================== RESPONSIVE COMPONENTS ==================== */
@media (max-width: 768px) {
    /* Mobile Cards */
    .card {
        padding: 16px;
        margin-bottom: 16px;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .card-title {
        font-size: 1.125rem;
    }
    
    /* Mobile Tables */
    .table-container {
        margin: 0 -16px;
        border-radius: 0;
    }
    
    table {
        font-size: 13px;
    }
    
    thead th,
    tbody td {
        padding: 10px 12px;
    }
    
    /* Hide some table columns on mobile */
    .table-hide-mobile {
        display: none;
    }
    
    /* Mobile Buttons */
    .btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .btn-add {
        width: 100%;
        justify-content: center;
    }
    
    /* Mobile Modals */
    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 20px auto;
        max-height: calc(100vh - 40px);
        overflow-y: auto;
    }
    
    .modal-header {
        padding: 16px;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .modal-footer {
        padding: 16px;
        flex-direction: column-reverse;
        gap: 12px;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    /* Mobile Filters */
    .filters-bar {
        padding: 16px;
        gap: 12px;
    }
    
    .filter-group {
        flex: 1 1 100%;
        min-width: 100%;
    }
    
    /* Mobile Stats Grid */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    /* Mobile Action Buttons */
    .action-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    /* Extra small screens */
    .card {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .card-title {
        font-size: 1rem;
    }
    
    table {
        font-size: 12px;
    }
    
    thead th,
    tbody td {
        padding: 8px;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .modal-content {
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
    }
}

/* ==================== TABS ==================== */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0;
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.sub-tab-btn {
    padding: 12px 20px;
    background: white;
    border: 2px solid transparent;
    border-radius: 8px;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: center;
}

.sub-tab-btn:hover {
    background: #f8fafc;
    color: #333;
    border-color: #e2e8f0;
}

.sub-tab-btn.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Procurement-specific tabs wrapper - always visible */
.procurement-tabs-wrapper {
    display: block;
    width: 100%;
    padding: 20px 0;
}

.procurement-tabs-wrapper .tab-pane {
    display: none;
}

.procurement-tabs-wrapper .tab-pane.active {
    display: block;
}

/* ==================== TEMPLATE CARDS ==================== */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.template-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s;
}

.template-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-color: var(--primary-color);
}

.template-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.template-card-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--text-primary);
    flex: 1;
}

.template-card-body {
    margin-bottom: 16px;
}

.template-description {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 12px;
    line-height: 1.5;
}

.template-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
}

.meta-item {
    display: flex;
    gap: 8px;
    font-size: 13px;
}

.meta-label {
    color: var(--text-secondary);
}

.template-checklist {
    margin-top: 12px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    font-size: 13px;
    color: var(--text-secondary);
}

.template-card-actions {
    display: flex;
    gap: 8px;
}

.template-card-actions .btn {
    flex: 1;
}

/* Product template groups */
.product-template-group {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.product-template-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.product-template-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text-primary);
}

.templates-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.template-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    transition: all 0.2s;
}

.template-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.template-item-content {
    flex: 1;
}

.template-item-content strong {
    display: inline-block;
    margin-right: 8px;
    color: var(--text-primary);
}

.template-item-content p {
    margin: 6px 0 0 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.template-meta {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.template-item-actions {
    flex-shrink: 0;
}

/* ==================== VIEW TOGGLE ==================== */
.view-toggle-group,
.view-toggle {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 8px;
}

.view-toggle-btn {
    background: transparent;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.view-toggle-btn.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, #ff1744 100%);
    color: white;
}

/* ==================== DATA TABLE ==================== */
.table-container {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    overflow: hidden;
}

.data-table thead {
    background: rgba(255, 255, 255, 0.05);
}

.data-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-size: 14px;
}

.data-table tbody tr {
    transition: background 0.2s ease;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.table-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #ff6b6b);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
    overflow: hidden;
}

.table-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.table-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.search-input {
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    width: 280px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.08);
}

.search-input::placeholder {
    color: var(--text-secondary);
}

/* Role badge styles for table */
.role-badge.custom {
    background: rgba(59, 130, 246, 0.15);
    color: #60A5FA;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* ==================== KANBAN BOARD ==================== */
#tasksViewContainer {
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

.kanban-board {
    display: flex;
    flex-wrap: nowrap;
    gap: 16px;
    padding: 16px 0;
    min-height: 500px;
}

.kanban-column {
    flex: 0 0 280px;
    flex-shrink: 0;
    min-width: 280px;
    max-width: 280px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    max-height: 70vh;
}

.kanban-column-header {
    padding: 16px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: var(--text-primary);
}

.kanban-count {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
}

.kanban-column-body {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kanban-empty {
    text-align: center;
    padding: 24px;
    color: var(--text-secondary);
    font-size: 14px;
}

.kanban-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.kanban-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.kanban-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.kanban-card-id {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.kanban-card-title {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.4;
}

.kanban-card-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.kanban-card-meta.text-danger {
    color: var(--danger-color);
    font-weight: 600;
}

/* ==================== CALENDAR VIEW ==================== */
.calendar-view {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 20px;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.calendar-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 20px;
    min-width: 200px;
    text-align: center;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.calendar-day-name {
    padding: 12px;
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.calendar-cell {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    transition: all 0.2s;
}

.calendar-cell:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--primary-color);
}

.calendar-cell.empty {
    background: transparent;
    border-color: transparent;
}

.calendar-cell.today {
    background: linear-gradient(135deg, rgba(220, 20, 60, 0.1) 0%, rgba(255, 23, 68, 0.1) 100%);
    border-color: var(--primary-color);
}

.calendar-date {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-size: 14px;
}

.calendar-tasks {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.calendar-task {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.4;
    cursor: pointer;
    transition: all 0.2s;
    color: white !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-height: 20px;
    display: block;
}

.calendar-task.priority-low {
    background: #1976d2;
}

.calendar-task.priority-normal {
    background: #388e3c;
}

.calendar-task.priority-high {
    background: #f57c00;
}

.calendar-task.priority-urgent {
    background: #d32f2f;
}

.calendar-task:hover {
    opacity: 0.8;
    transform: scale(1.02);
}

.calendar-task-more {
    padding: 4px 8px;
    text-align: center;
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .templates-grid {
        grid-template-columns: 1fr;
    }
    
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab-btn {
        padding: 10px 16px;
        font-size: 13px;
        white-space: nowrap;
    }
    
    .template-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .template-item-actions {
        width: 100%;
    }
    
    .template-item-actions .btn {
        width: 100%;
    }
    
    /* Kanban mobile - keep horizontal scroll */
    .kanban-column {
        flex: 0 0 260px;
        max-height: 60vh;
    }
    
    /* Calendar mobile */
    .calendar-grid {
        gap: 4px;
    }
    
    .calendar-cell {
        min-height: 80px;
        padding: 4px;
    }
    
    .calendar-task {
        font-size: 11px;
        padding: 3px 6px;
        min-height: 18px;
    }
    
    .view-toggle-group {
        order: -1;
        width: 100%;
        margin-bottom: 12px;
    }
}

/* ==================== FORM GRID ==================== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-grid .form-group.full-width {
    grid-column: 1 / -1;
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== RADIO BUTTONS ==================== */
.radio-group {
    display: flex;
    gap: 20px;
    align-items: center;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 400;
    color: var(--text-primary);
    padding: 10px 16px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    transition: all 0.2s;
}

.radio-label:hover {
    background: rgba(255, 255, 255, 0.08);
}

.radio-label input[type="radio"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

.radio-label input[type="radio"]:checked {
    accent-color: var(--primary-color);
}

.radio-label:has(input[type="radio"]:checked) {
    border-color: var(--primary-color);
    background: rgba(220, 20, 60, 0.1);
}

@media (max-width: 768px) {
    .radio-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .radio-label {
        width: 100%;
    }
}

/* ==================== WAREHOUSE DASHBOARD ==================== */
.warehouse-dashboard {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    font-size: 32px;
    line-height: 1;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.stat-primary {
    border-left: 4px solid var(--primary-color);
}

.stat-success {
    border-left: 4px solid #28a745;
}

.stat-warning {
    border-left: 4px solid #ffc107;
}

.stat-info {
    border-left: 4px solid #17a2b8;
}

.warehouse-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.warehouse-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.warehouse-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-color: var(--primary-color);
}

.warehouse-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.warehouse-card-header h3 {
    font-size: 18px;
    margin: 0;
    color: var(--text-primary);
}

.warehouse-card-body {
    margin-bottom: 16px;
}

.warehouse-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.info-icon {
    font-size: 16px;
}

.warehouse-card-footer {
    display: flex;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.alert-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.alert-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.alert-icon {
    font-size: 24px;
    line-height: 1;
}

.alert-icon.danger {
    color: #dc3545;
}

.alert-icon.warning {
    color: #ffc107;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.alert-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}

.alert-actions {
    display: flex;
    gap: 8px;
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}

.quick-action-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-action-btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-color);
}

.quick-action-icon {
    font-size: 32px;
    line-height: 1;
}

.quick-action-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
}

.text-danger {
    color: #dc3545 !important;
}

.text-warning {
    color: #ffc107 !important;
}

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .warehouse-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==================== STRUCTURE TAB ==================== */
.structure-tab {
    display: flex;
    gap: 20px;
    height: calc(100vh - 200px);
}

.structure-sidebar {
    width: 200px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.structure-section-btn {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

.structure-section-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(4px);
}

.structure-section-btn.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, #ff1744 100%);
    border-color: var(--primary-color);
    font-weight: 500;
}

.structure-content {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 30px;
    overflow-y: auto;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.section-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.data-table {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    overflow: hidden;
}

.data-table table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: rgba(255, 255, 255, 0.05);
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 14px;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.data-table tbody tr {
    cursor: pointer;
}

.data-table tbody tr.inactive {
    opacity: 0.6;
}

.sortable {
    cursor: pointer;
    user-select: none;
}

.sortable:hover {
    background: rgba(255, 255, 255, 0.08);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.table-row {
    transition: all 0.2s;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    transition: all 0.2s;
    opacity: 0.7;
}

.btn-icon:hover {
    opacity: 1;
    transform: scale(1.2);
}

.badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
}

.badge-success {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.badge-danger {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

@media (max-width: 1024px) {
    .structure-tab {
        flex-direction: column;
    }
    
    .structure-sidebar {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
    }
}

/* ==================== TABS ==================== */
.tabs {
    margin-top: 20px;
}

.tab-buttons {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.tab-button {
    padding: 12px 20px;
    background: none;
    border: none;
    color: #999;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    margin-bottom: -2px;
}

.tab-button:hover {
    color: var(--text-primary);
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s;
    width: 100%;
    padding: 20px 0;
}

.tab-content.active {
    display: block;
}

/* User Detail Modal Tab Content Styling */
#userDetailModal .tab-content {
    text-align: left !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 20px 0 !important;
    width: 100% !important;
    display: none;
}

#userDetailModal .tab-content.active {
    display: block !important;
}

#userDetailModal .tabs {
    width: 100%;
}

#userDetailModal .tab-buttons {
    border-bottom: 2px solid rgba(220,20,60,0.1);
    margin-bottom: 20px;
    width: 100%;
    display: flex;
    gap: 16px;
}

/* ==================== USER CARDS ==================== */
.user-card {
    transition: all 0.2s ease;
}

.user-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(220, 20, 60, 0.2) !important;
}

/* ==================== CONTRACT CARDS ==================== */
.contract-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(220, 20, 60, 0.15) !important;
    border-color: rgba(220, 20, 60, 0.3) !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== BADGE STYLES ==================== */
.badge-success {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.badge-secondary {
    background: rgba(158, 158, 158, 0.2);
    color: #9e9e9e;
}

/* ==================== CHOICES.JS CUSTOM STYLES ==================== */
.choices {
    margin-bottom: 0;
    min-width: 60% !important;
    width: 100% !important;
}

.choices__inner {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 6px !important;
    padding: 12px 16px !important;
    min-height: auto !important;
    font-size: 14px !important;
    color: var(--text-primary) !important;
}

.choices__inner:focus,
.choices.is-focused .choices__inner,
.choices.is-open .choices__inner {
    border-color: var(--primary-color) !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

.choices__list--single {
    padding: 0 !important;
}

.choices__input {
    background: transparent !important;
    color: var(--text-primary) !important;
    font-size: 14px !important;
    padding: 0 !important;
    margin-bottom: 0 !important;
}

.choices__input::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
}

.choices__list--dropdown,
.choices__list[aria-expanded] {
    background: rgba(26, 26, 26, 0.95) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 6px !important;
    margin-top: 4px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
    max-height: 300px !important;
    overflow-y: auto !important;
    width: 100% !important;
    min-width: 200px !important;
    z-index: 10001 !important;
}

.choices__list--dropdown .choices__item,
.choices__list[aria-expanded] .choices__item {
    padding: 12px 16px !important;
    color: var(--text-primary) !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    white-space: normal !important;
    word-break: break-word !important;
}

.choices__list--dropdown .choices__item--selectable.is-highlighted,
.choices__list[aria-expanded] .choices__item--selectable.is-highlighted {
    background: rgba(220, 20, 60, 0.2) !important;
    color: var(--text-primary) !important;
}

.choices__list--dropdown .choices__item--selectable:hover,
.choices__list[aria-expanded] .choices__item--selectable:hover {
    background: rgba(220, 20, 60, 0.15) !important;
}

.choices[data-type*="select-one"]::after {
    border-color: var(--text-primary) transparent transparent transparent !important;
    margin-top: -2px !important;
}

.choices[data-type*="select-one"].is-open::after {
    border-color: transparent transparent var(--text-primary) transparent !important;
    margin-top: 0 !important;
}

.choices__placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
    opacity: 1 !important;
}

.choices.is-disabled .choices__inner {
    background: rgba(255, 255, 255, 0.02) !important;
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

@media (max-width: 768px) {
    .choices__list--dropdown,
    .choices__list[aria-expanded] {
        max-height: 240px !important;
    }
    
    .choices__list--dropdown .choices__item,
    .choices__list[aria-expanded] .choices__item {
        padding: 14px 16px !important;
        font-size: 16px !important;
        line-height: 1.5 !important;
    }
    
    .choices__inner {
        padding: 14px 16px !important;
        font-size: 16px !important;
    }
    
    .choices__input {
        font-size: 16px !important;
    }
}

/* ==================== FILTER PANEL (RENTALS) ==================== */
.filter-panel {
    background: rgba(26, 26, 26, 0.6);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.filter-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 1024px) {
    .filter-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .filter-grid {
        grid-template-columns: 1fr;
    }
}

/* Comment Component Styles */
.comment-section {
  margin-top: 20px;
}

.comment-list {
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 15px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.no-comments {
  text-align: center;
  color: #999;
  padding: 20px;
  font-style: italic;
}

.comment-item {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 10px;
  transition: background 0.2s;
}

.comment-item:hover {
  background: rgba(255, 255, 255, 0.12);
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.9em;
}

.comment-header strong {
  color: #fff;
}

.comment-time {
  color: #999;
  font-size: 0.85em;
}

.comment-body {
  color: #ddd;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.mention {
  color: #4da6ff;
  font-weight: 600;
  background: rgba(77, 166, 255, 0.15);
  padding: 2px 4px;
  border-radius: 3px;
}

.comment-input-area {
  position: relative;
}

.comment-input {
  width: 100%;
  padding: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 10px;
}

.comment-input:focus {
  outline: none;
  border-color: rgba(77, 166, 255, 0.5);
  background: rgba(255, 255, 255, 0.1);
}

.comment-input::placeholder {
  color: #999;
}

.mention-suggestions {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  background: #2a2a2a;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  margin-bottom: 5px;
}

.mention-suggestion-item {
  padding: 10px 15px;
  cursor: pointer;
  transition: background 0.2s;
  color: #fff;
}

.mention-suggestion-item:hover,
.mention-suggestion-item.active {
  background: rgba(77, 166, 255, 0.3);
}

.mention-suggestion-item i {
  margin-right: 8px;
  color: #4da6ff;
}

/* ==================== CHOICES.JS DARK THEME ==================== */
.choices.choices-dark {
    font-size: 14px;
}

.choices.choices-dark .choices__inner {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
    min-height: 42px;
    color: #fff;
}

.choices.choices-dark .choices__inner:focus-within {
    border-color: var(--primary-color);
}

.choices.choices-dark .choices__input {
    background: transparent;
    color: #fff;
    margin-bottom: 0;
    padding: 0;
}

.choices.choices-dark .choices__input::placeholder {
    color: #888;
}

.choices.choices-dark .choices__list--dropdown {
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 10001 !important;
}

.choices.choices-dark .choices__list--dropdown .choices__item {
    color: #fff;
    padding: 10px 14px;
}

.choices.choices-dark .choices__list--dropdown .choices__item--selectable:hover,
.choices.choices-dark .choices__list--dropdown .choices__item--selectable.is-highlighted {
    background: rgba(229, 62, 62, 0.2);
    color: #fff;
}

.choices.choices-dark .choices__list--dropdown .choices__item--selectable.is-selected {
    background: rgba(229, 62, 62, 0.3);
}

.choices.choices-dark .choices__item {
    color: #fff;
}

.choices.choices-dark .choices__item--selectable {
    color: #fff;
}

.choices.choices-dark .choices__placeholder {
    color: #888;
    opacity: 1;
}

/* Multi-select items (pills/tags) */
.choices.choices-dark .choices__list--multiple .choices__item {
    background: linear-gradient(135deg, var(--primary-color), #ff6b6b);
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
    margin: 2px 4px 2px 0;
    color: #fff;
    font-size: 13px;
}

.choices.choices-dark .choices__list--multiple .choices__item .choices__button {
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    margin-left: 8px;
    padding-left: 8px;
    filter: brightness(1.2);
}

.choices.choices-dark .choices__button {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/%3E%3C/svg%3E");
}

/* Single select */
.choices.choices-dark .choices__list--single .choices__item {
    color: #fff;
}

/* Searchbox in dropdown */
.choices.choices-dark .choices__list--dropdown .choices__input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 10px 14px;
}

/* No results text */
.choices.choices-dark .choices__list--dropdown .has-no-results {
    color: #888;
}

/* Customer participant inputs */
.customer-participant-item {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}

.customer-participant-item input {
    flex: 1;
    min-width: 0;
}

.customer-participant-item .participant-firstname,
.customer-participant-item .participant-lastname {
    flex: 1;
}

.customer-participant-item .participant-phone {
    flex: 1.2;
}

.customer-participant-item .btn-remove {
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: rgba(229, 62, 62, 0.2);
    color: var(--primary-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.customer-participant-item .btn-remove:hover {
    background: rgba(229, 62, 62, 0.4);
}

.btn-add-participant {
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    color: #888;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    width: 100%;
    text-align: center;
}

.btn-add-participant:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

/* Customer contacts list */
.customer-contacts-list {
    margin-top: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.customer-contacts-title {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.customer-contact-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.08);
    padding: 6px 12px;
    border-radius: 20px;
    margin: 4px 4px 4px 0;
    font-size: 13px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.customer-contact-chip:hover {
    background: rgba(229, 62, 62, 0.2);
}

.customer-contact-chip.selected {
    background: linear-gradient(135deg, var(--primary-color), #ff6b6b);
}

/* ==================== MEETING SETTINGS TABS ==================== */
.settings-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 12px;
}

.settings-tab {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px 8px 0 0;
    color: #888;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.settings-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.settings-tab.active {
    background: rgba(229, 62, 62, 0.2);
    border-color: var(--primary-color);
    color: #fff;
}

/* Location Types Grid */
.location-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.location-type-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.location-type-icon {
    font-size: 28px;
}

.location-type-info {
    flex: 1;
}

.location-type-label {
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.location-type-value {
    font-size: 12px;
    color: #888;
    font-family: monospace;
}

/* ==================== PROCUREMENT ==================== */
.items-section {
    margin-top: 20px;
}

.items-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.items-header h3 {
    margin: 0;
}

.item-row {
    margin-bottom: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
}

.item-row-inner {
    display: grid;
    grid-template-columns: 140px 1fr 100px 100px auto;
    gap: 10px;
    align-items: center;
}

.item-row-inner.custom-item {
    grid-template-columns: 140px 1fr 1fr 100px 100px auto;
}

.item-type-select {
    min-width: 140px;
}

.product-select {
    min-width: 150px;
}

.item-name-input {
    min-width: 150px;
}

.item-desc-input {
    min-width: 120px;
}

.qty-input {
    width: 100px;
}

.price-input {
    width: 100px;
}

.badge-purple {
    background: rgba(147, 51, 234, 0.2);
    color: #a855f7;
    border: 1px solid rgba(147, 51, 234, 0.3);
}

.order-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.order-link:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .item-row-inner,
    .item-row-inner.custom-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .item-row-inner > * {
        width: 100%;
    }
}
