/* 
  Tupiano Support System CSS
  Premium, modern design with glassmorphism and smooth animations.
*/

:root {
    /* Colors - Dark Mode Base */
    --bg-dark: #22201d;
    --bg-darker: #1a1816;
    --surface-light: rgba(43, 40, 36, 0.7);
    --surface-border: rgba(255, 255, 255, 0.08);
    --surface-hover: rgba(58, 55, 50, 0.6);
    
    /* Branding */
    --primary: #d97706;
    --primary-hover: #b45309;
    --primary-rgb: 217, 119, 6;
    --secondary: #334155;
    --secondary-hover: #475569;
    
    /* Status Colors */
    --color-open: #94a3b8;
    --color-inprogress: #f59e0b;
    --color-done: #10b981;
    --color-billed: #059669; /* Darker green */
    --billed-rgb: 5, 150, 105;
    --billed-text: #a7f3d0;
    
    --color-purple: #8b5cf6;
    --purple-rgb: 139, 92, 246;
    --purple-text: #ddd6fe;
    
    /* Typography */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    /* Structural */
    --sidebar-width: 260px;
    --border-radius-lg: 16px;
    --border-radius-md: 10px;
    --border-radius-sm: 6px;
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    
    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Light Mode Theme */
body.light-mode {
    --bg-dark: #f8fafc;
    --bg-darker: #f1f5f9;
    --surface-light: rgba(255, 255, 255, 0.9);
    --surface-border: rgba(0, 0, 0, 0.1);
    --surface-hover: rgba(241, 245, 249, 0.8);
    
    --text-main: #1e293b;
    --text-muted: #64748b;
    
    --primary: #1e293b; /* Matched to dark slate tone of the sidebar buttons */
    --primary-hover: #0f172a;
    --primary-rgb: 51, 65, 85;
    --color-billed: #166534; /* Darker green for light mode */
    --billed-rgb: 5, 150, 105;
    --billed-text: #6ee7b7;
    
    --color-purple: #7c3aed;
    --purple-rgb: 124, 58, 237;
    --purple-text: #c4b5fd;
    
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(var(--primary-rgb), 0.05), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(var(--billed-rgb), 0.05), transparent 25%);
}

body.light-mode .modern-input {
    background-color: #ffffff;
    color: var(--text-main);
    border: 1px solid #cbd5e1;
}

body.light-mode .sidebar {
    background-color: rgba(255, 255, 255, 0.8);
}

body.light-mode .top-bar {
    background-color: rgba(255, 255, 255, 0.8);
}

body.light-mode .logo {
    color: #0f172a;
}

body.light-mode .ticket-card, body.light-mode .modal-content, body.light-mode .kanban-header {
    background-color: #ffffff;
}

body.light-mode .kanban-column {
    background: rgba(248, 250, 252, 0.8);
}

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

body {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-darker);
    color: var(--text-main);
    line-height: 1.6;
    height: 100vh;
    overflow: hidden;
    /* Soft gradient background */
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(var(--primary-rgb), 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(var(--billed-rgb), 0.08), transparent 25%);
}

/* Typography Utility */
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-red { color: #ef4444; }
.text-blue { color: #3b82f6; }
.text-yellow { color: var(--color-inprogress); }
.text-green { color: var(--color-done); }
.text-purple { color: var(--color-purple); }
.text-billed { color: var(--color-billed); }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.02em; }

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: rgba(36, 34, 31, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--surface-border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    z-index: 10;
}

.sidebar-header {
    margin-bottom: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

.logo i {
    color: var(--primary);
    font-size: 1.5rem;
}

.app-logo {
    max-width: 40px;
    height: auto;
    border-radius: var(--border-radius-sm);
}



.sidebar .nav-links {
    list-style: none;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-md);
    color: var(--text-muted);
    text-decoration: none;
    transition: all var(--transition-fast);
    font-weight: 500;
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.nav-item:hover {
    background-color: var(--surface-hover);
    color: var(--text-main);
}

.nav-item.active {
    background-color: rgba(var(--primary-rgb), 0.15);
    color: var(--primary);
    border-left: 3px solid var(--primary);
}

.project-legend {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--surface-border);
}

.project-legend h4 {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.project-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.bg-blue { background-color: #3b82f6 !important; }
.bg-cyan { background-color: #06b6d4 !important; }
.bg-green { background-color: #059669 !important; }
.bg-yellow { background-color: var(--color-inprogress) !important; }
.bg-red { background-color: #ef4444 !important; }
.bg-gray { background-color: #94a3b8 !important; }
.bg-purple { background-color: var(--color-purple) !important; }
.bg-billed { background-color: var(--color-billed) !important; }
.bg-orange { background-color: #f97316 !important; }
.bg-pink { background-color: #ec4899 !important; }
.bg-teal { background-color: #14b8a6 !important; }
.bg-indigo { background-color: #6366f1 !important; }
.bg-lime { background-color: #84cc16 !important; }
.bg-amber { background-color: #fbbf24 !important; }

.sidebar-footer {
    margin-top: auto;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-bar {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    border-bottom: 1px solid var(--surface-border);
    background-color: rgba(36, 34, 31, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 5;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Online Ticker */
.online-ticker-wrapper {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    height: 44px; /* Identisch zur Select-Box */
    background: var(--surface-light);
    border: 1px solid var(--surface-border);
    border-radius: 8px; /* Gleicher Rand wie modern-input */
    overflow: hidden;
    transition: all 0.3s ease;
}

.online-ticker-container {
    height: 100%;
    width: 0;
    opacity: 0;
    overflow: hidden;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    display: flex;
    align-items: center;
    position: relative;
    background: transparent;
    pointer-events: none;
}

.online-ticker-wrapper.ticker-open .online-ticker-container {
    width: 250px;
    opacity: 1;
    pointer-events: auto;
}

.btn-ticker-toggle {
    width: 44px; /* Quadratisch */
    height: 100%;
    border-radius: 0;
    background: transparent;
    border: none;
    border-left: 1px solid var(--surface-border); /* Trennlinie zum Text */
    color: var(--text-muted);
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    box-shadow: none;
}

.btn-ticker-toggle:hover {
    color: var(--text-main);
    background: rgba(36, 34, 31, 0.05); /* Leichter Hover-Effekt */
}

.btn-ticker-toggle i {
    transition: transform 0.3s ease;
}

.online-ticker-wrapper.ticker-open .btn-ticker-toggle i {
    transform: rotate(180deg);
}

.online-ticker-content {
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    font-size: 0.85rem;
    color: var(--text-main);
    padding: 0 0.5rem;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    display: flex;
    align-items: center;
}

.ticker-scroll-inner {
    display: flex;
    width: max-content;
    animation: scrollTicker 45s linear infinite;
    will-change: transform;
}

.ticker-scroll-inner:hover {
    animation-play-state: paused;
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 3rem;
    font-weight: 500;
}

.ticker-item i {
    color: var(--color-done);
    font-size: 0.5rem;
    animation: pulseTicker 2s infinite;
}

.badge-ticker-ticket {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn-ticker-toggle {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 1rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    border-left: 1px solid var(--surface-border);
}

.btn-ticker-toggle:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
}

.online-ticker-container.ticker-hidden .btn-ticker-toggle {
    border-left: none;
    border-radius: 50%;
    background: rgba(36, 34, 31, 0.4);
    border: 1px solid var(--surface-border);
    width: 38px;
    padding: 0;
}

@keyframes scrollTicker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); } 
}

@keyframes pulseTicker {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

/* Views */
.view-container {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
}

.view {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
}

.view.active {
    display: block;
}

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

/* Glassmorphism Components */
.glass-card {
    background: var(--surface-light);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--surface-border);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 1.5rem;
}

.full-height {
    height: 100%;
}

/* Buttons and Inputs */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: var(--border-radius-md);
    font-weight: 600;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: all var(--transition-fast);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(var(--primary-rgb), 0.39);
}

.btn-primary:not(:disabled):hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(var(--primary-rgb), 0.5);
}

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

.btn-secondary:not(:disabled):hover {
    background-color: var(--secondary-hover);
    transform: translateY(-2px);
}

.btn-danger {
    background-color: #ef4444;
    color: white;
}

.btn-danger:not(:disabled):hover {
    background-color: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px 0 rgba(239, 68, 68, 0.39);
}

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

.btn-green:not(:disabled):hover {
    background-color: #059669; /* deeper green */
    transform: translateY(-2px);
    box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.39);
}

.btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

.block {
    display: block;
}

.full-width {
    width: 100%;
}

.modern-input {
    width: 100%;
    background-color: rgba(36, 34, 31, 0.8);
    border: 1px solid var(--surface-border);
    color: var(--text-main);
    border-radius: var(--border-radius-sm);
    padding: 0.75rem 1rem;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
}

.modern-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.2);
}

.modern-input:disabled,
.modern-input[readonly] {
    opacity: 0.7;
    cursor: not-allowed;
    background-color: var(--surface-hover);
}

select.modern-input {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2394a3b8%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem top 50%;
    background-size: 0.65rem auto;
    padding-right: 2.5rem;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 400px;
    text-align: center;
}

.empty-state .icon-wrapper {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.empty-state h2 {
    margin-bottom: 0.5rem;
    font-size: 1.75rem;
}

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

.stat-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    border-bottom: 4px solid transparent;
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

.stat-card.border-open { border-bottom-color: var(--color-open); }
.stat-card.border-inprogress { border-bottom-color: var(--color-inprogress); }
.stat-card.border-done { border-bottom-color: var(--color-done); }
.stat-card.border-billed { border-bottom-color: var(--color-billed); }

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

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

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.1;
}

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

/* Kanban Board */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    height: calc(100% - 150px);
    min-height: 500px;
}

.kanban-column {
    background: rgba(36, 34, 31, 0.4);
    border-radius: var(--border-radius-lg);
    border: 1px dashed var(--surface-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.kanban-header {
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--surface-border);
    background: rgba(36, 34, 31, 0.6);
}

.kanban-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.kanban-tickets {
    padding: 1rem;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Badges */
.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.badge-gray { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; }
.badge-yellow { background: rgba(245, 158, 11, 0.15); color: #d97706; }
.badge-green { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.badge-purple { background: rgba(var(--purple-rgb), 0.2); color: var(--purple-text); }
.badge-billed { background: rgba(var(--billed-rgb), 0.2); color: var(--billed-text); }
.badge-blue { background: rgba(var(--primary-rgb), 0.2); color: #93c5fd; }
.badge-cyan { background: rgba(6, 182, 212, 0.2); color: #67e8f9; }

/* Ticket Cards */
.ticket-card {
    background: var(--bg-darker);
    border: 1px solid var(--surface-border);
    border-radius: var(--border-radius-md);
    padding: 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.ticket-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 4px; height: 100%;
}

.ticket-card[data-priority="high"]::before { background-color: #ef4444; }
.ticket-card[data-priority="normal"]::before { background-color: #3b82f6; }

.ticket-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-soft);
    border-color: rgba(var(--primary-rgb), 0.5);
}

.ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.ticket-id {
    font-family: monospace;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.ticket-title {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
}

.ticket-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.assignee-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.7rem;
}

/* List View Table */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.search-box {
    position: relative;
    width: 300px;
}

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

.search-box input {
    padding-left: 2.5rem;
}

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

.modern-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    table-layout: fixed;
}

.modern-table th, .modern-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--surface-border);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.modern-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.modern-table th:first-child, .modern-table td:first-child {
    min-width: 115px;
}

.modern-table tbody tr {
    transition: background-color var(--transition-fast);
    cursor: pointer;
}

.modern-table tbody tr:hover {
    background-color: var(--surface-hover);
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    transition: color 0.2s;
    padding: 0.2rem;
}

.btn-icon.small {
    font-size: 0.9rem;
    padding: 0.1rem;
}

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

/* Billing View */
.billing-container {
    max-width: 1400px;
    margin: 0 auto;
}

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

.billing-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.project-billing {
    background: rgba(36, 34, 31, 0.4);
    border-radius: var(--border-radius-md);
    padding: 1.5rem;
    border: 1px solid var(--surface-border);
}

.project-billing h3 {
    margin-bottom: 1rem;
    color: var(--primary);
    font-size: 1.25rem;
}

.billing-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px dashed var(--surface-border);
}

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

.billing-stat strong {
    font-size: 1.5rem;
}

.user-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.user-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--bg-dark);
}

.animate-pop-in {
    transform: scale(0.95) translateY(10px);
    transition: transform var(--transition-bounce), opacity 0.3s ease;
    opacity: 0;
}

.modal-overlay:not(.hidden) .animate-pop-in {
    transform: scale(1) translateY(0);
    opacity: 1;
}

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

.btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.btn-close:hover {
    color: white;
}

.form-group {
    margin-bottom: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.form-row {
    display: flex;
    gap: 0.75rem;
}

.form-group.half {
    flex: 1;
}

.form-group.third {
    flex: 1;
}

textarea.modern-input {
    resize: vertical;
    min-height: 100px;
    transition: all var(--transition-fast);
}

textarea.modern-input.drag-over {
    border-color: var(--color-done);
    background-color: rgba(16, 185, 129, 0.1);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

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

/* History Logs */
.history-container {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px dashed var(--surface-border);
}

.history-container label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    display: block;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 200px;
    overflow-y: auto;
}

.history-item {
    background: var(--surface-hover);
    padding: 0.75rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.85rem;
    border-left: 3px solid var(--primary);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.history-meta {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Floating Timer */
.floating-timer {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1rem 1.5rem;
    border: 1px solid var(--primary);
    box-shadow: 0 10px 25px -5px rgba(var(--primary-rgb), 0.4);
    animation: slideUp 0.3s ease-out;
    background: #1e1d1a;
    color: #fdfbf7;
    border: 1px solid rgba(255,255,255,0.1);
    min-width: 350px;
    max-width: 500px;
    border-radius: var(--border-radius-md);
}

.floating-timer.hidden {
    display: none !important;
}

.timer-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

#timerTicketTitle {
    font-size: 0.9rem;
    color: #a3a3a3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}

.timer-display {
    font-family: monospace;
    font-size: 1.75rem;
    color: #3b82f6;
    font-weight: bold;
    line-height: 1;
}

.timer-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.timer-controls .btn-icon {
    font-size: 1.5rem;
    padding: 0.25rem;
    color: var(--text-muted);
}

.timer-controls .btn-icon.text-yellow { color: var(--color-inprogress); }
.timer-controls .btn-icon.text-red { color: #ef4444; }

.timer-controls .btn-icon:hover {
    transform: scale(1.1);
}

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

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Scrollbar customization */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(36, 34, 31, 0.5);
}
::-webkit-scrollbar-thumb {
    background: var(--surface-border);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.hidden {
    display: none !important;
}

/* Phase 15: Compact Modal Overrides */
.modal-content .modal-header {
    padding: 0.75rem 1.5rem;
}
.modal-content .modal-body {
    padding: 0.5rem 1.5rem;
}
.modal-content .modal-actions {
    padding: 0.75rem 1.5rem;
}
.modal-content .form-group {
    margin-bottom: 0.75rem;
}
.modal-content .form-row {
    margin-bottom: 0.75rem;
}
.modal-content .modern-input, .modal-content textarea.modern-input {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
}

/* Threaded Comments */
.comment-bubble {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    position: relative;
    border: 1px solid var(--surface-border);
}

.comment-bubble.is-self {
    align-self: flex-end;
    background: var(--surface-light);
    border-bottom-right-radius: 2px;
}

.comment-bubble.is-other {
    align-self: flex-start;
    background: rgba(30,30,30,0.4);
    border-bottom-left-radius: 2px;
}

.comment-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.comment-author {
    font-weight: 600;
    color: var(--text-light);
}

.comment-role-badge {
    background: rgba(255,255,255,0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    margin-left: 0.5rem;
    text-transform: uppercase;
}

.comment-role-badge.admin { color: #818cf8; background: rgba(129, 140, 248, 0.15); }
.comment-role-badge.developer { color: #34d399; background: rgba(52, 211, 153, 0.15); }
.comment-role-badge.poweruser { color: #facc15; background: rgba(250, 204, 21, 0.15); }

.comment-text {
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Login Screen */
.login-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(18, 18, 18, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.login-container.hidden {
    display: none !important;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.login-header {
    text-align: center;
    margin-bottom: 0.5rem;
}

.login-logo {
    height: 60px;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Dynamische Spalten-Verteilung für den "Abgerechnet" Tab (MA ausblenden) */
.table-view-billed .col-ma {
    display: none !important;
}
.table-view-billed .col-titel {
    width: 28% !important; /* 25% original + 3% = 28% */
}
.table-view-billed #thZeit, .table-view-billed .col-zeit {
    width: 20% !important; /* 13% original + 7% = 20% */
}

/* Erledigt Tab: Zeit-Spalte komplett ausblenden */
.table-view-done .col-zeit {
    display: none !important;
}
.table-view-done .col-titel {
    width: 38% !important; /* 25% original + 13% Zeit = 38% */
}

/* Force Dropdown Arrow on Datalist Inputs */
input[list]::-webkit-calendar-picker-indicator {
    opacity: 1 !important;
    display: block !important;
    cursor: pointer;
    background-color: transparent;
    color: var(--text-muted);
}
