/* ===== Complaint Form Report System - Global Styles ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ===== Dark Theme (Default) ===== */
:root,
[data-theme="dark"] {
    --primary: #1e3a5f;
    --primary-light: #2a5298;
    --primary-dark: #0f1f3a;
    --accent: #00b4d8;
    --accent-light: #48cae4;
    --accent-glow: rgba(0, 180, 216, 0.3);
    --success: #06d6a0;
    --warning: #ffd166;
    --danger: #ef476f;
    --bg-dark: #0a0f1c;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --bg-glass: rgba(30, 58, 95, 0.4);
    --bg-input: rgba(255, 255, 255, 0.07);
    --border: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(0, 180, 216, 0.5);
    --text-primary: #e8edf5;
    --text-secondary: #8b95a8;
    --text-muted: #5a6477;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.4);
    --bg-secondary: rgba(255, 255, 255, 0.05);
    --bg-hover: rgba(255, 255, 255, 0.08);
    --border-color: rgba(255, 255, 255, 0.08);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Light Theme ===== */
[data-theme="light"] {
    --primary: #1a56db;
    --primary-light: #3b82f6;
    --primary-dark: #1e40af;
    --accent: #0284c7;
    --accent-light: #0ea5e9;
    --accent-glow: rgba(2, 132, 199, 0.15);
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --bg-dark: #f0f4f8;
    --bg-card: rgba(255, 255, 255, 0.8);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --bg-glass: rgba(255, 255, 255, 0.85);
    --bg-input: rgba(0, 0, 0, 0.04);
    --border: rgba(0, 0, 0, 0.1);
    --border-focus: rgba(2, 132, 199, 0.5);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --bg-secondary: rgba(0, 0, 0, 0.03);
    --bg-hover: rgba(0, 0, 0, 0.05);
    --border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] body::before {
    background:
        radial-gradient(ellipse at 20% 20%, rgba(59, 130, 246, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 80%, rgba(2, 132, 199, 0.04) 0%, transparent 60%),
        radial-gradient(ellipse at 50% 50%, rgba(240, 244, 248, 0.3) 0%, transparent 80%);
}

[data-theme="light"] .form-title-bar {
    background: linear-gradient(135deg, #1a56db, #3b82f6);
}

[data-theme="light"] .navbar {
    background: rgba(255, 255, 255, 0.9);
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .navbar-brand {
    color: var(--text-primary);
}

[data-theme="light"] thead th {
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .stat-card .stat-value {
    color: var(--primary);
}

[data-theme="light"] .section-header {
    color: var(--primary);
    border-bottom-color: rgba(26, 86, 219, 0.3);
}

[data-theme="light"] .section-divider {
    border-color: rgba(26, 86, 219, 0.15);
    background: rgba(26, 86, 219, 0.03);
}

[data-theme="light"] .section-divider h3 {
    color: var(--primary);
}

[data-theme="light"] .radio-option input[type="radio"]:checked + .radio-mark {
    border-color: var(--primary);
}

[data-theme="light"] .radio-option .radio-mark::after {
    background: var(--primary);
}

[data-theme="light"] .tag {
    background: rgba(26, 86, 219, 0.1);
    color: var(--primary);
    border-color: rgba(26, 86, 219, 0.2);
}

[data-theme="light"] .tag-picker-dropdown {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .tag-picker-item:hover {
    background: rgba(26, 86, 219, 0.06);
}

[data-theme="light"] .form-control[readonly] {
    background: rgba(0, 0, 0, 0.03);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(42, 82, 152, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 80%, rgba(0, 180, 216, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 50% 50%, rgba(15, 31, 58, 0.5) 0%, transparent 80%);
    pointer-events: none;
    z-index: 0;
}

/* ===== Theme Toggle ===== */
.theme-toggle {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition);
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: var(--bg-card-hover);
    transform: rotate(20deg);
    border-color: var(--accent);
}

/* ===== Auth Pages ===== */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.auth-card {
    position: relative;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 3rem;
    width: 100%;
    max-width: 460px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.6s ease-out;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo .logo-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--accent), var(--primary-light));
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 1rem;
    box-shadow: 0 8px 24px var(--accent-glow);
}

.auth-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-logo p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
}

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

[data-theme="light"] .form-control:focus {
    background: #fff;
}

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

.form-control[readonly] {
    opacity: 0.7;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.03);
}

.form-control-sm {
    padding: 0.4rem 0.7rem;
    font-size: 0.85rem;
    width: auto;
    min-width: 120px;
}

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

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238b95a8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    letter-spacing: 0.02em;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--primary-light));
    color: white;
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--accent-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

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

.btn-success {
    background: linear-gradient(135deg, var(--success), #05b88a);
    color: white;
    box-shadow: 0 4px 16px rgba(6, 214, 160, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(6, 214, 160, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #d63861);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.05rem;
}

/* ===== Alert Messages ===== */
.alert {
    padding: 0.85rem 1.2rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    font-weight: 500;
    animation: fadeIn 0.4s ease-out;
}

.alert-error {
    background: rgba(239, 71, 111, 0.15);
    border: 1px solid rgba(239, 71, 111, 0.3);
    color: #ff6b8a;
}

.alert-success {
    background: rgba(6, 214, 160, 0.15);
    border: 1px solid rgba(6, 214, 160, 0.3);
    color: #2ee8b0;
}

[data-theme="light"] .alert-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

[data-theme="light"] .alert-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #059669;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.auth-footer a:hover {
    color: var(--accent-light);
    text-decoration: underline;
}

/* ===== Navigation ===== */
.navbar {
    background: rgba(10, 15, 28, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.1rem;
}

.navbar-brand .brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent), var(--primary-light));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.navbar-user .user-avatar {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: white;
}

.navbar-user span {
    font-weight: 500;
}

.user-role-badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(0, 180, 216, 0.15);
    color: var(--accent-light);
    border: 1px solid rgba(0, 180, 216, 0.25);
}

[data-theme="light"] .user-role-badge {
    background: rgba(2, 132, 199, 0.1);
    color: var(--accent);
    border-color: rgba(2, 132, 199, 0.2);
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-input);
}

/* ===== Dashboard ===== */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: var(--shadow);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-weight: 500;
}

/* ===== Table ===== */
.table-container {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    animation: fadeIn 0.5s ease-out;
}

.table-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.table-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

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

thead th {
    padding: 1rem 1.25rem;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

tbody td {
    padding: 1rem 1.25rem;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

[data-theme="light"] tbody td {
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

tbody tr {
    transition: var(--transition);
}

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

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

.badge {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.badge-quality {
    background: rgba(0, 180, 216, 0.15);
    color: var(--accent-light);
}

.badge-equipment {
    background: rgba(255, 209, 102, 0.15);
    color: var(--warning);
}

.badge-supplies {
    background: rgba(6, 214, 160, 0.15);
    color: var(--success);
}

.table-empty {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.table-empty p {
    font-size: 1rem;
    margin-top: 0.5rem;
}

/* ===== Complaint Form ===== */
.form-container {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    padding: 2rem;
}

.form-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.6s ease-out;
}

.form-title-bar {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.form-title-bar h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: white;
}

.form-title-bar .form-meta {
    text-align: right;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
}

.form-title-bar .form-meta strong {
    color: white;
}

/* Editable meta inputs in title bar */
.form-meta-inputs {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-meta-inputs .meta-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-meta-inputs .meta-field label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    white-space: nowrap;
    margin-bottom: 0;
}

.form-meta-inputs .form-control-sm {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    border-radius: 6px;
}

.form-meta-inputs .form-control-sm::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-meta-inputs .form-control-sm:focus {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: none;
}

.form-body {
    padding: 2rem;
}

.section-header {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(0, 180, 216, 0.3);
    margin-bottom: 1.25rem;
    margin-top: 2rem;
}

.section-header:first-child {
    margin-top: 0;
}

.section-divider {
    text-align: center;
    padding: 1.5rem 0;
    margin: 1.5rem 0;
    border-top: 2px solid rgba(0, 180, 216, 0.2);
    border-bottom: 2px solid rgba(0, 180, 216, 0.2);
    background: rgba(0, 180, 216, 0.05);
    border-radius: var(--radius-sm);
}

.section-divider h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.section-divider p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

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

/* Radio Groups */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.radio-option {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.radio-option .radio-mark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-muted);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.radio-option .radio-mark::after {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    transform: scale(0);
    transition: var(--transition);
}

.radio-option input[type="radio"]:checked + .radio-mark {
    border-color: var(--accent);
}

.radio-option input[type="radio"]:checked + .radio-mark::after {
    transform: scale(1);
}

.radio-option .radio-label {
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: var(--transition);
}

.radio-option:hover .radio-mark {
    border-color: var(--accent-light);
}

.radio-option:hover .radio-label {
    color: var(--accent-light);
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* ===== View Complaint ===== */
.view-field {
    margin-bottom: 1rem;
}

.view-field .field-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.25rem;
}

.view-field .field-value {
    font-size: 0.95rem;
    color: var(--text-primary);
    padding: 0.6rem 0.9rem;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    min-height: 38px;
}

/* Export Bar */
.export-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
    gap: 0.75rem;
}

/* ===== Tag Picker (Email Recipients) ===== */
.tag-picker {
    position: relative;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    min-height: 46px;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    cursor: text;
    transition: var(--transition);
}

.tag-picker:focus-within {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.tag-picker-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.6rem;
    background: rgba(0, 180, 216, 0.15);
    color: var(--accent-light);
    border: 1px solid rgba(0, 180, 216, 0.25);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    animation: fadeIn 0.2s ease-out;
}

.tag-remove {
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    opacity: 0.7;
    transition: var(--transition);
}

.tag-remove:hover {
    opacity: 1;
    color: var(--danger);
}

.tag-picker-input {
    flex: 1;
    min-width: 150px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    outline: none;
    padding: 0.25rem 0.5rem;
}

.tag-picker-input::placeholder {
    color: var(--text-muted);
}

.tag-picker-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 50;
    display: none;
    box-shadow: var(--shadow);
}

.tag-picker-dropdown.show {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

.tag-picker-item {
    padding: 0.65rem 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    border-bottom: 1px solid var(--border);
}

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

.tag-picker-item:hover {
    background: var(--bg-card-hover);
}

.tag-picker-item strong {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.tag-picker-item span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.tag-picker-item.no-results {
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: default;
    text-align: center;
}

.tag-picker-item.no-results a {
    color: var(--accent);
}

/* ===== Contacts Page ===== */
.contacts-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 1.5rem;
    align-items: start;
}

.contact-form-card {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    position: sticky;
    top: 80px;
}

.contact-form-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .auth-card {
        padding: 2rem 1.5rem;
    }

    .form-row, .form-row-3 {
        grid-template-columns: 1fr;
    }

    .navbar {
        padding: 0 1rem;
    }

    .navbar-right {
        gap: 0.5rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

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

    .form-title-bar {
        flex-direction: column;
        gap: 0.75rem;
    }

    .form-title-bar .form-meta {
        text-align: left;
    }

    .form-actions {
        flex-direction: column;
    }

    .table-container {
        overflow-x: auto;
    }

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

    .contact-form-card {
        position: static;
    }
}

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

    .main-content {
        padding: 1rem;
    }

    .form-body {
        padding: 1.25rem;
    }
}

/* ===== Print Styles for PDF Export ===== */
@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    body {
        background: white !important;
        color: #1e293b !important;
        font-size: 11pt;
    }

    body::before {
        display: none !important;
    }

    .no-print {
        display: none !important;
    }

    .export-bar {
        display: none !important;
    }

    .form-container {
        padding: 0;
        max-width: 100%;
    }

    .form-card {
        border: 2px solid #1e3a5f;
        border-radius: 0;
        box-shadow: none;
        backdrop-filter: none;
        background: white;
        animation: none;
    }

    .form-title-bar {
        background: #1e3a5f !important;
        color: white !important;
        padding: 12px 16px;
        -webkit-print-color-adjust: exact;
    }

    .form-title-bar h2 {
        font-size: 16pt;
    }

    .form-body {
        padding: 16px;
    }

    .section-header {
        color: #1e3a5f !important;
        border-bottom-color: #1e3a5f !important;
        font-size: 10pt;
        margin-top: 14px;
        margin-bottom: 8px;
        padding-bottom: 3px;
    }

    .section-divider {
        border-color: #1e3a5f !important;
        background: #f0f4f8 !important;
        padding: 8px 0;
        margin: 12px 0;
    }

    .section-divider h3 {
        color: #1e3a5f !important;
        font-size: 11pt;
    }

    .form-row {
        gap: 8px;
    }

    .view-field {
        margin-bottom: 6px;
    }

    .view-field .field-label {
        font-size: 7pt;
        color: #64748b;
    }

    .view-field .field-value {
        font-size: 10pt;
        padding: 4px 6px;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        color: #1e293b;
        min-height: auto;
    }

    .form-actions {
        display: none !important;
    }

    @page {
        margin: 0.6in;
        size: A4;
    }
}

/* ===== File Upload Zone ===== */
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.upload-zone {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-input);
    overflow: hidden;
}

.upload-zone:hover {
    border-color: var(--accent);
    background: rgba(0, 180, 216, 0.04);
}

.upload-zone.dragover {
    border-color: var(--accent);
    background: rgba(0, 180, 216, 0.08);
    transform: scale(1.01);
    box-shadow: 0 0 20px rgba(0, 180, 216, 0.15);
}

.upload-zone-sm {
    padding: 1.25rem 1rem;
}

.upload-zone-content {
    pointer-events: none;
}

.upload-zone-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.7;
}

.upload-zone-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

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

.upload-file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: -1;
}

/* Selected File Info */
.selected-file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding: 0.65rem 1rem;
    background: rgba(0, 180, 216, 0.08);
    border: 1px solid rgba(0, 180, 216, 0.2);
    border-radius: var(--radius-sm);
    animation: fadeSlideIn 0.25s ease;
}

.selected-file-name {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-all;
}

.selected-file-remove {
    background: none;
    border: none;
    color: var(--danger);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    transition: var(--transition);
    flex-shrink: 0;
}

.selected-file-remove:hover {
    background: rgba(239, 71, 111, 0.12);
}

/* Selected file actions group */
.selected-file-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* No-preview info card (for DOC/XLS files) */
.preview-nopreview {
    text-align: center;
    color: var(--text-primary);
    padding: 2rem;
}

.preview-nopreview-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.preview-nopreview h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    word-break: break-all;
    margin-bottom: 0.5rem;
}

.preview-nopreview p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
}

/* ===== Multi-File Selected List (Complaint Form) ===== */
.selected-files-list {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.selected-file-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 180, 216, 0.06);
    border: 1px solid rgba(0, 180, 216, 0.15);
    border-radius: var(--radius-sm);
    animation: fadeSlideIn 0.2s ease;
}

.selected-file-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.selected-file-item .selected-file-name {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-all;
}

.selected-file-item .selected-file-name small {
    color: var(--text-muted);
    font-weight: 400;
}

/* ===== Upload Queue (View Page Multi-Upload) ===== */
.upload-queue {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.upload-queue-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0.85rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    animation: fadeSlideIn 0.2s ease;
}

.upload-queue-name {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-all;
    margin-right: 0.75rem;
}

.upload-queue-name small {
    color: var(--text-muted);
    font-weight: 400;
}

.upload-queue-status {
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.upload-queue-status.uploading {
    color: var(--accent);
}

.upload-queue-status.success {
    color: var(--success);
}

.upload-queue-status.error {
    color: var(--danger);
}

/* Upload Spinner */
.upload-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(0, 180, 216, 0.25);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* Upload Error */
.upload-error {
    margin-top: 0.75rem;
    padding: 0.65rem 1rem;
    background: rgba(239, 71, 111, 0.1);
    border: 1px solid rgba(239, 71, 111, 0.25);
    border-radius: var(--radius-sm);
    color: #ff6b8a;
    font-size: 0.88rem;
    font-weight: 500;
    animation: fadeSlideIn 0.25s ease;
}

[data-theme="light"] .upload-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

/* Upload Success */
.upload-success {
    margin-top: 0.75rem;
    padding: 0.65rem 1rem;
    background: rgba(6, 214, 160, 0.1);
    border: 1px solid rgba(6, 214, 160, 0.25);
    border-radius: var(--radius-sm);
    color: #2ee8b0;
    font-size: 0.88rem;
    font-weight: 500;
    animation: fadeSlideIn 0.25s ease;
}

[data-theme="light"] .upload-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #059669;
}

/* Upload Progress */
.upload-progress {
    margin-top: 0.75rem;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-secondary);
    overflow: hidden;
}

.upload-progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--accent), var(--primary-light));
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* ===== Attachment Display Section ===== */
.attachment-section {
    margin-top: 1.25rem;
    padding: 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

[data-theme="light"] .attachment-section {
    background: #f8fafc;
}

.attachment-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.attachment-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.attachment-item:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(0, 180, 216, 0.1);
}

.attachment-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

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

.attachment-name {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    word-break: break-all;
    transition: var(--transition);
}

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

.attachment-meta {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.attachment-download-btn {
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
    white-space: nowrap;
    flex-shrink: 0;
    background: rgba(0, 180, 216, 0.1);
    color: var(--accent);
    border: 1px solid rgba(0, 180, 216, 0.2);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: var(--transition);
}

.attachment-download-btn:hover {
    background: rgba(0, 180, 216, 0.2);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.attachment-empty {
    font-size: 0.88rem;
    color: var(--text-muted);
    text-align: center;
    padding: 1rem 0;
}

.attachment-upload-area {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* Hidden file input (outside upload zone to prevent double-click bug) */
.upload-file-input-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    pointer-events: none;
}

/* Attachment thumbnail for images */
.attachment-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.attachment-thumb:hover {
    transform: scale(1.08);
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(0, 180, 216, 0.2);
}

/* Attachment action buttons group */
.attachment-actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
    align-items: center;
}

/* Preview/View button */
.attachment-preview-btn {
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
    white-space: nowrap;
    background: rgba(139, 92, 246, 0.1);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.attachment-preview-btn:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: #a78bfa;
    transform: translateY(-1px);
}

[data-theme="light"] .attachment-preview-btn {
    color: #7c3aed;
    background: rgba(124, 58, 237, 0.08);
    border-color: rgba(124, 58, 237, 0.2);
}

[data-theme="light"] .attachment-preview-btn:hover {
    background: rgba(124, 58, 237, 0.15);
    border-color: #7c3aed;
}

/* ===== Preview Modal ===== */
.preview-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 10000;
    flex-direction: column;
    animation: fadeIn 0.2s ease;
}

.preview-overlay.active {
    display: flex;
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.preview-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60%;
}

.preview-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.preview-download-btn {
    font-size: 0.85rem;
    padding: 0.4rem 1rem;
    background: rgba(0, 180, 216, 0.2);
    color: #67e8f9;
    border: 1px solid rgba(0, 180, 216, 0.3);
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.preview-download-btn:hover {
    background: rgba(0, 180, 216, 0.35);
    color: #fff;
}

.preview-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.preview-close-btn:hover {
    background: rgba(239, 71, 111, 0.4);
    border-color: rgba(239, 71, 111, 0.6);
}

.preview-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    overflow: auto;
}

.preview-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    animation: fadeSlideIn 0.3s ease;
}

.preview-iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    animation: fadeSlideIn 0.3s ease;
}

/* Responsive adjustments for attachments */
@media (max-width: 640px) {
    .attachment-item {
        flex-wrap: wrap;
    }
    .attachment-actions {
        width: 100%;
        justify-content: flex-end;
    }
    .attachment-download-btn,
    .attachment-preview-btn {
        flex: 1;
        text-align: center;
    }
    .preview-title {
        max-width: 40%;
        font-size: 0.85rem;
    }
}
