/* Company Theme Variables */
:root {
    color-scheme: light;
    --police-blue: #3d6a8e;
    --police-navy: #1a3a5c;
    --police-light-blue: #5b8bb4;
    --police-gold: #c5a032;
    --text-light: #f8fafc;
    --border-color: #e2e8f0;
    --bg-light: #f5f5f5;
    --success-green: #10b981;
    --danger-red: #ef4444;
    /* 17% black tint used for former dark-blue elements (buttons/top banner) */
    --brand-grey: #d4d4d4;
    --brand-grey-dark: #bcbcbc;
}

/* Global Styles */
* {
    box-sizing: border-box;
}

html {
    overflow-x: auto;
    color-scheme: light;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-light);
    color: #000;
    overflow-x: hidden;
    min-width: 320px;
    color-scheme: light;
}

/* Header copy font - closest free match to Athelas */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Lora', Georgia, 'Times New Roman', serif;
}

/* Header Styles */
.police-header {
    background: var(--brand-grey);
    padding: 0.75rem 0;
    box-shadow: none;
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Remove this - it's duplicated later in the file */

.police-header h1 {
    font-size: 1.75rem;
    margin: 0;
    line-height: 1.2;
    color: #000;
}

.police-header p {
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.2;
}

.police-logo {
    height: 120px;
    width: auto;
}

/* Login Section */
.login-section {
    min-height: calc(100vh - 100px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}

/* Password toggle button */
#togglePassword {
    border: 1px solid #ced4da;
    border-left: none;
    color: #6b7280;
    background: white;
    border-radius: 0 0.375rem 0.375rem 0;
}

#togglePassword:hover {
    color: #000;
    background: #f8fafc;
    border-color: #ced4da;
}

#togglePassword:focus {
    box-shadow: none;
    border-color: #ced4da;
    background: white;
}

/* Ensure password input has no right border radius */
.input-group #password {
    border-radius: 0.375rem 0 0 0.375rem;
    border-right: none;
}

.input-group #password:focus {
    border-right: none;
    box-shadow: none;
}

.login-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 2.5rem;
    border-top: 4px solid var(--brand-grey);
}

.login-logo {
    height: 144px;
    width: auto;
}

.form-control:focus {
    border-color: var(--police-light-blue);
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
}

.btn-primary {
    background-color: var(--brand-grey) !important;
    border-color: var(--brand-grey) !important;
    color: #000 !important;
    padding: 0.75rem 1rem;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active,
.btn-primary:not(:disabled):not(.disabled):active,
.btn-primary:not(:disabled):not(.disabled).active {
    background-color: var(--brand-grey-dark) !important;
    border-color: var(--brand-grey-dark) !important;
    color: #000 !important;
    box-shadow: none !important;
}

/* Login Error Message Styling */
#loginError {
    font-size: 0.875rem;
}

.forgot-password-link {
    color: #000;
    text-decoration: none;
    font-size: 0.9rem;
}

.forgot-password-link:hover {
    color: #000;
    text-decoration: underline;
}

/* Email Interface */
.email-section {
    min-height: calc(100vh - 100px);
}

.email-sidebar {
    background: white;
    border-right: 1px solid var(--border-color);
    padding: 0;
    min-height: calc(100vh - 100px);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-light);
}

.email-folders li {
    border-bottom: 1px solid var(--border-color);
}

.email-folders a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: #64748b;
    text-decoration: none;
    transition: all 0.2s;
    position: relative;
}

.email-folders a:hover,
.email-folders li.active a {
    background-color: #000;
    color: white;
}

.email-folders .badge {
    float: right;
}

.user-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-light);
}

.avatar {
    width: 40px;
    height: 40px;
    background: var(--police-light-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

/* Inbox Container */
.inbox-container {
    background: white;
    padding: 0;
    height: calc(100vh - 100px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.inbox-header {
    padding: 2rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-light);
    position: sticky;
    top: 0;
    z-index: 10;
}

.inbox-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info-compact {
    display: flex;
    align-items: center;
}

/* Email List */
.email-list {
    background: white;
    padding: 0;
    flex: 1;
    overflow-y: auto;
}

.email-list-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-light);
    position: sticky;
    top: 0;
    z-index: 10;
}

.email-item {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.email-item:hover {
    background-color: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.email-item.unread {
    font-weight: 600;
    background-color: #fefefe;
    border-left: 4px solid var(--police-blue);
}

.email-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.email-content-left {
    flex: 0 0 320px;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.email-content-middle {
    flex: 1;
    min-width: 0;
    padding: 0 1rem;
    display: flex;
    align-items: flex-start;
    padding-top: 1.5rem;
    justify-content: center;
}

.email-content-right {
    flex: 0 0 120px;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.email-preview-middle {
    color: #6b7280;
    font-size: 0.85rem;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    max-width: 300px;
}

.email-sender {
    font-weight: 600;
    color: #000;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-subject {
    color: #374151;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
    margin-top: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-datetime {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}

.email-time {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.1rem;
}

.email-preview {
    color: #6b7280;
    font-size: 0.85rem;
    line-height: 1.4;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

@media (max-width: 768px) {
    .email-preview {
        display: none;
    }
    
    .email-content-middle {
        display: none;
    }
    
    .email-item {
        justify-content: space-between;
        gap: 1rem;
    }
    
    .email-content-left {
        flex: 1;
    }
    
    .email-content-right {
        flex: 0 0 auto;
        flex-direction: column;
        align-items: flex-end;
        gap: 0.5rem;
    }
    
    .email-datetime {
        align-items: flex-end;
        text-align: right;
    }
}

.email-date {
    font-size: 0.8rem;
    color: #9ca3af;
    float: right;
}

.attachment-icon {
    color: #6b7280;
    margin-left: 0.5rem;
}

/* Email Single View (Both Desktop and Mobile) */
.email-single-view {
    display: none;
    background: white;
    min-height: calc(100vh - 100px);
}

.email-back-header {
    background: var(--bg-light);
    padding: 0.5rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: 50px;
}

.back-button {
    background: none;
    border: none;
    color: #000;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 5px;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 48px;
}

.back-button:hover {
    background-color: #e5e7eb;
}

.email-count-mobile {
    font-size: 1rem;
    color: #6b7280;
    font-weight: 500;
}

.email-viewer {
    height: 100%;
    overflow-y: auto;
}

.email-header {
    padding: 2rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-light);
}

.email-subject-line {
    font-size: 1.5rem;
    font-weight: 600;
    color: #000;
    margin-bottom: 1rem;
}

.email-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    font-size: 0.9rem;
    color: #6b7280;
    flex-wrap: wrap;
}

.email-meta-left {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.email-meta-right {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: right;
}

.email-body {
    padding: 2rem;
    line-height: 1.6;
    font-size: 1rem;
}

.email-body pre {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 5px;
    border-left: 4px solid var(--police-blue);
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
}

.email-signature {
    margin-top: 2rem;
    padding-top: 1rem;
    color: #6b7280;
}

.attachment-section {
    padding: 1rem 2rem;
    background: #f8fafc;
    border-top: 1px solid var(--border-color);
}

.attachment {
    display: inline-flex;
    align-items: center;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 0.5rem 1rem;
    margin-right: 1rem;
    margin-bottom: 0.5rem;
    text-decoration: none;
    color: #000;
    transition: all 0.2s;
}

.attachment:hover {
    background: var(--bg-light);
    color: #000;
    text-decoration: none;
}

.attachment-item {
    margin-bottom: 1rem;
}

.attachment-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.attachment-preview {
    margin-top: 0.5rem;
    text-align: center;
}

.attachment-preview img {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.attachment i {
    margin-right: 0.5rem;
    color: var(--police-gold);
}

/* Email Threading Styles */
.quoted-header {
    margin: 1rem 0 0.5rem 0;
    padding: 0.5rem;
    font-size: 0.9rem;
    color: #6b7280;
    background: #f8fafc;
    border-radius: 4px;
}

/* Header Layout */
.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    flex: 1;
}

.header-right {
    flex: none;
}

.flag-icon {
    display: inline-block;
    width: 24px;
    height: 18px;
    background-size: cover;
    background-position: center;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.language-button {
    background-color: rgba(255, 255, 255, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.9) !important;
    color: #000 !important;
    padding: 0.5rem 0.75rem;
}

.language-button:hover,
.language-button:focus,
.language-button.show {
    background-color: white !important;
    border-color: white !important;
    color: #000 !important;
}

.flag-uk { background-image: url('https://flagcdn.com/w40/gb.png'); }
.flag-es { background-image: url('https://flagcdn.com/w40/es.png'); }
.flag-de { background-image: url('https://flagcdn.com/w40/de.png'); }
.flag-it { background-image: url('https://flagcdn.com/w40/it.png'); }
.flag-fr { background-image: url('https://flagcdn.com/w40/fr.png'); }

.dropdown-item .flag-icon {
    margin-right: 0.5rem;
    vertical-align: middle;
}

.header-text {
    margin-left: 0.75rem;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .police-header {
        padding: 0.75rem 0;
    }
    
    .police-header .container-fluid {
        padding: 0 1rem;
    }
    
    .header-content {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .header-left {
        display: flex;
        align-items: center;
        flex: 1;
        min-width: 0;
    }
    
    .police-logo {
        height: 88px;
        margin-right: 0.75rem;
        flex-shrink: 0;
    }
    
    .header-text {
        margin-left: 0;
        min-width: 0;
        flex: 1;
    }
    
    .police-header h1 {
        font-size: 1.1rem;
        margin: 0;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .police-header p {
        font-size: 0.85rem;
        margin: 0;
        line-height: 1.1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .header-right {
        flex-shrink: 0;
        margin-left: 0.75rem;
    }
    
    .email-sidebar,
    .email-content {
        min-height: auto;
        max-height: none;
    }
    
    .email-section {
        min-height: calc(100dvh - 80px); /* Use dynamic viewport height for mobile */
        height: calc(100dvh - 80px);
        overflow: hidden;
    }
    
    .email-section .row {
        flex-direction: column;
        min-height: auto;
        height: 100%;
        flex: 1;
        display: flex;
    }
    
    .inbox-container {
        height: calc(100dvh - 80px); /* Full viewport minus header */
        min-height: calc(100dvh - 80px);
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    
    .email-sidebar {
        order: 3;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        min-height: auto;
        max-height: 200px;
        overflow-y: auto;
        background: white;
        border-top: 1px solid var(--border-color);
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    }
    
    .email-list {
        order: 1;
        flex: 1;
        overflow-y: scroll;
        max-height: none;
        min-height: 0; /* Allow flexbox to shrink */
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        box-sizing: border-box;
    }
    
    /* Mobile adjustments for new design */
    .inbox-header {
        padding: 1rem;
        background: var(--bg-light);
        border-bottom: 1px solid var(--border-color);
        flex-shrink: 0; /* Don't let header shrink */
    }
    
    .inbox-actions {
        flex-direction: column;
        align-items: flex-end;
        gap: 0.5rem;
    }
    
    .user-info-compact {
        font-size: 0.9rem;
    }
    
    .email-item {
        padding: 1rem 1.5rem;
    }
    
    .email-back-header {
        padding: 0.5rem 1rem;
        min-height: 45px;
    }
    
    .user-info {
        position: static;
        padding: 1rem;
    }
    
    .login-card {
        margin: 1rem;
        padding: 2rem;
    }
    
    .login-section {
        min-height: calc(100vh - 120px);
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 2rem 0;
    }
}

@media (max-width: 576px) {
    .police-header {
        padding: 0.6rem 0;
    }
    
    .police-header .container-fluid {
        padding: 0 0.75rem;
    }
    
    .police-logo {
        height: 80px;
        margin-right: 0.6rem;
    }
    
    .police-header h1 {
        font-size: 1rem;
    }
    
    .police-header p {
        font-size: 0.8rem;
    }
    
    .login-logo {
        height: 144px;
    }
    
    .attachment-section {
        padding: 0.75rem;
    }
    
    .attachment {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    
    .attachment i {
        font-size: 0.9rem;
        margin-right: 0.4rem;
    }
    
    .email-header {
        padding: 1rem;
    }
    
    .email-body {
        padding: 1rem;
    }
    
    .email-subject-line {
        font-size: 1.25rem;
    }
    
    .attachment-section {
        padding: 1rem;
        background: #f8fafc;
        border-top: 1px solid var(--border-color);
        margin-top: 1rem;
    }
    
    .attachment {
        display: flex;
        width: 100%;
        margin: 0 0 0.75rem 0;
        padding: 0.75rem;
        font-size: 0.85rem;
        border-radius: 8px;
        box-sizing: border-box;
        background: white;
        border: 1px solid var(--border-color);
        justify-content: flex-start;
        align-items: center;
        min-width: 0;
        flex-wrap: nowrap;
        overflow: hidden;
    }
    
    .attachment i {
        font-size: 1rem;
        margin-right: 0.5rem;
        flex-shrink: 0;
    }
    
    .attachment span {
        flex: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        min-width: 0;
    }
}

/* Custom Scrollbars */
.email-list::-webkit-scrollbar,
.email-content::-webkit-scrollbar {
    width: 6px;
}

.email-list::-webkit-scrollbar-track,
.email-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.email-list::-webkit-scrollbar-thumb,
.email-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.email-list::-webkit-scrollbar-thumb:hover,
.email-content::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Show thin scrollbar on mobile */
@media (max-width: 768px) {
    .email-list::-webkit-scrollbar {
        width: 4px;
        display: block;
    }
    
    .email-list::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .email-list::-webkit-scrollbar-thumb {
        background: rgba(0,0,0,0.3);
        border-radius: 2px;
    }
    
    .email-list {
        scrollbar-width: thin; /* Firefox */
    }
}

/* Loading States */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #9ca3af;
}

.loading i {
    animation: spin 1s linear infinite;
}

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

/* Email Threads */
.email-thread {
    margin-top: 1.5rem;
    padding-left: 1rem;
    border-left: 3px solid #c5a032;
}

.thread-message {
    background-color: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
}

.thread-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.875rem;
    color: #4b5563;
}

.thread-meta-left div,
.thread-meta-right div {
    margin-bottom: 0.15rem;
}

.thread-meta-right {
    color: #6b7280;
}

.thread-body {
    color: #1f2937;
    font-size: 0.95rem;
    line-height: 1.6;
}

.thread-body p {
    margin-bottom: 0.75rem;
}

/* Thread label badge */
.thread-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    margin-bottom: 0.6rem;
}

.thread-forward {
    border-left-color: #3d6a8e;
}
.thread-forward .thread-label {
    background-color: #e0ecf6;
    color: #000;
}
.thread-forward .thread-message {
    background-color: #f3f7fb;
    border-color: #d4e2ee;
}

.thread-reply .thread-label {
    background-color: #fff4dc;
    color: #8a6a16;
}

/* Zynk Ride Receipt */
.zynk-receipt {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1f2937;
    max-width: 640px;
    margin: 0 auto;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
}
.zynk-header {
    background: linear-gradient(135deg, #2aa6b5 0%, #1f7a86 100%);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.zynk-logo {
    height: 44px;
    width: auto;
    display: block;
}
.zynk-receipt-tag {
    color: #ffffff;
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    font-weight: 700;
    background: rgba(255,255,255,0.18);
    padding: 6px 12px;
    border-radius: 999px;
}
.zynk-receipt p { margin: 0 0 12px; padding: 0 24px; line-height: 1.5; }
.zynk-greeting { padding-top: 20px !important; font-weight: 600; }

.zynk-card {
    margin: 16px 24px;
    padding: 18px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fafbfc;
}
.zynk-section-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #6b7280;
    font-weight: 700;
    margin-bottom: 14px;
}

/* Route stops */
.zynk-route { position: relative; }
.zynk-stop {
    display: flex;
    gap: 14px;
    padding: 6px 0 18px;
    position: relative;
}
.zynk-stop:last-child { padding-bottom: 0; }
.zynk-stop:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 22px;
    bottom: 4px;
    width: 2px;
    background: repeating-linear-gradient(to bottom, #cbd5e1 0 4px, transparent 4px 8px);
}
.zynk-dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
    z-index: 1;
}
.zynk-dot-start { background: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,0.2); }
.zynk-dot-mid   { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,0.2); }
.zynk-dot-end   { background: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,0.2); }
.zynk-stop-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
    font-weight: 600;
}
.zynk-stop-name { font-weight: 600; color: #111827; margin-top: 2px; }
.zynk-stop-addr { font-size: 0.875rem; color: #4b5563; }

.zynk-trip-meta {
    display: flex;
    gap: 24px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed #d1d5db;
    flex-wrap: wrap;
}
.zynk-trip-meta > div { display: flex; flex-direction: column; }
.zynk-meta-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
    font-weight: 600;
}
.zynk-meta-value { font-weight: 600; color: #111827; }

/* Fare table */
.zynk-fare { width: 100%; border-collapse: collapse; }
.zynk-fare td {
    padding: 9px 0;
    border-bottom: 1px dashed #e5e7eb;
    font-size: 0.95rem;
}
.zynk-fare td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.zynk-fare .zynk-sub { color: #9ca3af; font-size: 0.85rem; margin-left: 4px; }
.zynk-fare .zynk-total td {
    border-bottom: none;
    border-top: 2px solid #1f2937;
    padding-top: 14px;
    font-weight: 700;
    font-size: 1.1rem;
    color: #1f7a86;
}

/* Map placeholder */
.zynk-map {
    height: 160px;
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(42,166,181,0.08), rgba(31,122,134,0.12)),
        repeating-linear-gradient(45deg, #e5edf0 0 2px, #f3f7f8 2px 14px),
        repeating-linear-gradient(-45deg, #e5edf0 0 2px, #f3f7f8 2px 14px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    color: #1f7a86;
    font-weight: 600;
    border: 1px dashed #b6d3d8;
}
.zynk-map i { font-size: 2rem; }

/* Driver */
.zynk-driver { display: flex; align-items: center; gap: 16px; }
.zynk-driver-avatar i { font-size: 3rem; color: #2aa6b5; }
.zynk-driver-info { display: flex; flex-wrap: wrap; gap: 8px 24px; flex: 1; }
.zynk-driver-info > div { display: flex; flex-direction: column; }
.zynk-plate {
    background: #fde68a;
    color: #1f2937;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    letter-spacing: 0.08em;
    align-self: flex-start;
}

.zynk-thanks { padding-top: 8px !important; color: #4b5563; }
.zynk-help {
    margin: 8px 24px 16px;
    padding: 12px 14px;
    background: #f0f9fa;
    border-left: 3px solid #2aa6b5;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #1f7a86;
}
.zynk-help a { color: #1f7a86; font-weight: 600; }

.zynk-footer {
    background: #f9fafb;
    padding: 18px 24px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
    font-size: 0.8rem;
    color: #6b7280;
    line-height: 1.6;
}
.zynk-footer-fine { font-size: 0.72rem; margin-top: 8px; color: #9ca3af; }
.zynk-footer a { color: #2aa6b5; }

.zynk-map-video {
    height: auto;
    aspect-ratio: 1 / 1;
    padding: 0;
    overflow: hidden;
    border: none;
    background: #000;
}
.zynk-map-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ===== Repository (case file list) ===== */
.repository-section {
    padding: 2rem 0 3rem;
}

.repository-panel {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem 1.75rem 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.repository-topbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.95rem;
    color: #4b5563;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.repository-topbar strong {
    color: #000;
}

.repository-divider {
    color: #cbd5e1;
}

.file-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-start;
}

.file-card {
    background: none;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 1rem 0.75rem;
    width: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
    text-align: center;
}

.file-card:hover {
    background-color: #f3f4f6;
    border-color: var(--border-color);
}

.file-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 72px;
}

.file-icon img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    display: block;
}

.file-label {
    font-size: 0.85rem;
    line-height: 1.3;
    color: #374151;
    word-break: break-word;
}

.repository-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.repo-btn {
    background-color: var(--brand-grey) !important;
    border: 1px solid var(--brand-grey-dark) !important;
    color: #111 !important;
    font-size: 0.9rem;
    padding: 0.45rem 1.1rem;
    border-radius: 5px;
}

.repo-btn:hover {
    background-color: var(--brand-grey-dark) !important;
}

.repo-btn-logout {
    background-color: #333 !important;
    border: 1px solid #333 !important;
    color: #fff !important;
    font-size: 0.9rem;
    padding: 0.45rem 1.1rem;
    border-radius: 5px;
}

.repo-btn-logout:hover {
    background-color: #1a1a1a !important;
    border-color: #1a1a1a !important;
}

.repo-other-cases {
    display: inline-block;
    margin-bottom: 1rem;
}

/* ===== Header repository mode ===== */
.header-repo-actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.repo-link {
    color: #111;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.repo-link:hover {
    text-decoration: underline;
    color: #000;
}

/* ===== Document viewer ===== */
.document-viewer {
    padding: 0;
}

.document-header {
    padding: 2rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-light);
}

.document-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #000;
    margin: 0 0 0.35rem;
}

.document-meta {
    font-size: 0.9rem;
    color: #6b7280;
}

.document-content {
    padding: 2rem;
    display: flex;
    justify-content: center;
}

.document-image-wrap {
    text-align: center;
    max-width: 900px;
}

.document-image {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.document-audio-wrap {
    width: 100%;
    max-width: 640px;
    padding: 2rem 0;
}

.document-audio {
    width: 100%;
}

.document-actions {
    padding: 0 2rem 2rem;
    display: flex;
    justify-content: center;
}

@media (max-width: 576px) {
    .file-card {
        width: calc(50% - 0.75rem);
    }
}
