/* ==========================================================================
   ServiceFlow - CSS Stylesheet
   Design System: Dark Grey with Dark Green Accents
   ========================================================================== */

/* --- Modern Google Font & Variables --- */
:root {
    /* Color Palette */
    --bg-main: #121316;
    --bg-card: #1c1d22;
    --bg-input: #25272e;
    --bg-hover: #2d3039;
    --border-color: #343742;
    
    /* Green Accents */
    --primary: #0f8b50;      /* Rich dark forest green */
    --primary-hover: #14a862;/* Slightly brighter green */
    --primary-glow: rgba(15, 139, 80, 0.25);
    --accent-light: #2ecc71;  /* Light minty green for success and badges */
    
    /* Text Colors */
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dark: #111827;
    
    /* Semantic Colors */
    --status-open: #f59e0b;       /* Orange */
    --status-progress: #3b82f6;   /* Blue */
    --status-completed: #10b981;  /* Green */
    --danger: #ef4444;            /* Red */
    --danger-hover: #dc2626;
    --danger-glow: rgba(239, 68, 68, 0.2);

    /* UI Layout Variables */
    --border-radius-sm: 6px;
    --border-radius-md: 12px;
    --border-radius-lg: 18px;
    --transition-speed: 0.25s;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);
    
    /* Font */
    --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-family);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* --- App Container & Layout --- */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Header & Navigation --- */
.app-header {
    background: rgba(28, 29, 34, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    color: var(--primary);
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 0 6px var(--primary-glow));
}

.logo-area h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-main);
}

.logo-area h1 span {
    color: var(--primary);
}

.nav-menu {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-family);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.6rem 1.2rem;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-speed) ease;
}

.nav-btn i {
    width: 18px;
    height: 18px;
}

.nav-btn:hover {
    color: var(--text-main);
    background: var(--bg-hover);
}

.nav-btn.active {
    color: var(--text-main);
    background: var(--primary-glow);
    border: 1px solid rgba(15, 139, 80, 0.4);
}

.btn-accent {
    background: var(--primary);
    color: white !important;
    border: 1px solid var(--primary);
}

.btn-accent:hover {
    background: var(--primary-hover) !important;
    box-shadow: 0 0 12px var(--primary-glow);
}

/* --- Main Layout --- */
.app-main {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

.app-view {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.app-view.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* --- View Headers --- */
.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.view-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    position: relative;
    padding-left: 0.75rem;
}

.view-header h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    height: 70%;
    width: 4px;
    background-color: var(--primary);
    border-radius: 2px;
}

/* --- Stats Grid --- */
.stats-grid {
    display: flex;
    gap: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 160px;
    box-shadow: var(--shadow-sm);
}

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

.stat-icon i {
    width: 22px;
    height: 22px;
}

.stat-icon.open {
    background: rgba(245, 158, 11, 0.15);
    color: var(--status-open);
}

.stat-icon.progress {
    background: rgba(59, 130, 246, 0.15);
    color: var(--status-progress);
}

.stat-icon.completed {
    background: rgba(16, 185, 129, 0.15);
    color: var(--status-completed);
}

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

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* --- Filters & Search Bar --- */
.filters-bar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1.5rem;
    flex-wrap: wrap;
    box-shadow: var(--shadow-sm);
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 280px;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 18px;
    height: 18px;
}

.search-box input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 0.75rem 1rem 0.75rem 2.8rem;
    color: var(--text-main);
    font-family: var(--font-family);
    font-size: 0.95rem;
    outline: none;
    transition: all var(--transition-speed);
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.filter-options {
    display: flex;
    gap: 0.5rem;
}

.filter-btn {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.filter-btn:hover {
    color: var(--text-main);
    border-color: var(--text-muted);
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* --- Cards & Grid Layouts --- */
.orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.order-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all var(--transition-speed) cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    min-height: 220px;
}

.order-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    transition: background-color var(--transition-speed);
}

.order-card.priority-dringend::before {
    background: var(--danger);
}

.order-card.priority-hoch::before {
    background: #f59e0b;
}

.order-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.status-offen {
    background: rgba(245, 158, 11, 0.15);
    color: var(--status-open);
}

.badge.status-in_arbeit {
    background: rgba(59, 130, 246, 0.15);
    color: var(--status-progress);
}

.badge.status-abgeschlossen {
    background: rgba(16, 185, 129, 0.15);
    color: var(--status-completed);
}

.badge.priority-dringend {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.badge.priority-hoch {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.badge.priority-normal {
    background: rgba(156, 163, 175, 0.15);
    color: var(--text-muted);
}

.order-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.order-card p.card-desc {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.4;
    margin-bottom: 1.25rem;
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.order-card-customer {
    border-top: 1px solid var(--border-color);
    padding-top: 0.85rem;
    margin-top: auto;
}

.customer-name-block {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.customer-name-block i {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.order-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.order-card-footer span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.order-card-footer i {
    width: 14px;
    height: 14px;
}

/* --- Empty and Utility States --- */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-card);
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.empty-state i {
    width: 60px;
    height: 60px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.empty-state h3 {
    font-size: 1.4rem;
    font-weight: 600;
}

.empty-state p {
    color: var(--text-muted);
    max-width: 400px;
    margin-bottom: 1rem;
}

/* --- Buttons --- */
.btn {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.7rem 1.4rem;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all var(--transition-speed) ease;
    text-decoration: none;
    outline: none;
}

.btn i {
    width: 18px;
    height: 18px;
}

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

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

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 0 12px var(--primary-glow);
}

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

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

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
    box-shadow: 0 0 12px var(--danger-glow);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: var(--border-radius-sm);
}

.btn-sm i {
    width: 14px;
    height: 14px;
}

.btn-full {
    width: 100%;
}

.btn-icon-text {
    padding-left: 1rem;
    padding-right: 1.2rem;
}

.btn-rapport {
    background: #0f8b50;
    color: white;
    border-color: #0f8b50;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(15, 139, 80, 0.4);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(15, 139, 80, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(15, 139, 80, 0);
    }
}

.back-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 500;
}

.back-btn:hover {
    color: var(--text-main);
    background: var(--bg-card);
}

.order-actions-top {
    display: flex;
    gap: 0.75rem;
}

/* --- Forms & Card Forms --- */
.card-form {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

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

@media (max-width: 900px) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-section h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-hover);
}

.form-section h3 i {
    width: 20px;
    height: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

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

label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
}

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 0.75rem 1rem;
    color: var(--text-main);
    font-family: var(--font-family);
    font-size: 0.95rem;
    outline: none;
    width: 100%;
    transition: all var(--transition-speed);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

textarea {
    resize: vertical;
}

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

/* --- Inline Forms (Inside Details) --- */
.inline-form {
    background: var(--bg-input);
    padding: 1.25rem;
    border-radius: var(--border-radius-md);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1.2fr 1fr 2fr 1.2fr;
    gap: 1rem;
    align-items: end;
}

.form-row-4 {
    display: grid;
    grid-template-columns: 1.5fr 1.5fr 1fr 0.8fr 0.8fr 1.2fr;
    gap: 1rem;
    align-items: end;
}

@media (max-width: 1024px) {
    .form-row-3, .form-row-4 {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    .form-btn-align {
        grid-column: span 2;
    }
}

@media (max-width: 600px) {
    .form-row-3, .form-row-4 {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    .form-btn-align {
        grid-column: span 1;
    }
}

.form-btn-align {
    display: flex;
    justify-content: flex-end;
}

/* --- Order Details View Grid --- */
.order-details-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2rem;
}

.hours-card,
.materials-card {
    grid-column: span 2;
}

@media (max-width: 1024px) {
    .order-details-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .hours-card,
    .materials-card {
        grid-column: span 1;
    }
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-main);
}

.card h3 i {
    color: var(--primary);
    width: 22px;
    height: 22px;
}

.divider {
    border: 0;
    height: 1px;
    background: var(--border-color);
    margin: 1.5rem 0;
}

/* Detail Info Card Styling */
.order-info-card #detail-title {
    font-size: 2rem;
    font-weight: 800;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    line-height: 1.25;
}

.detail-description {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.6;
    white-space: pre-wrap;
}

.customer-info-section {
    margin-bottom: 1.5rem;
}

.customer-info-section h3 {
    margin-bottom: 0.75rem;
}

.customer-details {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 1.25rem;
}

.customer-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.customer-address {
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 0.75rem;
    white-space: pre-line;
}

.customer-contact-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
}

.customer-contact-links span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.customer-contact-links i {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.customer-contact-links a {
    color: var(--text-main);
    text-decoration: none;
    transition: color 0.2s;
}

.customer-contact-links a:hover {
    color: var(--accent-light);
    text-decoration: underline;
}

.dates-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
}

.date-block {
    background: var(--bg-input);
    border-radius: var(--border-radius-sm);
    padding: 0.75rem 1rem;
    border-left: 3px solid var(--primary);
}

.date-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    display: block;
    margin-bottom: 0.25rem;
}

.date-value {
    font-size: 1rem;
    font-weight: 700;
}

/* --- Photo Gallery --- */
.card-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-header-actions h3 {
    margin-bottom: 0;
}

.photo-upload-label {
    cursor: pointer;
    margin-top: 0;
}

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
}

.photo-item {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    transition: transform var(--transition-speed);
}

.photo-item:hover {
    transform: scale(1.05);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-caption-tag {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    font-size: 0.7rem;
    padding: 0.3rem 0.5rem;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    text-align: center;
}

.empty-gallery-state {
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    border: 1px dashed var(--border-color);
    border-radius: var(--border-radius-md);
}

.empty-gallery-state i {
    width: 36px;
    height: 36px;
}

.empty-gallery-state p {
    font-size: 0.88rem;
    line-height: 1.4;
}

/* --- Data Tables --- */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-input);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

.data-table th {
    background: rgba(28, 29, 34, 0.5);
    padding: 0.85rem 1.25rem;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

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

.data-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.data-table tfoot {
    border-top: 2px solid var(--border-color);
    background: rgba(15, 139, 80, 0.05);
}

.data-table tfoot td {
    padding: 1rem 1.25rem;
    border-bottom: none;
}

.text-right {
    text-align: right;
}

.font-bold {
    font-weight: 700;
}

.btn-action {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-speed);
}

.btn-action:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.btn-action i {
    width: 16px;
    height: 16px;
}

/* --- Modals (Popups) --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 10, 12, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    max-width: 650px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox-content {
    max-width: 800px;
}

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

.modal-header {
    background: rgba(28, 29, 34, 0.5);
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-header h3 i {
    color: var(--primary);
    width: 20px;
    height: 20px;
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.btn-close-modal:hover {
    color: var(--text-main);
    background: var(--bg-hover);
}

.btn-close-modal i {
    width: 20px;
    height: 20px;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.25rem 1.5rem;
    background: rgba(28, 29, 34, 0.5);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Signature Pad Styling */
.signature-canvas-container {
    background: #e5e7eb;
    border: 1px solid #d1d5db;
    border-radius: var(--border-radius-md);
    margin-top: 1rem;
    overflow: hidden;
    position: relative;
    cursor: crosshair;
}

#signature-canvas {
    display: block;
    width: 100%;
    height: 250px;
}

/* Lightbox Styling */
#lightbox-image {
    max-width: 100%;
    max-height: 50vh;
    border-radius: var(--border-radius-md);
    margin-bottom: 1.5rem;
    object-fit: contain;
    border: 1px solid var(--border-color);
}

.lightbox-caption-field {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.text-center {
    text-align: center;
}

/* --- VIEW: RAPPORT PREVIEW & PRINT SHEET --- */
.app-view-full {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #0f1012;
    z-index: 150;
    overflow-y: auto;
    padding: 2rem 1rem;
}

.app-view-full.active {
    display: block;
}

.rapport-preview-container {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.rapport-preview-header {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
}

.rapport-preview-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rapport-preview-header h2 i {
    color: var(--primary);
    width: 22px;
    height: 22px;
}

.rapport-preview-actions {
    display: flex;
    gap: 0.75rem;
}

/* Printable PDF Page styling (Standard A4 layout representation) */
.rapport-sheet {
    background: white;
    color: var(--text-dark);
    padding: 2.2rem 3rem 3rem 3rem;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-lg);
    font-family: Arial, sans-serif; /* Standard font for crisp printing */
    font-size: 10pt;
    line-height: 1.4;
    min-height: 297mm; /* A4 Height */
    display: flex;
    flex-direction: column;
}

.rapport-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 2px solid var(--text-dark);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.rapport-company-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.rapport-company-info .logo-area {
    margin-bottom: 0.5rem;
}

.rapport-company-info .logo-icon {
    color: #111827; /* Dark black icon for print */
    filter: none;
}

.rapport-company-info .company-name-large {
    font-size: 1.4rem;
    font-weight: 800;
    color: #111827;
}

.rapport-company-info .company-logo {
    max-height: 110px;
    height: 95px;
    max-width: 280px;
    width: auto;
    object-fit: contain;
    margin-top: -15px;
    margin-bottom: -10px;
    display: block;
}

.rapport-company-info p {
    font-size: 8pt;
    color: #4b5563;
}

.rapport-title-block {
    text-align: right;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.rapport-title-block h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: #111827;
    letter-spacing: -0.5px;
}

.rapport-title-block p {
    font-size: 9pt;
    color: #4b5563;
    margin-bottom: 0.15rem;
}

.rapport-title-block p span {
    font-weight: 600;
    color: #111827;
}

.rapport-addresses {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.address-block {
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    background: #f9fafb;
}

.address-label {
    font-size: 8pt;
    text-transform: uppercase;
    color: #6b7280;
    font-weight: 600;
    display: block;
    margin-bottom: 0.5rem;
}

.address-block p {
    margin-bottom: 0.25rem;
}

.order-meta-block {
    display: flex;
    align-items: flex-start;
}

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

.meta-table td {
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

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

.rapport-section {
    margin-bottom: 2rem;
}

.rapport-section h3 {
    font-size: 11pt;
    font-weight: 700;
    border-bottom: 1px solid #111827;
    padding-bottom: 0.3rem;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
}

.description-box {
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    white-space: pre-wrap;
    font-size: 9.5pt;
    line-height: 1.5;
}

.rapport-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.rapport-table th {
    background: #f3f4f6;
    border-bottom: 2px solid #d1d5db;
    padding: 0.6rem 0.8rem;
    font-weight: 700;
    font-size: 8.5pt;
    text-transform: uppercase;
    text-align: left;
}

.rapport-table td {
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid #e5e7eb;
    font-size: 9pt;
}

.rapport-table tfoot td {
    border-top: 2px solid #111827;
    padding: 0.8rem;
}

.rapport-totals-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
    margin-bottom: 2.5rem;
}

.totals-table {
    width: 320px;
    border-collapse: collapse;
}

.totals-table td {
    padding: 0.5rem 0.8rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: right;
}

.totals-table td:first-child {
    text-align: left;
    color: #4b5563;
}

.totals-table .main-total-row td {
    border-top: 2px solid #111827;
    border-bottom: double #111827;
    font-size: 11pt;
    color: #111827;
}

/* Print Photos */
.print-photos-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.print-photo-item {
    border: 1px solid #e5e7eb;
    padding: 0.5rem;
    background: #f9fafb;
    border-radius: var(--border-radius-sm);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.print-photo-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 2px;
}

.print-photo-caption {
    font-size: 8pt;
    color: #4b5563;
    text-align: center;
    font-style: italic;
}

/* Signatures Print */
.rapport-signatures-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: auto; /* Push to the very bottom of the page */
    padding-top: 2.5rem;
}

.signature-box-print {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.signature-title {
    font-weight: 700;
    font-size: 9pt;
    text-transform: uppercase;
    color: #4b5563;
}

.signature-space {
    border: 1px dashed #d1d5db;
    background: #f9fafb;
    height: 100px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.signature-space-empty {
    border: 1px dashed transparent;
    border-bottom: 1px solid #d1d5db;
    height: 100px;
}

.no-signature-placeholder {
    font-size: 8.5pt;
    color: #9ca3af;
    font-style: italic;
}

.signature-line {
    border-top: 1px solid #111827;
    margin-top: 0.5rem;
    font-size: 8pt;
    color: #4b5563;
    padding-top: 0.25rem;
}

/* --- Print Page Break Rules --- */
@media print {
    .page-break-before {
        page-break-before: always;
    }
}

/* ==========================================================================
   CSS @media Print Rules (Crucial for the Browser Print PDF Output)
   ========================================================================== */
@media print {
    /* Hide everything that isn't the print sheet */
    body, html {
        background: white !important;
        color: black !important;
        width: 100% !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .no-print, 
    header, 
    main,
    .modal,
    #view-dashboard,
    #view-order-form,
    #view-order-details,
    .rapport-preview-header {
        display: none !important;
    }
    
    .app-view-full {
        position: relative !important;
        display: block !important;
        background: white !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
        width: 100% !important;
        height: auto !important;
        z-index: auto !important;
    }
    
    .rapport-preview-container {
        margin: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        box-shadow: none !important;
        border: none !important;
    }
    
    .rapport-sheet {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        min-height: auto !important;
        display: flex !important;
        flex-direction: column !important;
    }

    /* Print media margin */
    @page {
        size: A4;
        margin: 1.5cm;
    }

    /* Keep tables from breaking inside rows */
    .rapport-table tr, 
    .totals-table tr,
    .print-photo-item,
    .signature-box-print {
        page-break-inside: avoid;
    }
    
    .rapport-section {
        page-break-inside: avoid;
    }

    /* Prevent signatures from being orphaned */
    .rapport-signatures-section {
        page-break-inside: avoid;
    }

    /* Hide inactive full screen views during printing */
    .app-view-full:not(.active) {
        display: none !important;
    }
}

/* ==========================================================================
   ServiceFlow - Erweiterungen (Sprache, PDFs, Karten & E-Nr)
   ========================================================================== */

/* --- Language Switcher --- */
.lang-switch {
    display: flex;
    gap: 0.25rem;
    background: var(--bg-input);
    padding: 0.25rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    margin-left: 1rem;
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.35rem 0.7rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.lang-btn:hover {
    color: var(--text-main);
    background: var(--bg-hover);
}

.lang-btn.active {
    background: var(--primary);
    color: white;
}

/* --- PDF Documents List & Items --- */
.pdf-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
    width: 100%;
}

.pdf-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 0.75rem 1rem;
    transition: all var(--transition-speed);
}

.pdf-item:hover {
    border-color: var(--primary);
    background: var(--bg-hover);
}

.pdf-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.pdf-icon {
    color: #ef4444; /* Red color for PDF icon */
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.pdf-icon i {
    width: 20px;
    height: 20px;
}

.pdf-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.pdf-name {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-main);
}

.pdf-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.pdf-actions {
    display: flex;
    gap: 0.5rem;
}

/* --- Leaflet Map Card Integration --- */
.card-map-wrapper {
    width: 100%;
    height: 130px;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-color);
    position: relative;
    background: #1c1d22;
    z-index: 1;
    pointer-events: none; /* Make clicks pass through to the order-card */
}

.card-map {
    width: 100%;
    height: 100%;
    background: #1c1d22;
}

.map-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: 0.8rem;
    gap: 0.35rem;
    background: #18191d;
    text-align: center;
    padding: 0.5rem;
}

.map-placeholder i {
    width: 24px;
    height: 24px;
    color: var(--text-muted);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spin {
    animation: spin 1.5s linear infinite;
}

/* --- Hours & Materials Form Rows --- */
.form-row-hours {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1.5fr 0.8fr 2fr 1fr;
    gap: 1rem;
    align-items: end;
}

.form-row-materials {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1.5fr 1fr 0.8fr 0.8fr 1.2fr;
    gap: 1rem;
    align-items: end;
}

.form-row-hours input,
.form-row-hours select,
.form-row-materials input,
.form-row-materials select {
    padding: 0.75rem 0.5rem; /* Reclaim horizontal space for typing */
}

@media (max-width: 1024px) {
    .form-row-hours,
    .form-row-materials {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    .form-row-hours .form-btn-align,
    .form-row-materials .form-btn-align {
        grid-column: span 2;
    }
    .form-row-hours input,
    .form-row-hours select,
    .form-row-materials input,
    .form-row-materials select {
        padding: 0.75rem 1rem;
    }
}

/* --- Customer Directory Layouts --- */
.customers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.customer-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 180px;
}

.customer-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.customer-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.customer-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
}

.customer-card p {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.customer-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
    margin-top: auto;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.badge.customer-type-privat {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.badge.customer-type-geschaeft {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

/* Dynamic contact person rows in form */
.contact-persons-section {
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

.contact-persons-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.contact-person-row {
    display: grid;
    grid-template-columns: 2fr 2fr 2fr 2fr auto;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    padding: 0.75rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}

.contact-person-row .btn-remove-contact {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed);
}

.contact-person-row .btn-remove-contact:hover {
    background: var(--danger);
    color: white;
}

/* Contacts display block in details view */
.contacts-display-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.contact-display-card {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.contact-display-card .contact-role {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary-hover);
}

.contact-display-card .contact-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
}

.contact-display-card .contact-detail {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.contact-display-card .contact-detail a {
    color: inherit;
    text-decoration: none;
}

.contact-display-card .contact-detail a:hover {
    text-decoration: underline;
    color: var(--accent-light);
}

/* Billing terms info block */
.billing-terms-block {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    background: rgba(245, 158, 11, 0.05);
    border: 1px dashed rgba(245, 158, 11, 0.2);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-sm);
    margin-top: 1rem;
}

.billing-terms-block i {
    color: var(--status-open);
}

@media (max-width: 768px) {
    .contact-person-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    .contact-person-row .btn-remove-contact {
        width: 100%;
        margin-top: 0.25rem;
    }
}

/* --- Settings & Backup Buttons --- */
.settings-switch {
    display: flex;
    gap: 0.25rem;
    background: var(--bg-input);
    padding: 0.25rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    margin-left: 0.5rem;
}

.settings-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.35rem;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed);
}

.settings-btn i {
    width: 15px;
    height: 15px;
    stroke-width: 2.5;
}

.settings-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

/* --- Order Number styling --- */
.order-card-number {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: -0.25rem;
    margin-bottom: 0.75rem;
}

.detail-order-number {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 0.35rem 0.75rem;
    border-radius: var(--border-radius-sm);
    display: inline-block;
    width: fit-content;
}

/* --- Login Screen Styling --- */
body.logged-out .app-header {
    display: none !important;
}

body.logged-out .app-main {
    max-width: 100% !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-container {
    width: 100vw;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #1b231f 0%, #121316 100%);
    padding: 1.5rem;
}

.login-card {
    background: rgba(28, 29, 34, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.login-logo h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.login-logo h1 span {
    color: var(--primary);
}

.login-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

/* --- Role Badges and User Table --- */
.badge.role-admin {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.badge.role-projektmanager {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.badge.role-monteur {
    background: rgba(16, 185, 129, 0.15);
    color: var(--status-completed);
}

/* --- Global Footer & Privacy Modal --- */
.app-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    padding: 1.25rem 2rem;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    background: rgba(28, 29, 34, 0.5);
    font-size: 0.82rem;
    color: var(--text-muted);
}

.app-footer a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

.app-footer a:hover {
    color: var(--text-main);
    text-decoration: underline;
}

body.logged-out .app-footer {
    display: none !important;
}

/* Adjustments for login page flex alignment */
body.logged-out #view-login {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

/* Privacy policy editor styling */
.privacy-edit-form textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* --- Toast Notification System --- */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 9999;
    pointer-events: none;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary);
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-lg);
    padding: 0.85rem 1.25rem;
    color: var(--text-main);
    font-size: 0.9rem;
    font-family: var(--font-family);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 320px;
    max-width: 450px;
    animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    cursor: pointer;
    transition: all 0.2s ease;
    pointer-events: auto;
}

.toast:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.toast.success {
    border-left-color: #10b981;
}

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

.toast.warning {
    border-left-color: #f59e0b;
}

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

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.toast.fade-out {
    animation: toastOut 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
}

/* --- Backup List & Settings Modal Styles --- */
.settings-section-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    border-radius: var(--border-radius-md);
    margin-bottom: 1.5rem;
}

.settings-section-card h4 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    color: var(--primary-hover);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.05rem;
    font-weight: 600;
}

.backup-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 0.75rem 1rem;
    transition: all var(--transition-speed) ease;
}

.backup-item:hover {
    border-color: var(--primary);
    background: var(--bg-hover);
}

.backup-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.backup-icon {
    color: var(--primary);
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.backup-icon i {
    width: 20px;
    height: 20px;
}

.backup-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.backup-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.backup-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.backup-actions {
    display: flex;
    gap: 0.5rem;
}

.backup-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.backup-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
}

.backup-btn.btn-restore:hover {
    color: #10b981;
    border-color: #10b981;
}

.backup-btn.btn-delete:hover {
    color: var(--danger);
    border-color: var(--danger);
}


