/**
 * ============================================================================
 * COMPONENTS.CSS
 * ============================================================================
 * 
 * Canonical UI component library for the Ticketing System.
 * All reusable components use the `tk-` prefix to avoid Bootstrap collisions.
 * 
 * NAMING CONVENTION:
 *   - tk-{component}           → Base component class
 *   - tk-{component}-{variant} → Visual variant (primary, danger, etc.)
 *   - tk-{component}-{size}    → Size modifier (sm, lg, xl)
 * 
 * DEPENDENCIES:
 *   - definitions.css (CSS custom properties / tokens)
 *   - base.css (reset and typography)
 * 
 * SECTIONS:
 *   1. Buttons
 *   2. Inputs & Form Controls
 *   3. Modals
 *   4. Dropdowns
 *   5. Badges & Chips
 *   6. Cards & Panels
 *   7. Tables
 *   8. Toasts & Notifications
 *   9. Loading States
 *  10. Tooltips
 * 
 * LAST UPDATED: 2026-01-14
 * ============================================================================
 */


/* =============================================================================
   1. BUTTONS
   =============================================================================
   
   Usage:
     <button class="tk-btn tk-btn-primary">Primary</button>
     <button class="tk-btn tk-btn-secondary">Secondary</button>
     <button class="tk-btn tk-btn-ghost">Ghost</button>
     <button class="tk-btn tk-btn-danger">Danger</button>
   
   Sizes:
     <button class="tk-btn tk-btn-primary tk-btn-sm">Small</button>
     <button class="tk-btn tk-btn-primary tk-btn-lg">Large</button>
   
   States:
     <button class="tk-btn tk-btn-primary" disabled>Disabled</button>
   
   ============================================================================= */

/* Base Button */
.tk-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-md, 8px);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.15s ease;
    user-select: none;
    white-space: nowrap;
}

.tk-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.tk-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Button press animation */
.tk-btn:active:not(:disabled) {
    transform: scale(0.97);
}

/* --- Button Variants --- */

/* Primary - Main call-to-action */
.tk-btn-primary {
    background: linear-gradient(135deg, var(--primary-gradient-start), var(--primary-gradient-end));
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

.tk-btn-primary:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
    transform: translateY(-1px);
}

/* Secondary - Alternative actions */
.tk-btn-secondary {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.tk-btn-secondary:hover:not(:disabled) {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    border-color: var(--border-color-hover);
}

/* Ghost - Minimal visual weight */
.tk-btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.tk-btn-ghost:hover:not(:disabled) {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

/* Danger - Destructive actions */
.tk-btn-danger {
    background: var(--color-danger);
    color: white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.tk-btn-danger:hover:not(:disabled) {
    background: var(--color-danger-hover, #dc2626);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
    transform: translateY(-1px);
}

/* Warning - Caution actions */
.tk-btn-warning {
    background: var(--color-warning);
    color: white;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

.tk-btn-warning:hover:not(:disabled) {
    background: var(--color-warning-hover, #d97706);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
    transform: translateY(-1px);
}

/* Success - Positive actions */
.tk-btn-success {
    background: var(--color-success);
    color: white;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.25);
}

.tk-btn-success:hover:not(:disabled) {
    background: var(--color-success-hover, #16a34a);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.35);
    transform: translateY(-1px);
}

/* --- Button Sizes --- */

.tk-btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm, 6px);
}

.tk-btn-lg {
    padding: 14px 24px;
    font-size: 15px;
    border-radius: var(--radius-lg, 10px);
}

/* --- Icon Button --- */
.tk-btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-md, 8px);
}

.tk-btn-icon.tk-btn-sm {
    width: 28px;
    height: 28px;
}

.tk-btn-icon.tk-btn-lg {
    width: 44px;
    height: 44px;
}


/* =============================================================================
   2. INPUTS & FORM CONTROLS
   =============================================================================
   
   Usage:
     <input type="text" class="tk-input" placeholder="Enter text...">
     <input type="text" class="tk-input tk-input-error">
     
   With label:
     <div class="tk-field">
       <label class="tk-label">Email</label>
       <input type="email" class="tk-input">
       <span class="tk-help">We'll never share your email</span>
     </div>
   
   ============================================================================= */

/* Base Input, Textarea, Select */
.tk-input,
.tk-textarea,
.tk-select {
    display: block;
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.4;
    color: var(--text-primary);
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md, 8px);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.tk-input::placeholder,
.tk-textarea::placeholder {
    color: var(--text-placeholder, var(--text-tertiary));
}

.tk-input:hover:not(:disabled),
.tk-textarea:hover:not(:disabled),
.tk-select:hover:not(:disabled) {
    border-color: var(--border-color-hover);
}

.tk-input:focus,
.tk-textarea:focus,
.tk-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-bg-light, rgba(59, 130, 246, 0.1));
    outline: none;
}

.tk-input:disabled,
.tk-textarea:disabled,
.tk-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--bg-surface-hover);
}

/* Input States */
.tk-input-error,
.tk-textarea-error,
.tk-select-error {
    border-color: var(--color-danger);
}

.tk-input-error:focus,
.tk-textarea-error:focus,
.tk-select-error:focus {
    box-shadow: 0 0 0 3px var(--color-danger-bg);
}

.tk-input-success,
.tk-textarea-success,
.tk-select-success {
    border-color: var(--color-success);
}

/* Input Sizes */
.tk-input-sm,
.tk-textarea-sm,
.tk-select-sm {
    padding: 6px 10px;
    font-size: 12px;
}

.tk-input-lg,
.tk-textarea-lg,
.tk-select-lg {
    padding: 14px 18px;
    font-size: 16px;
}

/* --- Field Container --- */
.tk-field {
    margin-bottom: 16px;
}

.tk-field:last-child {
    margin-bottom: 0;
}

/* Label */
.tk-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.tk-label-required::after {
    content: " *";
    color: var(--color-danger);
}

/* Help Text */
.tk-help {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-tertiary);
}

/* Error Message */
.tk-error {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--color-danger);
}

/* --- Textarea --- */
.tk-textarea {
    min-height: 100px;
    resize: vertical;
    line-height: 1.5;
}

.tk-textarea-sm {
    min-height: 60px;
}

.tk-textarea-lg {
    min-height: 150px;
}

/* --- Select --- */
.tk-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

/* Dark mode chevron for select */
[data-theme="dark"] .tk-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239ca3af' d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E");
}

.tk-select-sm {
    padding-right: 32px;
    background-position: right 10px center;
}

.tk-select-lg {
    padding-right: 42px;
    background-position: right 14px center;
}

/* --- Checkbox & Radio --- */
.tk-checkbox,
.tk-radio {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.tk-checkbox input,
.tk-radio input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

/* --- Search Input --- */
.tk-search {
    position: relative;
}

.tk-search-input {
    padding-left: 40px;
}

.tk-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    pointer-events: none;
}

.tk-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
}

.tk-search:hover .tk-search-clear,
.tk-search-input:focus ~ .tk-search-clear {
    opacity: 1;
}

.tk-search-clear:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}


/* =============================================================================
   3. MODALS
   =============================================================================
   
   Usage:
     <div class="tk-modal-backdrop">
       <div class="tk-modal">
         <div class="tk-modal-header">
           <h3 class="tk-modal-title">Title</h3>
           <button class="tk-modal-close">×</button>
         </div>
         <div class="tk-modal-body">Content</div>
         <div class="tk-modal-footer">
           <button class="tk-btn tk-btn-ghost">Cancel</button>
           <button class="tk-btn tk-btn-primary">Save</button>
         </div>
       </div>
     </div>
   
   Sizes:
     <div class="tk-modal tk-modal-sm">...</div>
     <div class="tk-modal tk-modal-lg">...</div>
     <div class="tk-modal tk-modal-xl">...</div>
   
   ============================================================================= */

/* Backdrop */
.tk-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10100;
    animation: tk-backdrop-in 0.2s ease-out;
}

@keyframes tk-backdrop-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Modal Container */
.tk-modal {
    background: var(--bg-surface);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xl, 0 25px 50px -12px rgba(0, 0, 0, 0.25));
    width: 480px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 64px);
    display: flex;
    flex-direction: column;
    animation: tk-modal-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes tk-modal-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Modal Sizes */
.tk-modal-sm { width: 400px; }
.tk-modal-lg { width: 640px; }
.tk-modal-xl { width: 800px; }
.tk-modal-full { width: calc(100vw - 64px); height: calc(100vh - 64px); }

/* Modal Header */
.tk-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.tk-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.tk-modal-title i {
    font-size: 18px;
}

.tk-modal-title .text-danger {
    color: var(--color-danger);
}

/* Modal Close Button */
.tk-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.tk-modal-close:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

/* Modal Body */
.tk-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* Modal Footer */
.tk-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

/* Confirmation Modal Specific */
.tk-confirm-message {
    font-size: 14px;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    line-height: 1.5;
}

.tk-confirm-detail {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}


/* =============================================================================
   4. DROPDOWNS
   =============================================================================
   
   Usage:
     <div class="tk-dropdown">
       <button class="tk-dropdown-trigger">Menu</button>
       <div class="tk-dropdown-menu">
         <button class="tk-dropdown-item">Item 1</button>
         <button class="tk-dropdown-item">Item 2</button>
         <div class="tk-dropdown-divider"></div>
         <button class="tk-dropdown-item tk-dropdown-item-danger">Delete</button>
       </div>
     </div>
   
   ============================================================================= */

.tk-dropdown {
    position: relative;
    display: inline-block;
}

/* Dropdown Menu */
.tk-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    min-width: 180px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    padding: 6px 0;
    z-index: 1000;
    animation: tk-dropdown-in 0.15s ease-out;
    transform-origin: top left;
}

/* Right-aligned variant */
.tk-dropdown-menu-right {
    left: auto;
    right: 0;
    transform-origin: top right;
}

@keyframes tk-dropdown-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-4px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Dropdown Item */
.tk-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 14px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.1s, color 0.1s;
}

.tk-dropdown-item:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

.tk-dropdown-item:active {
    background: var(--bg-surface-active);
}

.tk-dropdown-item i {
    width: 16px;
    font-size: 14px;
    text-align: center;
    color: var(--text-tertiary);
    transition: color 0.1s;
}

.tk-dropdown-item:hover i {
    color: var(--text-secondary);
}

/* Danger Item */
.tk-dropdown-item-danger {
    color: var(--color-danger);
}

.tk-dropdown-item-danger:hover {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

.tk-dropdown-item-danger i {
    color: var(--color-danger);
}

/* Divider */
.tk-dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 6px 0;
}

/* Backdrop for closing on outside click */
.tk-dropdown-backdrop {
    position: fixed;
    inset: 0;
    z-index: 999;
}


/* =============================================================================
   5. BADGES & CHIPS
   =============================================================================
   
   Usage:
     <span class="tk-badge">Default</span>
     <span class="tk-badge tk-badge-primary">Primary</span>
     <span class="tk-badge tk-badge-success">Success</span>
     <span class="tk-badge tk-badge-warning">Warning</span>
     <span class="tk-badge tk-badge-danger">Danger</span>
   
   Chips (interactive):
     <button class="tk-chip">
       <span>Tag</span>
       <i class="bi bi-x"></i>
     </button>
   
   ============================================================================= */

.tk-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
    border-radius: 9999px;
    background: var(--bg-surface-hover);
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Badge Variants */
.tk-badge-primary {
    background: var(--primary-bg-light);
    color: var(--primary-color);
}

.tk-badge-success {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.tk-badge-warning {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.tk-badge-danger {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

.tk-badge-info {
    background: var(--color-info-bg, rgba(59, 130, 246, 0.1));
    color: var(--color-info, #3b82f6);
}

/* Badge Sizes */
.tk-badge-sm {
    padding: 2px 6px;
    font-size: 10px;
}

.tk-badge-lg {
    padding: 6px 14px;
    font-size: 13px;
}

/* --- Chips (Interactive Tags) --- */
.tk-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.tk-chip:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-color-hover);
}

.tk-chip i {
    font-size: 12px;
    opacity: 0.6;
}

.tk-chip:hover i {
    opacity: 1;
}


/* =============================================================================
   6. CARDS & PANELS
   =============================================================================
   
   Usage:
     <div class="tk-card">
       <div class="tk-card-header">
         <h3 class="tk-card-title">Title</h3>
       </div>
       <div class="tk-card-body">Content</div>
       <div class="tk-card-footer">Footer</div>
     </div>
   
   ============================================================================= */

.tk-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg, 12px);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

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

.tk-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.tk-card-body {
    padding: 20px;
}

.tk-card-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-surface-hover);
}

/* Card Variants */
.tk-card-flat {
    box-shadow: none;
}

.tk-card-interactive {
    cursor: pointer;
    transition: all 0.2s;
}

.tk-card-interactive:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}


/* =============================================================================
   7. TABLES
   =============================================================================
   
   Usage:
     <table class="tk-table">
       <thead>
         <tr>
           <th>Column 1</th>
           <th>Column 2</th>
         </tr>
       </thead>
       <tbody>
         <tr>
           <td>Data 1</td>
           <td>Data 2</td>
         </tr>
       </tbody>
     </table>
   
   ============================================================================= */

.tk-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.tk-table th,
.tk-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.tk-table th {
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
    background: var(--bg-surface-hover);
}

.tk-table td {
    color: var(--text-primary);
}

.tk-table tbody tr:hover {
    background: var(--bg-surface-hover);
}

/* Striped variant */
.tk-table-striped tbody tr:nth-child(even) {
    background: var(--bg-surface-hover);
}

/* Bordered variant */
.tk-table-bordered th,
.tk-table-bordered td {
    border: 1px solid var(--border-color);
}

/* Compact variant */
.tk-table-compact th,
.tk-table-compact td {
    padding: 8px 12px;
}


/* =============================================================================
   8. TOASTS & NOTIFICATIONS
   =============================================================================
   
   Usage:
     <div class="tk-toast tk-toast-success">
       <i class="bi bi-check-circle"></i>
       <span>Operation successful</span>
       <button class="tk-toast-close">×</button>
     </div>
   
   ============================================================================= */

.tk-toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 11000;
}

.tk-toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    min-width: 300px;
    max-width: 450px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    animation: tk-toast-in 0.3s ease-out;
}

@keyframes tk-toast-in {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.tk-toast i {
    font-size: 18px;
    flex-shrink: 0;
}

.tk-toast span {
    flex: 1;
    font-size: 13px;
    color: var(--text-primary);
}

.tk-toast-close {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
}

.tk-toast-close:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

/* Toast Variants */
.tk-toast-success {
    border-left: 4px solid var(--color-success);
}

.tk-toast-success i {
    color: var(--color-success);
}

.tk-toast-error {
    border-left: 4px solid var(--color-danger);
}

.tk-toast-error i {
    color: var(--color-danger);
}

.tk-toast-warning {
    border-left: 4px solid var(--color-warning);
}

.tk-toast-warning i {
    color: var(--color-warning);
}

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

.tk-toast-info i {
    color: var(--primary-color);
}


/* =============================================================================
   9. LOADING STATES
   =============================================================================
   
   Usage:
     <div class="tk-spinner"></div>
     <div class="tk-spinner tk-spinner-sm"></div>
     <div class="tk-skeleton tk-skeleton-text"></div>
     <div class="tk-skeleton tk-skeleton-box"></div>
   
   ============================================================================= */

/* Spinner */
.tk-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: tk-spin 0.8s linear infinite;
}

.tk-spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.tk-spinner-lg {
    width: 36px;
    height: 36px;
    border-width: 4px;
}

@keyframes tk-spin {
    to { transform: rotate(360deg); }
}

/* Inline spinner for buttons */
.tk-spinner-inline {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: tk-spin 0.6s linear infinite;
    margin-right: 6px;
}

/* Skeleton Loading */
.tk-skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-surface-hover) 25%,
        var(--bg-surface-active, rgba(255, 255, 255, 0.1)) 50%,
        var(--bg-surface-hover) 75%
    );
    background-size: 200% 100%;
    animation: tk-shimmer 1.5s infinite;
    border-radius: 4px;
}

@keyframes tk-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.tk-skeleton-text {
    height: 14px;
    width: 100%;
    margin-bottom: 8px;
}

.tk-skeleton-text:last-child {
    width: 60%;
    margin-bottom: 0;
}

.tk-skeleton-box {
    height: 40px;
    width: 100%;
}

.tk-skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.tk-skeleton-title {
    height: 20px;
    width: 40%;
}


/* =============================================================================
   10. TOOLTIPS
   =============================================================================
   
   Usage:
     <button class="tk-tooltip" data-tooltip="Helpful tip">
       Hover me
     </button>
   
   ============================================================================= */

.tk-tooltip {
    position: relative;
}

.tk-tooltip::before,
.tk-tooltip::after {
    position: absolute;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
}

/* Tooltip text */
.tk-tooltip::after {
    content: attr(data-tooltip);
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    background: var(--bg-tooltip, #1f2937);
    color: white;
    border-radius: 6px;
    box-shadow: var(--shadow-md);
}

/* Tooltip arrow */
.tk-tooltip::before {
    content: "";
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    border: 6px solid transparent;
    border-top-color: var(--bg-tooltip, #1f2937);
}

.tk-tooltip:hover::before,
.tk-tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

.tk-tooltip:hover::after {
    transform: translateX(-50%) translateY(-4px);
}

.tk-tooltip:hover::before {
    transform: translateX(-50%) translateY(0);
}

/* Bottom tooltip variant */
.tk-tooltip-bottom::after {
    bottom: auto;
    top: 100%;
    transform: translateX(-50%) translateY(-4px);
}

.tk-tooltip-bottom::before {
    bottom: auto;
    top: 100%;
    transform: translateX(-50%) translateY(-8px);
    border-top-color: transparent;
    border-bottom-color: var(--bg-tooltip, #1f2937);
}

.tk-tooltip-bottom:hover::after {
    transform: translateX(-50%) translateY(4px);
}

.tk-tooltip-bottom:hover::before {
    transform: translateX(-50%) translateY(0);
}


/* =============================================================================
   11. ASSET CONDITION INDICATORS
   =============================================================================

   Usage:
     <span class="tk-condition tk-condition-excellent">Excellent</span>
     <span class="tk-condition tk-condition-good">Good</span>
     <span class="tk-condition tk-condition-fair">Fair</span>
     <span class="tk-condition tk-condition-poor">Poor</span>
     <span class="tk-condition tk-condition-damaged">Damaged</span>
     <span class="tk-condition tk-condition-nonfunctional">Non-Functional</span>

   ============================================================================= */

.tk-condition {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    border-radius: 9999px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Condition Variants */
.tk-condition-excellent {
    background: var(--condition-excellent-bg);
    color: var(--condition-excellent);
}

.tk-condition-good {
    background: var(--condition-good-bg);
    color: var(--condition-good);
}

.tk-condition-fair {
    background: var(--condition-fair-bg);
    color: var(--condition-fair);
}

.tk-condition-poor {
    background: var(--condition-poor-bg);
    color: var(--condition-poor);
}

.tk-condition-damaged {
    background: var(--condition-damaged-bg);
    color: var(--condition-damaged);
}

.tk-condition-nonfunctional {
    background: var(--condition-nonfunctional-bg);
    color: var(--condition-nonfunctional);
}

/* Condition with dot indicator (alternative style) */
.tk-condition-dot {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.tk-condition-dot::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tk-condition-dot.excellent::before { background: var(--condition-excellent); }
.tk-condition-dot.good::before { background: var(--condition-good); }
.tk-condition-dot.fair::before { background: var(--condition-fair); }
.tk-condition-dot.poor::before { background: var(--condition-poor); }
.tk-condition-dot.damaged::before { background: var(--condition-damaged); }
.tk-condition-dot.nonfunctional::before { background: var(--condition-nonfunctional); }


/* =============================================================================
   12. INTERNAL NOTES
   =============================================================================

   Usage:
     <div class="tk-internal-note">
       <i class="bi bi-lock-fill"></i>
       <span>Internal only - not visible to customers</span>
     </div>

   ============================================================================= */

.tk-internal-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: var(--internal-note-bg);
    border-left: 3px solid var(--internal-note-border);
    border-radius: 0 8px 8px 0;
    font-size: 13px;
    color: var(--internal-note-text);
}

.tk-internal-note i {
    flex-shrink: 0;
    margin-top: 2px;
}

.tk-internal-note-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    background: var(--internal-note-bg);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    color: var(--internal-note-text);
}


/* =============================================================================
   13. NOTIFICATION BADGES (for NotificationBell)
   =============================================================================

   Usage:
     <span class="tk-notification-dot">5</span>
     <span class="tk-notification-badge tk-notification-success">Info</span>

   ============================================================================= */

.tk-notification-dot {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--color-danger);
    color: white;
    font-size: 10px;
    font-weight: 600;
    border-radius: 9999px;
}

.tk-notification-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
}

.tk-notification-success {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.tk-notification-warning {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.tk-notification-error {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

.tk-notification-info {
    background: var(--color-info-bg);
    color: var(--color-info);
}


/* =============================================================================
   14. PILL/CHIP UTILITY CLASSES
   =============================================================================

   Usage:
     <span class="tk-pill tk-pill-green">Category</span>
     <span class="tk-pill tk-pill-blue">Status</span>
     <span class="tk-pill tk-pill-purple">Label</span>

   ============================================================================= */

.tk-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid transparent;
    white-space: nowrap;
}

.tk-pill-green {
    background-color: var(--pill-green);
    color: var(--pill-green-text);
    border-color: var(--pill-green-border);
}

.tk-pill-blue {
    background-color: var(--pill-blue);
    color: var(--pill-blue-text);
    border-color: var(--pill-blue-border);
}

.tk-pill-purple {
    background-color: var(--pill-purple);
    color: var(--pill-purple-text);
    border-color: var(--pill-purple-border);
}

.tk-pill-orange {
    background-color: var(--pill-orange);
    color: var(--pill-orange-text);
    border-color: var(--pill-orange-border);
}

.tk-pill-yellow {
    background-color: var(--pill-yellow);
    color: var(--pill-yellow-text);
    border-color: var(--pill-yellow-border);
}

.tk-pill-red {
    background-color: var(--pill-red);
    color: var(--pill-red-text);
    border-color: var(--pill-red-border);
}

.tk-pill-gray {
    background-color: var(--pill-gray);
    color: var(--pill-gray-text);
    border-color: var(--pill-gray-border);
}


/* =============================================================================
   15. WARRANTY STATUS CLASSES
   =============================================================================

   Usage:
     <span class="tk-warranty-active">Active</span>
     <span class="tk-warranty-expiring">Expiring Soon</span>
     <span class="tk-warranty-expired">Expired</span>

   ============================================================================= */

.tk-warranty-active {
    color: var(--warranty-active);
}

.tk-warranty-active-bg {
    background-color: var(--warranty-active-bg);
    color: var(--warranty-active);
    padding: 2px 8px;
    border-radius: 4px;
}

.tk-warranty-expiring {
    color: var(--warranty-expiring);
}

.tk-warranty-expiring-bg {
    background-color: var(--warranty-expiring-bg);
    color: var(--warranty-expiring);
    padding: 2px 8px;
    border-radius: 4px;
}

.tk-warranty-expired {
    color: var(--warranty-expired);
}

.tk-warranty-expired-bg {
    background-color: var(--warranty-expired-bg);
    color: var(--warranty-expired);
    padding: 2px 8px;
    border-radius: 4px;
}
