/* ==========================================================================
   5. Stats Cards — Frosted Glass
   ========================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr;
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(107, 123, 152, 0.3), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover {
    border-color: rgba(44, 51, 69, 0.08);
    box-shadow: var(--shadow-glow);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    background: rgba(211, 215, 226, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.stat-card-icon i {
    font-size: 18px;
    color: var(--accent);
}

.stat-card-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}

.stat-card-value {
    font-size: 32px;
    font-weight: 300;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.stat-card-sublabel {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.4;
    word-break: break-word;
}

.stat-max-storage {
    font-size: 0.45em;
    font-weight: 400;
    color: var(--text-muted);
    white-space: nowrap;
}

.stat-card.upload-card {
    padding: 0;
    display: flex;
    align-items: stretch;
}

.stat-card.upload-card .upload-drop-zone {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
}

.stat-card.upload-card::before {
    display: none;
}

.stat-card.upload-card:hover {
    box-shadow: none;
    border-color: var(--border);
}

/* ==========================================================================
   6. Search Section
   ========================================================================== */
.search-section {
    margin-bottom: 16px;
}

.search-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-input-group {
    position: relative;
    flex: 1;
}

.search-input-group .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: var(--text-muted);
    pointer-events: none;
    transition: color var(--transition);
}

#search-input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-input);
    outline: none;
    font-family: var(--font-stack);
    transition: border-color var(--transition), box-shadow var(--transition);
}

#search-input::placeholder {
    color: var(--text-muted);
}

#search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow), 0 0 20px rgba(107, 123, 152, 0.08);
}

#search-input:focus + .search-icon,
#search-input:focus ~ .search-icon {
    color: var(--accent);
}

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

.btn-search {
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.btn-search-primary {
    background: var(--accent);
    color: #fff;
}

.btn-search-primary:hover {
    background: var(--accent-hover);
}

.btn-search-ghost {
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-search-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: rgba(44, 51, 69, 0.12);
}

/* ==========================================================================
   7. Files Section — Info-Dense Design
   ========================================================================== */
.files-section {
    margin-top: 8px;
}

.design-section-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.design-title-group h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.design-title-group p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

.page-size-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

#page-size-select {
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-primary);
    background: var(--bg-elevated);
    outline: none;
    cursor: pointer;
    font-family: var(--font-stack);
    transition: border-color var(--transition);
}

#page-size-select:focus {
    border-color: var(--accent);
}

.files-table {
    width: 100%;
}

.files-table thead th {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
    user-select: none;
    background: rgba(230, 236, 244, 0.5);
}

.files-table tbody td {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 14px;
    color: var(--text-primary);
    vertical-align: middle;
}

.files-table tbody tr {
    transition: background var(--transition);
}

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

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

/* ==========================================================================
   7b. File Cards Section — Variation 3 (Info-Dense)
   ========================================================================== */
.file-cards-list {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.file-card {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--transition);
}

.file-card:last-child {
    border-bottom: none;
}

.file-card:hover {
    background: var(--bg-hover);
}

.file-card.file-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 3px vertical colored strip */
.file-strip {
    width: 3px;
    height: 40px;
    border-radius: 2px;
    margin-right: 12px;
    flex-shrink: 0;
}

.file-strip.pdf {
    background: #dc2626;
}

.file-strip.image {
    background: #2563eb;
}

.file-strip.csv {
    background: #16a34a;
}

.file-strip.default {
    background: var(--text-muted);
}

.file-strip.audio {
    background: #7c3aed;
}

.file-strip.video {
    background: #ea580c;
}

.file-strip.code {
    background: #ca8a04;
}

/* Container for icon + badge */
.file-icon-wrap {
    position: relative;
    margin-right: 12px;
    flex-shrink: 0;
}

/* 40x40 icon container */
.file-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    font-size: 20px;
}

.file-icon.pdf {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    color: #dc2626;
}

.file-icon.pdf i {
    color: #dc2626;
}

.file-icon.image {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: #2563eb;
}

.file-icon.image i {
    color: #2563eb;
}

.file-icon.csv {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    color: #16a34a;
}

.file-icon.csv i {
    color: #16a34a;
}

.file-icon.default {
    background: linear-gradient(135deg, var(--bg-elevated), var(--bg-hover));
    color: var(--text-secondary);
}

.file-icon.default i {
    color: var(--text-secondary);
}

.file-icon.audio {
    background: linear-gradient(135deg, #faf5ff, #f3e8ff);
    color: #7c3aed;
}

.file-icon.audio i {
    color: #7c3aed;
}

.file-icon.video {
    background: linear-gradient(135deg, #fff7ed, #ffedd5);
    color: #ea580c;
}

.file-icon.video i {
    color: #ea580c;
}

.file-icon.code {
    background: linear-gradient(135deg, #fefce8, #fef9c3);
    color: #ca8a04;
}

.file-icon.code i {
    color: #ca8a04;
}

/* Small overlay badge for file type */
.file-type-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--bg-surface);
    border: 1px solid var(--border);
}

.file-type-badge.pdf {
    color: #dc2626;
}

.file-type-badge.image {
    color: #2563eb;
}

.file-type-badge.csv {
    color: #16a34a;
}

.file-type-badge.default {
    color: var(--text-secondary);
}

.file-type-badge.audio {
    color: #7c3aed;
}

.file-type-badge.video {
    color: #ea580c;
}

.file-type-badge.code {
    color: #ca8a04;
}

/* User card status colors */
.user-strip.active {
    background: var(--success);
}

.user-strip.inactive {
    background: var(--text-muted);
}

.user-icon.active {
    background: linear-gradient(135deg, #e8f0eb, #dcf0e2);
    color: var(--success);
}

.user-icon.active i {
    color: var(--success);
}

.user-icon.inactive {
    background: linear-gradient(135deg, var(--bg-elevated), var(--bg-hover));
    color: var(--text-muted);
}

.user-icon.inactive i {
    color: var(--text-muted);
}

.user-type-badge.active {
    color: var(--success);
}

.user-type-badge.inactive {
    color: var(--text-muted);
}

/* Main info container (flex: 1) */
.file-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Filename in row */
.file-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Clickable filename link */
.file-name-link {
    display: block;
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

.file-name-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* Inline metadata row */
.file-meta {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.file-meta .meta-separator {
    color: var(--text-muted);
}

/* Expiry section */
.file-expiry {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-right: 16px;
    flex-shrink: 0;
}

.expiry-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.expiry-date {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.expiry-date.warning {
    color: #ea580c;
}

/* Action buttons container */
.file-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.file-action-btn {
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.file-action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--accent);
}

.file-action-btn.btn-extend:hover {
    color: #2563eb;
    background: #eff6ff;
    border-color: #bfdbfe;
}

.file-action-btn.btn-delete:hover {
    color: #dc2626;
    background: #fef2f2;
    border-color: #fecaca;
}

/* Legacy card layout classes (deprecated, kept for backward compatibility) */
.file-card-header {
    display: none;
}

.file-card-ext-badge {
    display: none;
}

.file-card-divider {
    display: none;
}

.file-card-specs {
    display: none;
}

.file-card-spec-label {
    display: none;
}

.file-card-spec-value {
    display: none;
}

.file-card-spec-value.mono {
    display: none;
}

.file-card-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    vertical-align: middle;
    margin-left: 6px;
}

.file-card-copy-btn:hover {
    background: var(--bg-hover);
    color: var(--accent);
    border-color: var(--border);
}

.file-card-actions {
    display: none;
}

.file-card-action-btn {
    display: none;
}

.file-card-action-btn.btn-extend:hover {
    display: none;
}

.file-card-action-btn.btn-delete:hover {
    display: none;
}

.file-card-owner {
    display: none;
}

.file-card-owner.admin-only {
    display: none;
}

.file-card-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
    font-size: 14px;
}

.file-card-url-link {
    color: var(--accent);
    text-decoration: none;
    word-break: break-all;
}

.file-card-url-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* ==========================================================================
   8. Pagination
   ========================================================================== */
.pagination-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    margin-top: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.pagination-right-group {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

#pagination-info {
    font-size: 13px;
    color: var(--text-muted);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

#page-indicator {
    font-size: 13px;
    color: var(--text-secondary);
}

.btn-page {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: background var(--transition), color var(--transition), border-color var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-page:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: rgba(44, 51, 69, 0.12);
}

.btn-page:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ==========================================================================
   9. Alert / Toast System — Light theme
   ========================================================================== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid transparent;
    position: relative;
    color: var(--text-primary);
}

.alert-dismissible {
    padding-right: 40px;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border-color: rgba(107, 152, 126, 0.2);
}

.alert-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: rgba(152, 107, 107, 0.2);
}

.alert-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border-color: rgba(152, 144, 107, 0.2);
}

.alert-info {
    background: var(--info-bg);
    color: var(--info);
    border-color: rgba(107, 133, 152, 0.2);
}

.alert-secondary {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border-color: var(--border);
}

/* Fade animation */
.fade {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.fade.show {
    opacity: 1;
}

.fade.hide {
    opacity: 0;
}

/* Toast positioning */
.toast-container {
    z-index: 9999;
}

/* Close button */
.btn-close {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.5;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: inherit;
}

.btn-close::before {
    content: "\00D7";
    font-size: 18px;
    line-height: 1;
}

.btn-close:hover {
    opacity: 0.9;
}

.btn-close-sm {
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   10. Spinner
   ========================================================================== */
.spinner-border {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-right-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

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

/* ==========================================================================
   11. Badge System
   ========================================================================== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
    line-height: 1.4;
    letter-spacing: 0.03em;
    vertical-align: middle;
    white-space: nowrap;
}

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

.badge.bg-secondary {
    background: var(--text-muted);
    color: #fff;
}

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

.badge.bg-primary {
    background: var(--accent);
    color: #fff;
}

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

.badge.bg-info {
    background: var(--info);
    color: #fff;
}

/* ==========================================================================
   12. Button System
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-stack);
    line-height: 1.5;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: rgba(44, 51, 69, 0.12);
}

.btn-warning {
    background: var(--warning);
    color: #fff;
    border-color: var(--warning);
}

.btn-warning:hover {
    opacity: 0.9;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-outline-secondary {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}

.btn-outline-secondary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: rgba(44, 51, 69, 0.12);
}

.btn-outline-light {
    background: transparent;
    color: var(--bg-surface);
    border-color: rgba(255, 255, 255, 0.4);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.6);
}

.btn-outline-warning {
    background: transparent;
    color: var(--warning);
    border-color: var(--warning);
}

.btn-outline-warning:hover {
    background: var(--warning-bg);
    color: var(--warning);
}

.btn-outline-info {
    background: transparent;
    color: var(--info);
    border-color: var(--info);
}

.btn-outline-info:hover {
    background: var(--info-bg);
    color: var(--info);
}

.btn-outline-primary {
    background: transparent;
    color: var(--accent);
    border-color: var(--accent);
}

.btn-outline-primary:hover {
    background: var(--accent-glow);
    color: var(--accent);
}

.btn-outline-danger {
    background: transparent;
    color: var(--danger);
    border-color: var(--danger);
}

.btn-outline-danger:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

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

.form-control {
    display: block;
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    font-family: var(--font-stack);
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-control:disabled {
    background: var(--bg-elevated);
    opacity: 0.65;
    cursor: not-allowed;
}

.form-text {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-muted);
}

.form-select {
    display: block;
    width: 100%;
    padding: 10px 36px 10px 14px;
    font-size: 14px;
    font-family: var(--font-stack);
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-input) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%237B8BA0' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 14px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    cursor: pointer;
    appearance: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-group {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.input-group .form-control {
    border-radius: 0;
    flex: 1 1 auto;
}

.input-group .form-control:first-child {
    border-top-left-radius: var(--radius);
    border-bottom-left-radius: var(--radius);
}

.input-group .form-control:last-child {
    border-top-right-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    color: var(--text-secondary);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    white-space: nowrap;
}

.input-group-text:first-child {
    border-top-left-radius: var(--radius);
    border-bottom-left-radius: var(--radius);
    border-right: none;
}

.input-group-text:last-child {
    border-top-right-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
    border-left: none;
}

.form-check {
    display: block;
    min-height: 1.5rem;
    padding-left: 1.5em;
    margin-bottom: 0.5rem;
}

.form-check-input {
    float: left;
    width: 1em;
    height: 1em;
    margin-left: -1.5em;
    margin-top: 0.25em;
    appearance: none;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
}

.form-check-input[type="checkbox"] {
    border-radius: 4px;
}

.form-check-input[type="radio"] {
    border-radius: 50%;
}

.form-check-input:checked {
    background: var(--accent);
    border-color: var(--accent);
}

.form-check-input:checked[type="checkbox"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='white' d='M13.485 3.929a.5.5 0 0 1 .058.638l-.058.07-6.5 6.5a.5.5 0 0 1-.638.058l-.07-.058-3-3a.5.5 0 0 1 .638-.765l.07.058L6.5 10.293l6.146-6.147a.5.5 0 0 1 .638-.058l.07.058z'/%3E%3C/svg%3E");
    background-size: contain;
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px var(--accent-glow);
    border-color: var(--accent);
}

.form-check-label {
    cursor: pointer;
}

/* ==========================================================================
   14. Card System
   ========================================================================== */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.card-body {
    padding: 24px;
}

.card-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    background: rgba(230, 236, 244, 0.3);
}

.card-footer {
    padding: 12px 24px;
    border-top: 1px solid var(--border);
    background: rgba(230, 236, 244, 0.2);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.shadow-sm {
    box-shadow: var(--shadow-card);
}

/* ==========================================================================
   15. Table System
   ========================================================================== */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead th {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
    user-select: none;
    background: rgba(230, 236, 244, 0.5);
}

.table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 14px;
    color: var(--text-primary);
    vertical-align: middle;
}

.table tbody tr {
    transition: background var(--transition);
}

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

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

.table-light {
    background: rgba(230, 236, 244, 0.3);
}

.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.align-middle {
    vertical-align: middle;
}

/* ==========================================================================
   16. Modal System
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(44, 51, 69, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1050;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1055;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal.show {
    display: flex;
}

.modal-dialog {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    transform: translateY(-20px);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.modal.show .modal-dialog {
    transform: translateY(0);
    opacity: 1;
}

.modal-dialog-centered {
    display: flex;
    align-items: center;
    min-height: calc(100% - 48px);
}

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(44, 51, 69, 0.12);
    width: 100%;
}

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

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

.modal-header .btn-close {
    position: relative;
    top: auto;
    right: auto;
    transform: none;
    flex-shrink: 0;
    margin-left: 12px;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

/* ==========================================================================
   30. Upload Drop Zone & Result Modal
   ========================================================================== */

.upload-drop-zone {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
    background: rgba(255, 255, 255, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.upload-drop-zone:hover {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.upload-drop-zone.drag-over {
    border-color: var(--accent);
    background: var(--accent-glow-strong);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.upload-drop-zone.uploading {
    pointer-events: none;
    opacity: 0.7;
}

.upload-drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.upload-drop-zone-icon {
    font-size: 48px;
    color: var(--accent);
    margin-bottom: 8px;
}

.upload-drop-zone-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
}

.upload-drop-zone-subtext {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

.upload-drop-zone-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 12px;
}

.upload-result-summary {
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
}

.upload-result-summary.result-success {
    color: var(--success);
}

.upload-result-summary.result-error {
    color: var(--danger);
}

.upload-result-json-wrapper {
    margin-top: 8px;
}

.upload-result-json-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}

.upload-result-json {
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.5;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 16px;
    margin: 0;
    overflow-x: auto;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
    color: var(--text-primary);
}

/* Upload options panel */
.upload-options {
    padding: 12px 16px;
    border-top: 1px solid var(--border-subtle);
}

.upload-options-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 0;
    transition: color var(--transition);
}

.upload-options-toggle:hover {
    color: var(--accent);
}

.upload-options-toggle i {
    font-size: 16px;
    transition: transform var(--transition);
}

.upload-options-panel {
    display: none;
    margin-top: 12px;
    padding-top: 8px;
}

.upload-options-panel.open {
    display: block;
}

.upload-options-field {
    margin-bottom: 12px;
}

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

.upload-options-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
}

.upload-options-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
}

.upload-options-field input[type="number"] {
    width: 100%;
    padding: 6px 10px;
    margin-top: 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 13px;
    transition: border-color var(--transition), opacity var(--transition);
}

.upload-options-field input[type="number"]:focus {
    outline: none;
    border-color: var(--border-focus);
}

.upload-options-field input[type="number"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--bg-elevated);
}

.upload-options-hint {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 11px;
}

@media (max-width: 768px) {
    .upload-drop-zone {
        padding: 24px 16px;
    }

    .upload-drop-zone-icon {
        font-size: 36px;
    }
}

/* ===== File Action Buttons ===== */

.action-buttons {
    white-space: nowrap;
    text-align: center;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
    vertical-align: middle;
    margin: 0 2px;
}

.btn-action:hover {
    background: #f1f5f9;
    border-color: #e2e8f0;
}

.btn-action:active {
    transform: scale(0.95);
}

.btn-extend:hover {
    color: #2563eb;
    background: #eff6ff;
    border-color: #bfdbfe;
}

.btn-delete:hover {
    color: #dc2626;
    background: #fef2f2;
    border-color: #fecaca;
}

.btn-action i {
    font-size: 16px;
    line-height: 1;
}

/* ==========================================================================
   Site Footer
   ========================================================================== */

.site-footer {
    border-top: 1px solid var(--border);
    background: var(--bg-surface);
    padding: 16px 32px;
    margin-top: auto;
}

.site-footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    font-size: 13px;
    color: var(--text-muted);
}

.site-footer-inner span {
    display: inline-block;
}

@media (max-width: 768px) {
    .site-footer {
        padding: 12px 16px;
    }

    .site-footer-inner {
        flex-direction: column;
        text-align: center;
        gap: 4px;
    }

    .site-footer-inner .theme-toggle {
        align-self: center;
    }
}

