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

:root {
    --primary-color: #6366f1;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);

    /* Icon-Farben nach Bereich */
    --icon-dashboard: #7c3aed;
    --icon-projects: #0cb981;
    --icon-clients: #f59e0a;
    --icon-tracking: #6266f1;
    --icon-reports: #ef4344;
    --icon-cloud: #15b8a6;
}

/* Icon-Farbklassen */
.icon-dashboard { color: var(--icon-dashboard) !important; }
.icon-projects { color: var(--icon-projects) !important; }
.icon-clients { color: var(--icon-clients) !important; }
.icon-tracking { color: var(--icon-tracking) !important; }
.icon-reports { color: var(--icon-reports) !important; }
.icon-cloud { color: var(--icon-cloud) !important; }

/* Navigation-Icons im aktiven Zustand weiß */
.nav-link.active [class^="icon-"],
.nav-link.active [class*=" icon-"] {
    color: white !important;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Screen & View Management */
.screen {
    display: none !important;
}

.screen.active {
    display: block !important;
}

#loginScreen.active {
    display: flex !important;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

/* Login Screen */
#loginScreen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
}

.login-container {
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-logo {
    text-align: center;
    margin-bottom: 1rem;
}

.login-logo-img {
    width: 64px;
    height: 64px;
}

.login-container h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.login-container .form-group label {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.login-container .form-control {
    background-color: #fff;
}

.btn-login {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 10px;
    margin-top: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.3);
}

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

.info-text {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--secondary-color);
}

/* Navigation */
.navbar {
    background: var(--card-bg);
    padding: 1rem 2rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 2rem;
    position: fixed;
    top: 0;
    left: 72px;
    right: 0;
    z-index: 100;
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-logo {
    height: 44px;
    width: auto;
    flex-shrink: 0;
}

.nav-menu {
    display: flex;
    gap: 0.5rem;
    flex: 1;
}

/* Search button: hidden on desktop, visible in mobile burger menu */
.nav-search-mobile {
    display: none !important;
}

.nav-link {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--text-color);
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    vertical-align: middle;
    position: relative;
    top: -1px;
}

.container h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.container h2 svg,
.view-header h2 svg {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

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

.nav-link.active {
    background: var(--primary-color);
    color: white;
}

.nav-page-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin-right: auto;
}

.nav-page-title svg {
    width: 24px;
    height: 24px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-action-btn {
    display: none;
}

.nav-action-btn.active {
    display: inline-flex;
}

/* External Links Floating Widget */
/* Stopwatch Floating Action Button */
/* Hide floating buttons when not logged in */
body:not(:has(#mainScreen.active)) .stopwatch-fab,
body:not(:has(#mainScreen.active)) .ext-links-widget {
    display: none !important;
}

.stopwatch-fab {
    position: fixed;
    right: 1.25rem;
    bottom: 5.5rem;
    z-index: 150;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--success-color);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
    transition: transform 0.2s, box-shadow 0.2s, width 0.2s, border-radius 0.2s;
}

.stopwatch-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.45);
}

.stopwatch-fab svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.stopwatch-fab-time {
    display: none;
}

.stopwatch-fab.running {
    width: auto;
    border-radius: 24px;
    padding: 0 1rem;
    gap: 0.5rem;
    animation: stopwatchFabPulse 2s ease-in-out infinite;
}

.stopwatch-fab.running .stopwatch-fab-time {
    display: inline;
    font-size: 0.85rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

@keyframes stopwatchFabPulse {
    0%, 100% { box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35); }
    50% { box-shadow: 0 4px 20px rgba(16, 185, 129, 0.55); }
}

.ext-links-widget {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 150;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.ext-links-toggle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    transition: transform 0.2s, box-shadow 0.2s;
    order: 2;
}

.ext-links-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.45);
}

.ext-links-toggle svg {
    width: 20px;
    height: 20px;
}

.ext-links-panel {
    display: none;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    margin-bottom: 0.75rem;
    min-width: 200px;
    max-width: 280px;
    order: 1;
    opacity: 0;
    transform: translateY(10px);
}

.ext-links-panel.active {
    display: block;
    animation: extLinksPanelIn 0.2s ease forwards;
}

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

.ext-links-panel-header {
    padding: 0.6rem 1rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.ext-links-panel-body {
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ext-links-panel-body:empty::after {
    content: 'Keine Links vorhanden';
    padding: 0.75rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.nav-external-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    color: white;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.nav-external-link:hover {
    transform: scale(1.03);
    opacity: 0.9;
}

.nav-external-link svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Search Trigger in Navbar */
.nav-search-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    background: var(--bg-color);
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: border-color 0.2s, background 0.2s;
    flex-shrink: 0;
}

.nav-search-trigger:hover {
    border-color: var(--primary-color);
    background: var(--card-bg);
}

.nav-search-trigger svg {
    width: 15px;
    height: 15px;
}

.nav-search-trigger span {
    opacity: 0.6;
}

.nav-search-trigger kbd {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
    font-size: 0.7rem;
    font-family: inherit;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

/* Spotlight Search Modal */
.spotlight-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 10000;
    justify-content: center;
    align-items: flex-start;
    padding-top: 18vh;
}

.spotlight-overlay.active {
    display: flex;
    animation: spotlightFadeIn 0.15s ease-out;
}

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

.spotlight-modal {
    width: 620px;
    max-width: 90vw;
    background: var(--card-bg);
    border-radius: 14px;
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.08);
    overflow: hidden;
    animation: spotlightSlideIn 0.15s ease-out;
}

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

.spotlight-input-wrapper {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.spotlight-input-wrapper > svg {
    width: 22px;
    height: 22px;
    color: var(--primary-color);
    flex-shrink: 0;
}

.spotlight-input-wrapper input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1.15rem;
    color: var(--text-color);
    outline: none;
}

.spotlight-input-wrapper input::placeholder {
    color: var(--text-muted);
}

.spotlight-input-wrapper kbd {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 0.15rem 0.5rem;
    font-size: 0.7rem;
    font-family: inherit;
    color: var(--text-muted);
    flex-shrink: 0;
}

.spotlight-results {
    max-height: 420px;
    overflow-y: auto;
}

.spotlight-results:empty {
    display: none;
}

.spotlight-results-empty {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.spotlight-results-group {
    padding: 0.5rem 0;
}

.spotlight-results-group + .spotlight-results-group {
    border-top: 1px solid var(--border-color);
}

.spotlight-results-group-title {
    padding: 0.4rem 1.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.spotlight-result-item {
    padding: 0.6rem 1.25rem;
    cursor: pointer;
    transition: background 0.1s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.spotlight-result-item:hover,
.spotlight-result-item.selected {
    background: var(--primary-color);
    color: #fff;
}

.spotlight-result-item:hover .result-title,
.spotlight-result-item.selected .result-title {
    color: #fff;
}

.spotlight-result-item:hover .result-subtitle,
.spotlight-result-item.selected .result-subtitle {
    color: rgba(255, 255, 255, 0.7);
}

.spotlight-result-item:hover svg,
.spotlight-result-item.selected svg {
    color: rgba(255, 255, 255, 0.8);
}

.spotlight-result-item svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.spotlight-file-icon {
    color: var(--warning-color) !important;
}

.spotlight-result-item .result-info {
    flex: 1;
    min-width: 0;
}

.spotlight-result-item .result-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spotlight-result-item .result-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spotlight-result-item mark {
    background: #fef08a;
    color: inherit;
    padding: 0;
    border-radius: 2px;
}

.spotlight-result-item:hover mark,
.spotlight-result-item.selected mark {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

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

/* ========================================
   Sidebar Navigation
   ======================================== */
.sidebar {
    display: flex;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 72px;
    background: #1e293b;
    flex-direction: column;
    z-index: 200;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 72px;
    border-bottom: 1px solid #334155;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem 0.75rem;
    flex: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 10px;
    background: #334155;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-link svg {
    width: 22px;
    height: 22px;
}

.sidebar-link:hover {
    background: #475569;
    color: white;
}

.sidebar-link.active {
    background: var(--primary-color);
    color: white;
}

.sidebar-footer {
    padding: 1rem 0.75rem;
    border-top: 1px solid #334155;
}

.sidebar-footer .sidebar-link {
    background: transparent;
    color: #94a3b8;
}

.sidebar-footer .sidebar-link:hover {
    background: #334155;
    color: #ef4444;
}

/* Desktop: Sidebar immer sichtbar, Top-Menu versteckt */
.navbar .nav-menu {
    display: none !important;
}

.navbar .nav-brand {
    display: none;
}

.navbar {
    justify-content: flex-end;
}

/* Content unter fixed navbar positionieren */
.view {
    padding-top: 72px;
}

.view .container,
#projectDetailView .container,
#clientDetailView .container {
    margin-left: 72px;
    max-width: calc(100% - 72px);
}

/* Burger Menu Button */
.burger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
}

.burger-menu span {
    display: block;
    width: 100%;
    height: 3px;
    background: var(--text-color);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.burger-menu.active span:nth-child(1) {
    transform: translateY(8.5px) rotate(45deg);
}

.burger-menu.active span:nth-child(2) {
    opacity: 0;
}

.burger-menu.active span:nth-child(3) {
    transform: translateY(-8.5px) rotate(-45deg);
}

/* Container & Layout */
.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 2rem;
    padding-right: 5rem;
}

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

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

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

.card h3 svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.card-header-with-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

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

.btn-icon {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

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

.btn-icon svg {
    width: 18px;
    height: 18px;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-color);
}

.form-group label input[type="checkbox"] {
    margin-right: 0.5rem;
    width: auto;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.9rem;
    background-color: var(--bg-color);
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.form-control:hover {
    border-color: #cbd5e1;
    background-color: #fff;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1), inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.form-control::placeholder {
    color: #94a3b8;
}

.form-control[readonly] {
    background-color: var(--bg-color);
    cursor: not-allowed;
    opacity: 0.7;
}

/* Select styling */
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

/* Textarea styling */
textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* Buttons */
.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: #1d4ed8;
}

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

.btn-secondary:hover {
    background: #475569;
}

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

.btn-success:hover {
    background: #059669;
}

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

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

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

/* Stopwatch */
.stopwatch-container {
    text-align: center;
}

.stopwatch-display {
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 2rem 0;
    font-variant-numeric: tabular-nums;
}

.stopwatch-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.stopwatch-controls .form-control {
    max-width: 300px;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

thead {
    background: var(--bg-color);
}

th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
}

td {
    padding: 0.75rem;
    vertical-align: middle;
}

tr {
    min-height: 48px;
    border-bottom: 1px solid var(--border-color);
}

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

.action-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    min-height: 32px;
}

#entriesTable .action-buttons,
#projectsTable .action-buttons,
#clientsTable .action-buttons,
#tasksTable .action-buttons,
#archivedProjectsTable .action-buttons,
#archivedClientsTable .action-buttons,
#archivedTasksTable .action-buttons,
#archiveClientsTable .action-buttons,
#archiveProjectsTable .action-buttons,
#archiveTasksTable .action-buttons {
    flex-direction: column;
    align-items: stretch;
}

/* Export Buttons */
.export-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Report Summary */
.report-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.summary-item {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}

.summary-label {
    font-size: 0.875rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.summary-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.summary-value-success {
    color: var(--success-color);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    animation: fadeIn 0.2s;
    overflow-y: auto;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s;
}

.modal-content.modal-large {
    max-width: 900px;
}

.modal-content h2 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.modal-close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    cursor: pointer;
    color: var(--secondary-color);
    line-height: 1;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

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

.modal select[multiple] {
    padding: 0.5rem;
}

.modal select[multiple] option {
    padding: 0.5rem;
    margin: 0.25rem 0;
    border-radius: 4px;
}

.modal select[multiple] option:checked {
    background: var(--primary-color);
    color: white;
}

.modal small {
    display: block;
    margin-top: 0.5rem;
    color: var(--secondary-color);
    font-size: 0.75rem;
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-secondary {
    background: #e5e7eb;
    color: #4b5563;
}

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

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

/* Responsive */
@media (max-width: 768px) {
    /* Sidebar auf Mobile ausblenden */
    .sidebar {
        display: none;
    }

    /* Navbar zurücksetzen für Mobile */
    .navbar {
        padding: 1rem;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        justify-content: space-between;
    }

    .navbar .nav-brand {
        display: flex;
        flex: 1;
    }

    .nav-page-title {
        display: none;
    }

    .nav-search-trigger {
        display: none;
    }

    .nav-actions {
        display: none;
    }

    /* View padding für Mobile */
    .view {
        padding-top: 60px;
    }

    .burger-menu {
        display: flex;
        position: relative;
        z-index: 1001;
    }

    .burger-menu.active {
        position: fixed;
        top: 1rem;
        right: 1rem;
    }

    .navbar .nav-menu {
        display: none !important;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100vh;
        background: var(--card-bg);
        z-index: 1000;
        padding: 5rem 1.5rem 2rem;
        overflow-y: auto;
    }

    .navbar .nav-menu.active {
        display: flex !important;
    }

    .nav-search-mobile {
        display: flex !important;
        color: var(--primary-color);
    }

    .nav-link {
        width: 100%;
        justify-content: flex-start;
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-link:last-child {
        border-bottom: none;
    }

    .nav-user {
        display: none;
        width: 100%;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--card-bg);
        padding: 1.5rem;
        border-top: 1px solid var(--border-color);
        flex-direction: column;
        gap: 0.75rem;
        z-index: 1000;
    }

    .nav-user.active {
        display: flex;
    }

    .nav-user #currentUser {
        font-size: 0.875rem;
        color: var(--secondary-color);
        text-align: center;
    }

    .nav-user #logoutBtn {
        width: 100%;
    }

    /* Container margins für Mobile zurücksetzen */
    .container,
    .view .container,
    #projectDetailView .container,
    #clientDetailView .container {
        padding: 1rem;
        margin-left: 0;
        max-width: 100%;
    }

    /* View Header */
    .view-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .view-header h2 {
        font-size: 1.25rem;
    }

    .view-header .btn {
        width: 100%;
    }

    /* Stoppuhr */
    .stopwatch-display {
        font-size: 2.5rem;
        margin: 1rem 0;
    }

    .stopwatch-controls {
        flex-direction: column;
        gap: 0.75rem;
    }

    .stopwatch-controls .form-control {
        max-width: 100%;
        width: 100%;
    }

    .stopwatch-controls .btn {
        width: 100%;
    }

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

    .form-group {
        margin-bottom: 0.75rem;
    }

    .form-control {
        font-size: 16px; /* Verhindert Zoom auf iOS */
    }

    /* Filter-Bereiche */
    .filters,
    .entries-filter {
        margin-bottom: 1rem;
    }

    .filters .form-group,
    .entries-filter .form-group {
        margin-bottom: 0.5rem;
    }

    .export-buttons {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .export-buttons .btn {
        width: 100%;
    }

    /* Buttons */
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .btn-sm {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    .action-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }

    .action-buttons .btn {
        width: 100%;
    }

    /* Cards */
    .card {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .card h3 {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

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

    .telefon-tabs,
    .project-detail-tabs,
    .lexware-tabs,
    .sevdesk-tabs,
    .billomat-tabs,
    .robo-tabs {
        gap: 0;
    }

    .telefon-tab,
    .project-detail-tab,
    .client-detail-tab,
    .lexware-tab,
    .sevdesk-tab,
    .billomat-tab,
    .robo-tab {
        padding: 0.6rem 0.75rem;
        font-size: 0.8rem;
    }

    .clients-grid,
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .detail-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .detail-header .btn {
        width: 100%;
    }

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

    .detail-title h2 {
        font-size: 1.25rem;
    }

    .info-grid {
        grid-template-columns: 1fr !important;
    }

    /* Summary Cards */
    .dashboard-summary {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .summary-card {
        padding: 1rem;
    }

    .summary-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Charts */
    .charts-container {
        grid-template-columns: 1fr !important;
    }

    .chart-card {
        min-height: 250px;
    }

    /* Pagination */
    .pagination {
        flex-direction: column;
        gap: 0.75rem;
    }

    .pagination .btn {
        width: 100%;
    }

    /* Bulk Actions */
    .bulk-actions {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .bulk-actions input {
        width: 100% !important;
    }

    .bulk-actions .btn {
        width: 100%;
    }

    /* Responsive Tabellen - Card Layout */
    .table-responsive {
        overflow-x: visible;
    }

    table.mobile-cards,
    .table-responsive table {
        display: block;
    }

    table.mobile-cards thead,
    .table-responsive thead {
        display: none;
    }

    table.mobile-cards tbody,
    .table-responsive tbody {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    table.mobile-cards tr,
    .table-responsive tr {
        display: flex;
        flex-direction: column;
        background: var(--card-bg);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 1rem;
        gap: 0.5rem;
    }

    table.mobile-cards tr:hover,
    .table-responsive tr:hover {
        background: var(--card-bg);
    }

    table.mobile-cards td,
    .table-responsive td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        padding: 0.25rem 0;
        border: none;
        font-size: 0.875rem;
    }

    table.mobile-cards td::before,
    .table-responsive td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--secondary-color);
        flex-shrink: 0;
        margin-right: 1rem;
        font-size: 0.75rem;
        text-transform: uppercase;
    }

    table.mobile-cards td:last-child,
    .table-responsive td:last-child {
        border-top: 1px solid var(--border-color);
        padding-top: 0.75rem;
        margin-top: 0.5rem;
    }

    table.mobile-cards td:last-child::before,
    .table-responsive td:last-child::before {
        display: none;
    }

    table.mobile-cards .action-buttons,
    .table-responsive .action-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-end;
        width: 100%;
    }

    table.mobile-cards .action-buttons .btn,
    .table-responsive .action-buttons .btn {
        width: auto;
        flex: 1;
        min-width: 80px;
    }

    /* Checkbox in Tabellen */
    table.mobile-cards td:first-child input[type="checkbox"],
    .table-responsive td:first-child input[type="checkbox"] {
        width: 20px;
        height: 20px;
    }

    /* File Manager Mobile */
    .file-manager-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

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

    .file-manager-actions .btn {
        flex: 1;
    }

    .file-list {
        gap: 0.5rem;
    }

    .file-item {
        padding: 0.75rem;
    }

    /* Modal Mobile */
    .modal-content {
        width: 95%;
        max-width: none;
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }

    /* Budget Übersicht */
    .budget-breakdown {
        flex-direction: column;
        gap: 0.5rem;
    }

    .add-deduction-form .form-row {
        gap: 0.5rem;
    }
}

/* Hide admin elements for non-admin users */
body:not(.is-admin) .admin-only {
    display: none !important;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin: 4px 0;
}

.progress-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.progress-success {
    background: #10b981;
}

.progress-warning {
    background: #f59e0b;
}

.progress-danger {
    background: #ef4444;
}

/* Links in tables */
table a {
    color: var(--primary-color);
    text-decoration: none;
}

table a:hover {
    text-decoration: underline;
}

table small {
    color: var(--secondary-color);
    font-size: 0.75rem;
}

/* Dashboard Styles */
.dashboard-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
}

.summary-card .summary-label {
    font-size: 1rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.summary-card .summary-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Dashboard Overview Cards */
.dashboard-overview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.overview-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem;
    border-radius: 12px;
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.overview-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.overview-card:active {
    transform: translateY(-2px);
}

.overview-card-tracking {
    background: linear-gradient(135deg, var(--icon-tracking), #818cf8);
}

.overview-card-clients {
    background: linear-gradient(135deg, var(--icon-clients), #fbbf24);
}

.overview-card-projects {
    background: linear-gradient(135deg, var(--icon-projects), #34d399);
}

.overview-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    flex-shrink: 0;
}

.overview-card-icon svg {
    width: 28px;
    height: 28px;
    color: white;
}

.overview-card-content {
    flex: 1;
}

.overview-card-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

.overview-card-label {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-top: 0.25rem;
}

@media (max-width: 900px) {
    .dashboard-overview {
        grid-template-columns: 1fr;
    }
}

.charts-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.chart-card {
    min-height: 400px;
}

.chart-card canvas {
    max-height: 350px;
}

.chart-card-full {
    width: 100%;
    margin-top: 1.5rem;
}

.chart-card-full h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-card-full h3 svg {
    width: 24px;
    height: 24px;
}

.project-chart-container {
    position: relative;
}

.budget-chart-container {
    min-height: 300px;
    position: relative;
}

.acquisition-chart-container {
    min-height: 150px;
    position: relative;
}

/* Billing Status */
.billing-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.billing-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.invoice-input {
    width: 120px;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.invoice-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.invoice-number {
    font-size: 0.75rem;
    color: var(--secondary-color);
    background: var(--bg-color);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Bulk Actions */
.bulk-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 8px;
}

/* Entry Selection */
.entry-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Responsive Charts */
@media (max-width: 900px) {
    .charts-container {
        grid-template-columns: 1fr;
    }

    .chart-card {
        min-height: 300px;
    }
}

/* Detail Views */
.detail-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #374151;
}

.detail-title {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.detail-title h2 {
    margin: 0;
    font-size: 1.75rem;
}

/* Detail Tabs (Project, Client, Telefon, Lexware, sevDesk, Billomat, Roborechnung) */
.telefon-tabs,
.project-detail-tabs,
.client-detail-tabs,
.lexware-tabs,
.sevdesk-tabs,
.billomat-tabs,
.robo-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 1.5rem;
}

.telefon-tab,
.project-detail-tab,
.client-detail-tab,
.lexware-tab,
.sevdesk-tab,
.billomat-tab,
.robo-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    color: #6b7280;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s, border-color 0.2s;
}

.telefon-tab:hover,
.project-detail-tab:hover,
.client-detail-tab:hover,
.lexware-tab:hover,
.sevdesk-tab:hover,
.billomat-tab:hover,
.robo-tab:hover {
    color: var(--primary-color);
    background-color: rgba(99, 102, 241, 0.05);
}

.telefon-tab.active,
.project-detail-tab.active,
.client-detail-tab.active,
.lexware-tab.active,
.sevdesk-tab.active,
.billomat-tab.active,
.robo-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.telefon-tab svg,
.project-detail-tab svg,
.client-detail-tab svg,
.lexware-tab svg,
.sevdesk-tab svg,
.billomat-tab svg,
.robo-tab svg {
    width: 18px;
    height: 18px;
}

.telefon-tab-content,
.project-detail-tab-content,
.client-detail-tab-content,
.lexware-tab-content,
.sevdesk-tab-content,
.billomat-tab-content,
.robo-tab-content {
    display: none;
}

.telefon-tab-content.active,
.project-detail-tab-content.active,
.client-detail-tab-content.active,
.lexware-tab-content.active,
.sevdesk-tab-content.active,
.billomat-tab-content.active,
.robo-tab-content.active {
    display: block;
}

/* View Toggle (Grid/List) */
.view-toggle {
    display: flex;
    justify-content: flex-end;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.view-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-secondary);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.15s;
}

.view-toggle-btn:hover {
    background: var(--bg-color);
    color: var(--text-color);
}

.view-toggle-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.view-toggle-btn svg {
    width: 18px;
    height: 18px;
}

/* List Views */
.clients-list,
.projects-list {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    overflow: hidden;
}

.clients-list table,
.projects-list table {
    margin: 0;
}

.clients-list tbody tr,
.projects-list tbody tr {
    cursor: pointer;
    transition: background 0.15s;
}

.clients-list tbody tr:hover,
.projects-list tbody tr:hover {
    background: var(--bg-color);
}

.clients-list tbody tr:last-child,
.projects-list tbody tr:last-child {
    border-bottom: none;
}

/* Client Cards Grid */
.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1rem;
}

.client-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.25rem;
    cursor: pointer;
    transition: box-shadow 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.client-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-color);
}

.client-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.color-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
    flex-shrink: 0;
}

.client-card-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
}

.client-card-number {
    font-size: 0.75rem;
    color: #9ca3af;
    background: #f3f4f6;
    padding: 0.15rem 0.5rem;
    border-radius: 0.25rem;
    white-space: nowrap;
}

.client-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.client-card-contact,
.client-card-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #4b5563;
}

.client-card-contact svg,
.client-card-info svg {
    width: 15px;
    height: 15px;
    color: #9ca3af;
    flex-shrink: 0;
}

.client-card-info a {
    color: var(--primary-color);
    text-decoration: none;
}

.client-card-info a:hover {
    text-decoration: underline;
}

.client-card-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid #f3f4f6;
    flex-wrap: wrap;
}

.client-card-stat {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    color: #6b7280;
}

.client-card-stat svg {
    width: 14px;
    height: 14px;
}

.client-card-link {
    display: flex;
    align-items: center;
    color: #9ca3af;
    transition: color 0.2s;
}

.client-card-link:hover {
    color: var(--primary-color);
}

.client-card-link svg {
    width: 16px;
    height: 16px;
}

.client-card-actions {
    display: flex;
    gap: 0.4rem;
    padding-top: 0.5rem;
    border-top: 1px solid #f3f4f6;
}

.client-card-actions .btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.client-card-actions .btn svg {
    width: 15px;
    height: 15px;
}

/* Project Cards Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1rem;
}

.project-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.25rem;
    cursor: pointer;
    transition: box-shadow 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.project-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-color);
}

.project-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.project-card-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
}

.project-card-client {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 0.2rem;
}

.project-card-client svg {
    width: 14px;
    height: 14px;
}

.project-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.project-card-stats {
    display: flex;
    gap: 1rem;
}

.project-card-stat {
    display: flex;
    flex-direction: column;
}

.project-card-stat-value {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
}

.project-card-stat-label {
    font-size: 0.7rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.project-card-budget {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.project-card-budget-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #6b7280;
}

.project-card-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid #f3f4f6;
}

.project-card-info {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    color: #6b7280;
}

.project-card-info svg {
    width: 14px;
    height: 14px;
}

.project-card-link {
    display: flex;
    align-items: center;
    color: #9ca3af;
    transition: color 0.2s;
}

.project-card-link:hover {
    color: var(--primary-color);
}

.project-card-link svg {
    width: 16px;
    height: 16px;
}

.project-card-actions {
    display: flex;
    gap: 0.4rem;
    padding-top: 0.5rem;
    border-top: 1px solid #f3f4f6;
}

.project-card-actions .btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-card-actions .btn svg {
    width: 15px;
    height: 15px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.detail-info,
.detail-budget,
.detail-summary {
    height: fit-content;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

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

.info-item.full-width {
    grid-column: span 2;
}

.info-item label {
    font-size: 0.75rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-item span {
    font-size: 1rem;
    color: #1f2937;
}

.info-item a {
    color: #60a5fa;
    text-decoration: none;
}

.info-item a:hover {
    text-decoration: underline;
}

/* Budget Summary */
.budget-summary {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.budget-progress-large .progress-bar {
    height: 1.5rem;
    border-radius: 0.5rem;
}

.budget-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

.budget-breakdown {
    display: flex;
    gap: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #374151;
}

.breakdown-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.breakdown-label {
    font-size: 0.75rem;
    color: #9ca3af;
}

.breakdown-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #10b981;
}

.breakdown-value.deduction {
    color: #f59e0b;
}

/* Summary Grid */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    text-align: center;
}

.summary-item .summary-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #10b981;
}

.summary-item .summary-label {
    font-size: 0.75rem;
    color: #9ca3af;
    text-transform: uppercase;
    margin-top: 0.25rem;
}

/* Add deduction form */
.add-deduction-form {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #374151;
}

.add-deduction-form h4 {
    margin: 0 0 1rem 0;
    font-size: 0.875rem;
    color: #9ca3af;
}

/* Clickable table rows */
#projectsTable tbody tr,
#clientsTable tbody tr,
#clientDetailProjectsTable tbody tr {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

#projectsTable tbody tr:hover,
#clientsTable tbody tr:hover,
#clientDetailProjectsTable tbody tr:hover {
    background-color: #e1f5f2;
}

/* Responsive detail views */
@media (max-width: 768px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .detail-header {
        flex-wrap: wrap;
    }

    .detail-title {
        order: -1;
        width: 100%;
        margin-bottom: 0.5rem;
    }

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

    .info-item.full-width {
        grid-column: span 1;
    }

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

    .budget-breakdown {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #374151;
}

#entriesPageInfo {
    color: #9ca3af;
    font-size: 0.875rem;
}

/* Entries Filter */
.entries-filter {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #374151;
}

/* External Links Card */
.external-links-card h3 {
    margin-bottom: 1rem;
}

.external-links-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.external-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border-radius: 6px;
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.external-link-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    filter: brightness(1.1);
}

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

.external-link-btn i,
.external-link-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.text-muted {
    color: var(--secondary-color);
    font-size: 0.875rem;
}

/* ========================================
   NextCloud File Manager Styles
   ======================================== */

.file-manager-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.file-manager-header h3 {
    margin: 0;
}

.file-manager-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.file-manager-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.4rem 0.75rem;
}

.file-manager-actions .btn svg,
.file-manager-actions .btn i {
    width: 16px;
    height: 16px;
}

.file-manager-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    flex-wrap: wrap;
}

.breadcrumb-item {
    color: var(--primary-color);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background-color 0.15s;
}

.breadcrumb-item:hover {
    background-color: rgba(37, 99, 235, 0.1);
}

.breadcrumb-item:last-child {
    color: var(--text-color);
    font-weight: 500;
    cursor: default;
}

.breadcrumb-item:last-child:hover {
    background-color: transparent;
}

.breadcrumb-separator {
    color: var(--secondary-color);
    font-size: 0.75rem;
}

.file-manager-content {
    min-height: 200px;
    position: relative;
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s;
    gap: 0.75rem;
}

.file-item:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.file-item.selected {
    background-color: rgba(37, 99, 235, 0.1);
}

.file-item-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-item-icon svg,
.file-item-icon i {
    width: 24px;
    height: 24px;
}

.file-item-icon.folder {
    color: #f59e0b;
}

.file-item-icon.file {
    color: var(--secondary-color);
}

.file-item-icon.image {
    color: #8b5cf6;
}

.file-item-icon.document {
    color: #2563eb;
}

.file-item-icon.spreadsheet {
    color: #10b981;
}

.file-item-icon.pdf {
    color: #ef4444;
}

.file-item-icon.archive {
    color: #6366f1;
}

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

.file-item-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-item-meta {
    font-size: 0.75rem;
    color: var(--secondary-color);
    display: flex;
    gap: 1rem;
}

.file-item-actions {
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.15s;
}

.file-item:hover .file-item-actions {
    opacity: 1;
}

.file-item-actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.file-item-actions .btn svg,
.file-item-actions .btn i {
    width: 14px;
    height: 14px;
}

.file-manager-loading,
.file-manager-empty,
.file-manager-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--secondary-color);
    text-align: center;
}

.file-manager-loading svg,
.file-manager-empty svg,
.file-manager-error svg,
.file-manager-loading i,
.file-manager-empty i,
.file-manager-error i {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.file-manager-error {
    color: var(--danger-color);
}

.upload-progress {
    margin-top: 1rem;
    padding: 1rem;
    background-color: rgba(37, 99, 235, 0.05);
    border-radius: 6px;
}

.upload-progress-bar {
    height: 6px;
    background-color: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.upload-progress-fill {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

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

/* Context Menu */
.file-context-menu {
    position: fixed;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 160px;
    padding: 0.25rem 0;
}

.file-context-menu-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.15s;
    font-size: 0.875rem;
}

.file-context-menu-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.file-context-menu-item.danger {
    color: var(--danger-color);
}

.file-context-menu-item svg,
.file-context-menu-item i {
    width: 16px;
    height: 16px;
}

.file-context-menu-separator {
    height: 1px;
    background-color: var(--border-color);
    margin: 0.25rem 0;
}

/* Folder Browser Modal */
.folder-browser {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin: 1rem 0;
}

.folder-browser-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.15s;
}

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

.folder-browser-item:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.folder-browser-item.selected {
    background-color: rgba(37, 99, 235, 0.1);
}

.folder-browser-item svg,
.folder-browser-item i {
    width: 20px;
    height: 20px;
    color: #f59e0b;
}

.folder-browser-path {
    padding: 0.5rem 1rem;
    background-color: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--secondary-color);
}

/* Modal Large */
.modal-content.modal-large {
    max-width: 800px;
    width: 90%;
}

/* PDF Lightbox */
.pdf-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    flex-direction: column;
}

.pdf-lightbox.active {
    display: flex;
}

.pdf-lightbox-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
}

.pdf-lightbox-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-color);
}

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

.pdf-lightbox-body {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.pdf-lightbox-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 100%;
    color: #fff;
    font-size: 1.1rem;
}

.pdf-lightbox-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #525659;
}

/* ============================================
   Portal Section
   ============================================ */
.detail-portal {
    border-left: 4px solid var(--primary-color);
}

.portal-description {
    color: var(--secondary-color);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.portal-status {
    margin-bottom: 1rem;
}

.portal-active {
    color: var(--success-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.portal-inactive {
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.portal-url-container {
    margin-bottom: 1rem;
}

.input-with-button {
    display: flex;
    gap: 0.5rem;
}

.input-with-button .form-control {
    flex: 1;
    background-color: var(--bg-color);
    font-family: monospace;
    font-size: 0.8rem;
}

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

/* Settings Tabs */
.settings-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0;
    flex-wrap: wrap;
}

.settings-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    color: var(--secondary-color);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-tab:hover {
    color: var(--primary-color);
    background-color: rgba(99, 102, 241, 0.05);
}

.settings-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.settings-tab svg {
    width: 18px;
    height: 18px;
}

.settings-tab-content {
    display: none;
}

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

/* Responsive Tabs */
@media (max-width: 768px) {
    .settings-tabs {
        flex-direction: column;
        border-bottom: none;
        gap: 0;
    }

    .settings-tab {
        border-bottom: none;
        border-left: 3px solid transparent;
        margin-bottom: 0;
        padding: 1rem 1.25rem;
        justify-content: flex-start;
    }

    .settings-tab.active {
        border-bottom-color: transparent;
        border-left-color: var(--primary-color);
        background-color: rgba(99, 102, 241, 0.08);
    }
}

/* API Documentation Styles */
.api-docs h4 {
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.api-docs h5 {
    color: var(--secondary-color);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.api-docs p {
    color: var(--secondary-color);
    margin-bottom: 0.75rem;
}

.code-block {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 8px;
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 0.85rem;
    overflow-x: auto;
    white-space: pre;
    line-height: 1.5;
}

.api-endpoint {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    background: #fafafa;
}

.api-endpoint h5 {
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

/* Chart Total Styles */
.chart-total {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 8px;
}

/* ========================================
   SIPGATE TELEPHONY STYLES
   ======================================== */

/* Click-to-Call Button */
.btn-call {
    background: var(--success-color);
    color: white;
    margin-left: 0.5rem;
    padding: 0.25rem 0.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    vertical-align: middle;
}

.btn-call:hover {
    background: #059669;
}

.btn-call svg,
.btn-call i {
    width: 14px;
    height: 14px;
}

/* Incoming Call Modal */
.incoming-call-modal {
    z-index: 10001;
}

.incoming-call-content {
    max-width: 350px;
    animation: slideInRight 0.3s ease;
    padding: 0;
    overflow: hidden;
}

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

.incoming-call-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--success-color);
    color: white;
}

.incoming-call-header span {
    font-weight: 600;
    font-size: 1rem;
}

.call-icon-animated {
    animation: ring 0.5s ease infinite;
    width: 24px;
    height: 24px;
}

@keyframes ring {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-15deg);
    }
    75% {
        transform: rotate(15deg);
    }
}

.incoming-call-body {
    padding: 1.5rem;
}

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

.caller-info strong {
    display: block;
    font-size: 1.25rem;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.caller-info span {
    color: var(--secondary-color);
    font-size: 0.95rem;
}

.incoming-call-actions {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    background: #fafafa;
}

.incoming-call-actions .btn {
    flex: 1;
}

/* Call Direction Icons */
.call-direction-in {
    color: var(--success-color);
}

.call-direction-out {
    color: var(--primary-color);
}

/* Call Status Badges */
.badge-info {
    background-color: #0ea5e9;
    color: white;
}

/* Call Logs Table */
#sipgateCallLogsTable td {
    vertical-align: middle;
}

#sipgateCallLogsTable .call-direction-in,
#sipgateCallLogsTable .call-direction-out {
    width: 18px;
    height: 18px;
}

/* Highlighted Table Row */
.table-row-highlight {
    background-color: rgba(16, 185, 129, 0.1) !important;
}

/* Devices Table */
#sipgateDevicesTable code {
    background: #e2e8f0;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* ========== CONTACTS (Ansprechpartner) ========== */

.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.contact-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    position: relative;
    transition: box-shadow 0.2s;
}

.contact-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.contact-card.contact-primary {
    border-color: var(--primary-color);
    border-width: 2px;
}

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

.contact-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-color);
}

.contact-position {
    font-size: 0.85rem;
    color: var(--secondary-color);
    margin-top: 0.15rem;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.contact-details .detail-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--secondary-color);
}

.contact-details .detail-row svg,
.contact-details .detail-row i {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.contact-details a {
    color: var(--primary-color);
    text-decoration: none;
}

.contact-details a:hover {
    text-decoration: underline;
}

.contact-notes {
    font-size: 0.85rem;
    color: var(--secondary-color);
    font-style: italic;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: #f8fafc;
    border-radius: 4px;
}

.contact-actions {
    display: flex;
    gap: 0.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
}

.contact-actions .btn {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
}

.badge-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background-color: var(--primary-color);
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.contacts-empty {
    text-align: center;
    padding: 2rem;
    color: var(--secondary-color);
}

/* ========================================
   LEXWARE INTEGRATION STYLES
   ======================================== */

/* Match Table Action Buttons */
#lexwareMatchTable .action-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* Invoice Group Cards */
#lexwareInvoiceGroups .card {
    transition: box-shadow 0.2s;
}

#lexwareInvoiceGroups .card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Responsive */
@media (max-width: 768px) {
    #lexwareMatchTable .action-buttons {
        flex-direction: column;
        gap: 0.25rem;
    }
}

/* ========================================
   SEVDESK INTEGRATION STYLES
   ======================================== */

/* Match Table Action Buttons */
#sevdeskMatchTable .action-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* Invoice Group Cards */
#sevdeskInvoiceGroups .card {
    transition: box-shadow 0.2s;
}

#sevdeskInvoiceGroups .card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Responsive */
@media (max-width: 768px) {
    #sevdeskMatchTable .action-buttons {
        flex-direction: column;
        gap: 0.25rem;
    }
}

/* ========================================
   BILLOMAT INTEGRATION STYLES
   ======================================== */

/* Match Table Action Buttons */
#billomatMatchTable .action-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* Invoice Group Cards */
#billomatInvoiceGroups .card {
    transition: box-shadow 0.2s;
}

#billomatInvoiceGroups .card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Document Table Action Buttons */
#billomatInvoicesTable .action-buttons,
#billomatOffersTable .action-buttons,
#billomatCreditNotesTable .action-buttons,
#billomatRemindersTable .action-buttons,
#billomatArticlesTable .action-buttons {
    display: flex;
    gap: 0.25rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 768px) {
    #billomatMatchTable .action-buttons,
    #billomatInvoicesTable .action-buttons,
    #billomatOffersTable .action-buttons,
    #billomatArticlesTable .action-buttons {
        flex-direction: column;
        gap: 0.25rem;
    }
}

/* ========== REMINDERS ========== */

/* Bell icon in navbar */
.nav-reminder-bell {
    position: relative;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    color: #6b7280;
    transition: color 0.2s;
}

.nav-reminder-bell:hover {
    color: var(--primary-color);
}

.reminder-badge {
    position: absolute;
    top: 2px;
    right: 0;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 600;
    min-width: 17px;
    height: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Dropdown */
.reminder-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: -80px;
    width: 380px;
    max-height: 450px;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    display: none;
    z-index: 1000;
    overflow: hidden;
}

.reminder-dropdown.active {
    display: flex;
    flex-direction: column;
}

.reminder-dropdown-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.reminder-dropdown-header .btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0;
}

.reminder-dropdown-header .btn-link:hover {
    text-decoration: underline;
}

.reminder-dropdown-list {
    overflow-y: auto;
    max-height: 380px;
}

.reminder-dropdown-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: #9ca3af;
    font-size: 0.9rem;
}

.reminder-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s;
}

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

.reminder-dropdown-item:hover {
    background: #f9fafb;
}

.reminder-dropdown-item-content {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.reminder-dropdown-item .reminder-title {
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reminder-dropdown-item .reminder-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.78rem;
    color: #6b7280;
    margin-top: 0.15rem;
}

.reminder-dropdown-item .reminder-meta span {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.reminder-dropdown-item.overdue .reminder-meta {
    color: var(--danger-color);
}

.reminder-dropdown-item.overdue .reminder-title {
    color: var(--danger-color);
}

.reminder-complete-btn {
    flex-shrink: 0;
}

/* Reminder cards in detail views */
.reminders-empty {
    padding: 1.5rem;
    text-align: center;
    color: #9ca3af;
    font-size: 0.9rem;
}

.reminders-list {
    display: flex;
    flex-direction: column;
}

.reminder-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.reminder-card:last-child {
    border-bottom: none;
}

.reminder-card.completed {
    opacity: 0.5;
}

.reminder-card.completed .reminder-card-title {
    text-decoration: line-through;
}

.reminder-card.overdue .reminder-card-title {
    color: var(--danger-color);
}

.reminder-card.overdue .reminder-card-meta {
    color: var(--danger-color);
}

.reminder-card-content {
    flex: 1;
    min-width: 0;
}

.reminder-card-title {
    font-weight: 500;
    font-size: 0.95rem;
}

.reminder-card-desc {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 0.15rem;
}

.reminder-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.reminder-card-meta span {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.reminder-card-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

.reminders-completed-list.hidden {
    display: none;
}

.rotate-180 {
    transform: rotate(180deg);
}

/* Responsive */
@media (max-width: 768px) {
    .reminder-dropdown {
        right: -20px;
        width: 320px;
    }

    .reminder-card {
        flex-direction: column;
        gap: 0.5rem;
    }

    .reminder-card-actions {
        align-self: flex-end;
    }
}
