/* Add Application Layout & Form Styles */
.add-application-container {
    max-width: 960px;
    margin: 0 auto;
    padding-bottom: 40px;
    animation: fadeInUp 0.4s ease forwards;
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

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

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

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

@media (max-width: 640px) {
    .form-grid-2, .form-grid-3 {
        grid-template-columns: 1fr;
    }
}

.col-span-2 {
    grid-column: span 2;
}

.col-span-3 {
    grid-column: span 3;
}

@media (max-width: 640px) {
    .col-span-2, .col-span-3 {
        grid-column: span 1;
    }
}

/* Toggle Switch */
.toggle-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: var(--border);
    transition: .3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: var(--text-muted);
    transition: .3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--accent);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
    background-color: #0a0a12;
}

.toggle-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
}

/* Price Box */
.price-calculator-box {
    background: rgba(201, 162, 39, 0.05);
    border: 1px dashed rgba(201, 162, 39, 0.25);
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.price-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

.price-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent);
}

/* Upload Section */
.upload-sections {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.upload-field-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 20px;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 20px;
}

.upload-field-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

@media (max-width: 768px) {
    .upload-field-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

.upload-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.upload-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}

.upload-desc {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.01);
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--accent);
    background: rgba(201, 162, 39, 0.02);
}

.drop-zone svg {
    width: 28px;
    height: 28px;
    color: var(--text-dim);
}

.drop-zone span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Upload Preview */
.upload-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    grid-column: 2;
}

@media (max-width: 768px) {
    .upload-preview-container {
        grid-column: 1;
    }
}

.upload-item {
    background: var(--bg-card-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.upload-item-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.upload-item-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}

.upload-progress-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.upload-progress-fill {
    height: 100%;
    background: var(--accent);
    transition: width 0.1s ease;
}

.upload-success-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    width: 100%;
    max-width: 320px;
    position: relative;
}

.upload-thumb {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.upload-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-thumb svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.upload-thumb-name {
    font-size: 0.78rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    padding-right: 24px;
}

.upload-remove-btn {
    position: absolute;
    right: 12px;
    color: var(--text-dim);
    cursor: pointer;
    transition: color var(--transition);
}

.upload-remove-btn:hover {
    color: var(--error);
}

.upload-remove-btn svg {
    width: 16px;
    height: 16px;
}

/* Submit Actions */
.form-submit-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

/* Errors */
.input-error {
    border-color: var(--error) !important;
}

.error-msg {
    font-size: 0.75rem;
    color: var(--error);
    margin-top: 4px;
    display: block;
}

/* =============================================
   Applications Screen Layout & Filter Styles
   ============================================= */

.applications-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: fadeInUp 0.4s ease forwards;
}

.applications-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.applications-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.applications-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.applications-count-badge {
    background: rgba(201, 162, 39, 0.15);
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 12px;
    border: 1px solid rgba(201, 162, 39, 0.3);
}

.applications-actions-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    justify-content: flex-end;
    min-width: 280px;
}

.applications-actions-row .search-bar {
    max-width: 320px;
}

/* Bulk Actions Bar */
.bulk-actions-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 20px;
    background: rgba(201, 162, 39, 0.08);
    border: 1px solid rgba(201, 162, 39, 0.2);
    border-radius: var(--radius);
    margin-bottom: 4px;
    transition: all 0.3s ease;
}

.bulk-actions-bar.visible {
    display: flex;
    animation: fadeInDown 0.3s ease forwards;
}

.bulk-count {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}

.bulk-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Status Filter Pills */
.filter-pills-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    border: none;
    background: none;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.filter-pill:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}

.filter-pill.active {
    background: var(--accent);
    color: #0a0a12;
    font-weight: 600;
}

.pill-count {
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.15);
    padding: 1px 6px;
    border-radius: 8px;
}

.filter-pill.active .pill-count {
    background: rgba(0, 0, 0, 0.2);
}

/* Additional Filters Row */
.additional-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 4px;
}

.filter-select, .filter-date {
    height: 38px;
    font-size: 0.8rem;
}

/* Location Badge inside Table */
.location-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.location-badge.inside {
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
}

.location-badge.outside {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
}

/* Highlighted Row Effect */
.app-row.highlighted {
    background: rgba(201, 162, 39, 0.15) !important;
    outline: 1px solid var(--accent);
    transition: background 0.3s ease;
}

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

/* =============================================
   Drawer Application Detail Styles
   ============================================= */

.drawer-app-detail {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.drawer-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
}

.drawer-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    margin-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding-bottom: 6px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px 20px;
}

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

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.detail-label svg, .detail-label i {
    width: 13px;
    height: 13px;
}

.detail-value {
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--text);
}

.detail-value.monospace {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.8rem;
    color: var(--accent);
}

/* Drawer Status Timeline */
.status-timeline {
    display: flex;
    flex-direction: column;
    position: relative;
    padding-left: 20px;
    margin-left: 10px;
    border-left: 2px solid var(--border);
    gap: 20px;
}

.timeline-step {
    position: relative;
    display: flex;
    align-items: flex-start;
}

.timeline-dot {
    position: absolute;
    left: -27px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border);
    transition: all 0.3s ease;
}

.timeline-step.completed .timeline-dot {
    background: var(--success);
    border-color: var(--success);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

.timeline-step.current .timeline-dot {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 8px rgba(201, 162, 39, 0.4);
}

.timeline-step.rejected .timeline-dot {
    background: var(--error);
    border-color: var(--error);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.timeline-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.timeline-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
}

.timeline-step.completed .timeline-label {
    color: var(--success);
}

.timeline-step.current .timeline-label {
    color: var(--accent);
}

.timeline-step.rejected .timeline-label {
    color: var(--error);
}

.timeline-time {
    font-size: 0.72rem;
    color: var(--text-dim);
}

/* Documents Grid in Drawer */
.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.doc-thumb {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all var(--transition);
}

.doc-thumb:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.doc-thumb-preview {
    height: 90px;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
}

.doc-thumb-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.doc-thumb-preview svg {
    width: 24px;
    height: 24px;
    color: var(--text-dim);
}

.doc-thumb-label {
    font-size: 0.74rem;
    font-weight: 500;
    color: var(--text-muted);
    padding: 6px 8px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Drawer Action Footer */
.drawer-actions-section {
    background: transparent;
    border: none;
    padding: 0;
    margin-top: 10px;
}

.drawer-action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.drawer-action-buttons .btn {
    flex: 1;
    min-width: 120px;
}

/* Status Update Modal Styles */
.status-flow-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.status-flow-step {
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: all var(--transition);
}

.status-flow-step.completed {
    border-color: rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.status-flow-step.current {
    border-color: var(--accent);
    color: var(--accent);
}

.status-flow-step.upcoming {
    color: var(--text-dim);
}

.status-flow-step.selected,
.status-flow-step:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #0a0a12;
}

.status-flow-arrow {
    display: flex;
    align-items: center;
    color: var(--text-dim);
}

.status-flow-arrow svg {
    width: 14px;
    height: 14px;
}
