/* SURVEY RECORD MANAGEMENT SYSTEM - STYLES */

/* CSS Variables */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1e293b;
    --gray: #64748b;
    --light-gray: #f5f7fb;
    --panel-border: #e5eaf3;
    --soft-panel: #fbfcff;
    --white: #ffffff;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 20px 45px rgba(15, 23, 42, 0.12);
    --radius: 14px;
    --radius-sm: 12px;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: radial-gradient(circle at top left, #eef2ff 0, #f8fafc 34%, #f5f7fb 100%);
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.tab-content {
    display: none;
}

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

/* LOGIN PAGE */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-image: url('../images/background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #667eea;
    position: relative;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.login-box {
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 50px;
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
    animation: slideUp 0.5s ease;
}

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

.company-logo {
    width: 250px;
    height: auto;
    display: block;
    margin: 0 auto 20px auto;
    object-fit: contain;
}

.tagline {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-bottom: 30px;
    font-weight: 500;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    transition: all 0.3s;
    font-family: inherit;
    background: var(--soft-panel);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

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

.form-group select {
    cursor: pointer;
    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='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #6557ff 0%, #7c3aed 100%);
    color: white;
    width: 100%;
    padding: 14px;
    font-size: 16px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: white;
    color: var(--dark);
    border: 1px solid var(--panel-border);
}

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

.auth-switch {
    width: 100%;
    margin-top: 12px;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s;
}

.btn-icon:hover {
    background: var(--light-gray);
    transform: scale(1.1);
}

.btn-icon-danger {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fee2e2;
    color: var(--danger);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* DASHBOARD LAYOUT */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--dark);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 30px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.sidebar-logo {
    width: 180px;
    height: auto;
    display: block;
    margin: 0 auto;
    object-fit: contain;
}

.sidebar-nav {
    flex: 1;
    padding: 20px;
}

.nav-item {
    width: 100%;
    padding: 16px 20px;
    margin-bottom: 8px;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.7);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    transition: all 0.3s;
    text-align: left;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255,255,255,0.1);
    color: white;
}

.nav-icon {
    font-size: 20px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-role {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
}

.btn-logout {
    width: 100%;
    padding: 10px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: var(--danger);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 34px;
    max-width: calc(100% - 280px);
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid var(--panel-border);
    border-radius: 18px;
    padding: 18px 22px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.content-header h1 {
    font-size: 28px;
    font-weight: 700;
}

.header-actions {
    display: flex;
    gap: 12px;
}

/* CARDS */
.card {
    background: white;
    border: 1px solid var(--panel-border);
    border-radius: 18px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 26px;
    border-bottom: 1px solid var(--panel-border);
    background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}

.card-header h3 {
    font-size: 18px;
    margin-bottom: 4px;
}

.card-header p {
    color: var(--gray);
    font-size: 14px;
}

/* Form Grid */
.survey-form {
    padding: 26px;
}

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

.span-2 {
    grid-column: span 2;
}
 /* IMPROVED ADD DOCUMENTS STYLING */

.file-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}

.file-section > label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
    margin-top: 18px;
}

.file-section > label:first-child {
    margin-top: 0;
}

.file-section input[type="file"] {
    width: 100%;
    padding: 14px;
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-sm);
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.file-section input[type="file"]:hover {
    border-color: var(--primary);
    background: #eef2ff;
}

.file-section input[type="text"] {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-sm);
    background: white;
    font-size: 14px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.file-section input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.file-section input[type="file"]::file-selector-button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 16px;
    margin-right: 14px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
}

.file-section input[type="file"]::file-selector-button:hover {
    background: var(--primary-dark);
}
/* RECORD COPY CHECKBOX */

.record-copy-check {
    margin-top: 10px;
    margin-bottom: 18px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}
/* File Upload */
.file-section {
    margin-bottom: 24px;
}

.file-section > label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 14px;
}

.file-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #f8fafc;
}

.file-dropzone:hover {
    border-color: var(--primary);
    background: #eef2ff;
}

.dropzone-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.dropzone-content p {
    color: var(--dark);
    margin-bottom: 8px;
}

.text-link {
    color: var(--primary);
    font-weight: 600;
}

.multi-file-preview {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-sm);
}

.file-viewer iframe {
    width: 100%;
    height: 500px;
    border: none;
    border-radius: var(--radius-sm);
    background: white;
}

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

.file-icon {
    font-size: 24px;
}

.file-details {
    display: flex;
    flex-direction: column;
}

.file-name {
    font-weight: 600;
    color: var(--dark);
}

.file-size {
    font-size: 12px;
    color: var(--gray);
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.file-actions .btn {
    width: auto;
}

/* TOOLBAR & SEARCH */
.toolbar {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    background: white;
    border: 1px solid var(--panel-border);
    border-radius: 18px;
    padding: 16px;
    box-shadow: var(--shadow);
}

.search-box {
    flex: 1;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
}

.search-box input {
    width: 100%;
    padding: 13px 16px 13px 48px;
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-sm);
    font-size: 15px;
}

.filter-group select {
    padding: 13px 16px;
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-sm);
    background: white;
    min-width: 150px;
}

/* SURVEY GRID & CARDS */
.survey-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.survey-card {
    background: white;
    border-radius: 18px;
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--panel-border);
    border-left: 5px solid var(--primary);
    transition: all 0.3s ease;
    cursor: pointer;
}

.survey-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.survey-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.survey-number {
    color: var(--gray);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 12px;
}

/* Job Type Badge */
.job-type-badge {
    display: inline-block;
    background: #e0e7ff;
    color: #4338ca;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}

.survey-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

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

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-secondary {
    background: #f1f5f9;
    color: var(--gray);
}

.card-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}
.empty-state {
    min-height: 300px;
}
/* EMPTY STATE */

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--dark);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--gray);
    margin-bottom: 24px;
}

/* STATS & ANALYTICS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 24px;
    border: 1px solid var(--panel-border);
    border-radius: 18px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    font-size: 32px;
    width: 60px;
    height: 60px;
    background: #eef2ff;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark);
}

.stat-label {
    font-size: 14px;
    color: var(--gray);
}

/* Activity List */
.activity-list {
    padding: 0 24px 24px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid #e2e8f0;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    background: #eef2ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.activity-time {
    font-size: 13px;
    color: var(--gray);
}

/* MODAL */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    padding: 20px;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: var(--radius);
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-lg {
    max-width: 900px;
}

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

.modal-header h2 {
    font-size: 20px;
}

.btn-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--gray);
}

.btn-close:hover {
    background: #a5c8f7;
}
 
.modal-body {
    padding: 24px;
    overflow-x: hidden;
    overflow-y: auto;
    max-height: calc(90vh - 140px);
    scroll-behavior: smooth;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

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

.detail-item {
    background: var(--soft-panel);
    border: 1px solid var(--panel-border);
    padding: 16px;
    border-radius: var(--radius-sm);
}

.detail-item label {
    font-size: 12px;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    display: block;
}

.detail-item p {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
}

.detail-section {
    margin-bottom: 24px;
}

.detail-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 14px;
}

.description-box {
    background: #f8fafc;
    padding: 16px;
    border-radius: var(--radius-sm);
    color: var(--gray);
    line-height: 1.6;
}

.map-container {
    height: 350px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    border: 2px solid #e2e8f0;
}

.all-work-map {
    height: 520px;
    margin: 0 24px 18px;
    border: 1px solid var(--panel-border);
    border-radius: 18px;
}

.all-map-toolbar {
    display: flex;
    gap: 12px;
    padding: 18px 24px;
}

.all-map-toolbar select {
    padding: 12px 16px;
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-sm);
    background: var(--soft-panel);
    min-width: 180px;
}

.map-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.file-viewer {
    background: #f8fafc;
    border-radius: var(--radius-sm);
    padding: 24px;
    text-align: center;
}

.file-viewer img {
    max-width: 100%;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.text-muted {
    color: var(--gray);
}

/* TOAST NOTIFICATIONS */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: white;
    padding: 16px 24px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: slideIn 0.3s ease;
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.warning {
    border-left-color: var(--warning);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* NEW: FILE GROUP STYLING */
.file-section input[type="file"],
.file-section input[type="text"] {
    margin-bottom: 12px;
}

.file-section label {
    margin-top: 12px;
    font-weight: 600;
    color: var(--dark);
    display: block;
}

/* NEW: FILE STATUS COLORS */
.file-status-blue {
    border-left: 5px solid #3b82f6 !important;
}

.file-status-yellow {
    border-left: 5px solid #f59e0b !important;
}

.file-status-green {
    border-left: 5px solid #10b981 !important;
}

/* NEW: FILE VIEW BLOCKS */
.file-view-block {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 12px;
    text-align: left;
    transition: 0.3s;
}

.file-view-block:hover {
    box-shadow: var(--shadow);
}

.file-view-title {
    font-weight: 600;
    margin-bottom: 8px;
}

.file-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.file-actions button {
    padding: 6px 12px;
    font-size: 13px;
}

/* DOCUMENT UPLOAD UI */
.document-section {
    background: white;
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow);
}

.document-section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.document-section-header h3 {
    font-size: 20px;
    margin-bottom: 4px;
}

.document-section-header p,
.document-copy p {
    color: var(--gray);
}

.document-header-icon,
.document-icon {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    flex: 0 0 auto;
}

.document-header-icon {
    color: #6d5dfc;
    background: #f1edff;
}

.document-row {
    display: grid;
    grid-template-columns: 72px 1fr auto;
    align-items: center;
    gap: 16px;
    min-height: 116px;
    padding: 22px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    margin-bottom: 16px;
}

.document-row:first-of-type {
    border: 2px dashed #b8a6ff;
}

.document-copy h4 {
    font-size: 18px;
    margin-bottom: 8px;
}

.document-actions,
.document-other-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.document-actions {
    flex-direction: column;
    align-items: center;
}

.document-section input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.document-upload-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    padding: 12px 20px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: white;
    color: var(--primary);
    font-weight: 700;
    cursor: pointer;
}

.document-blue .document-upload-btn { color: #2684ff; }
.document-green .document-upload-btn { color: #2fad5a; }
.document-orange .document-upload-btn { color: #ff8900; }

.document-purple .document-icon { background: #f1edff; color: #6d5dfc; }
.document-blue .document-icon { background: #e9f4ff; color: #2684ff; }
.document-green .document-icon { background: #e9faed; color: #2fad5a; }
.document-orange .document-icon { background: #fff2dc; color: #ff8900; }

.document-file-name {
    color: var(--gray);
    font-size: 14px;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.document-file-name.pill {
    padding: 10px 18px;
    border-radius: 999px;
    background: #edf1f7;
    font-weight: 700;
}

.document-other-controls input[type="text"] {
    min-width: 260px;
    margin-bottom: 0;
}

.compact-check {
    margin-top: 10px;
}

.admin-list {
    padding: 0 24px 24px;
}

.admin-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #e2e8f0;
}

.admin-row.compact {
    padding: 12px 0;
}

.admin-surveyor-group {
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
    background: var(--soft-panel);
}

.admin-group-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--panel-border);
    margin-bottom: 4px;
}

.admin-row:last-child {
    border-bottom: none;
}

.admin-row-title {
    font-weight: 700;
}

.admin-row-meta {
    color: var(--gray);
    font-size: 13px;
    margin-top: 4px;
}

.status-pill {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f1f5f9;
    color: var(--gray);
    font-size: 12px;
    font-weight: 700;
    text-transform: capitalize;
}

.status-pill.pending {
    background: #fef3c7;
    color: #92400e;
}

.status-pill.approved {
    background: #dcfce7;
    color: #166534;
}

.status-pill.rejected {
    background: #fee2e2;
    color: #991b1b;
}

/* MOBILE MENU BUTTON */
.mobile-menu-btn {
    display: none;
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
}

/* MOBILE SIDEBAR OVERLAY */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 900;
    display: none;
}

.sidebar-overlay.active {
    display: block;
}

/* Pagination */
.pagination-controls {
    padding: 20px 0;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.page-info {
    font-size: 14px;
    color: var(--text-muted);
    padding: 0 8px;
}

/* Danger button */
.btn-danger {
    background: #ef4444;
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #dc2626;
}

/* Badge warning */
.badge-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

/* Sidebar overlay - shown on mobile when sidebar is open */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

/* Hamburger button - hidden on desktop, shown on mobile */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--dark);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    line-height: 1;
}

.mobile-menu-btn:hover {
    background: var(--light-gray);
}

/* Tablet: collapse sidebar to icon-only */
@media (max-width: 1024px) and (min-width: 769px) {
    .sidebar {
        width: 80px;
    }

    .sidebar-logo {
        width: 60px;
    }

    .user-info,
    .nav-item span:not(.nav-icon) {
        display: none;
    }

    .main-content {
        margin-left: 80px;
        max-width: calc(100% - 80px);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile: full-width layout with slide-in sidebar */
@media (max-width: 768px) {
    /* Show hamburger button */
    .mobile-menu-btn {
        display: block;
    }

    /* Sidebar slides in from the left */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 260px;
        z-index: 1001;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    /* Show nav labels when sidebar is open */
    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar.active .user-info,
    .sidebar.active .nav-item span:not(.nav-icon) {
        display: block;
    }

    /* Main content takes full width */
    .main-content {
        margin-left: 0;
        max-width: 100%;
        width: 100%;
        padding: 16px;
    }

    /* Login page */
    .login-container {
        padding: 10px;
    }

    .login-box {
        padding: 30px;
    }

    .company-logo {
        width: 180px;
    }

    /* Forms */
    .form-grid {
        grid-template-columns: 1fr;
    }

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

    /* Grids */
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    /* Fix survey grid min size for mobile */
    .survey-grid {
        grid-template-columns: 1fr;
    }

    .survey-meta {
        grid-template-columns: 1fr;
    }

    /* Document rows: stack vertically on mobile */
    .document-row {
        grid-template-columns: 48px 1fr;
        grid-template-rows: auto auto;
        gap: 10px;
        padding: 16px;
    }

    .document-actions,
    .document-other-controls {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: flex-start;
    }

    .document-upload-btn {
        min-width: unset;
        width: auto;
    }

    /* Toolbar */
    .toolbar {
        flex-direction: column;
    }

    /* Content header */
    .content-header {
        gap: 10px;
        flex-wrap: wrap;
    }

    /* Cards */
    .survey-form {
        padding: 16px;
    }

    .card-header {
        padding: 20px;
    }

    /* Modal */
    .modal-content {
        max-width: 100%;
        margin: 10px;
    }
}
