/* =============================================================================
   InfinityTime – App Stylesheet (Dark Theme)
   ============================================================================= */

/* --- CSS Custom Properties (Design Tokens) --- */
:root {
    /* Hintergründe */
    --it-bg:            #0b0e14;
    --it-bg-card:       #111621;
    --it-bg-card-hover: #161d2a;
    --it-bg-sidebar:    #0d1018;
    --it-bg-input:      #161d2a;

    /* Borders */
    --it-border:        #1a2233;
    --it-border-light:  #243044;

    /* Text */
    --it-text:          #e2e8f0;
    --it-text-soft:     #94a3b8;
    --it-text-muted:    #64748b;
    --it-text-dim:      #475569;

    /* Akzentfarben */
    --it-teal:          #00d4aa;
    --it-teal-light:    #2dd4bf;
    --it-cyan:          #22d3ee;
    --it-orange:        #f59e0b;
    --it-purple:        #a855f7;
    --it-red:           #ef4444;
    --it-blue:          #3b82f6;
    --it-green:         #22c55e;

    /* Schriftarten */
    --it-font-mono:     'JetBrains Mono', monospace;
    --it-font-body:     system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

    /* Sidebar */
    --it-sidebar-width: 260px;

    /* Fokus */
    --it-focus-ring:    0 0 0 3px rgba(0, 212, 170, 0.4);
}

/* --- Reset & Basis --- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background: var(--it-bg);
    color: var(--it-text);
    font-family: var(--it-font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* --- Skip-Link (Barrierefreiheit) --- */
.it-skip-link {
    position: absolute;
    left: -10000px;
    top: 0;
    padding: 0.75rem 1.5rem;
    background: var(--it-teal);
    color: #000;
    font-weight: 600;
    z-index: 9999;
    text-decoration: none;
}

.it-skip-link:focus {
    left: 0;
}

/* --- Fokus-Stile (WCAG 2.1 AA) --- */
:focus-visible {
    outline: none;
    box-shadow: var(--it-focus-ring);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--it-teal);
    outline-offset: 2px;
}

/* --- Layout --- */
.it-layout {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.it-sidebar {
    width: var(--it-sidebar-width);
    background: var(--it-bg-sidebar);
    border-right: 1px solid var(--it-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.it-sidebar__header {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid var(--it-border);
}

.it-sidebar__logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--it-teal);
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 700;
    font-family: var(--it-font-mono);
}

.it-sidebar__logo:hover {
    color: var(--it-teal-light);
}

.it-sidebar__logo i {
    font-size: 1.5rem;
}

.it-sidebar__nav {
    list-style: none;
    padding: 1rem 0.75rem;
    margin: 0;
    flex: 1;
}

.it-sidebar__link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    color: var(--it-text-soft);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.15s ease;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.it-sidebar__link:hover {
    background: var(--it-bg-card-hover);
    color: var(--it-text);
}

.it-sidebar__link--active {
    background: rgba(0, 212, 170, 0.1);
    color: var(--it-teal);
}

.it-sidebar__link--active i {
    color: var(--it-teal);
}

.it-sidebar__footer {
    padding: 1rem 0.75rem;
    border-top: 1px solid var(--it-border);
}

/* Admin-Tool-Links im Footer (dezent, kleiner) */
.it-sidebar__link--tool {
    font-size: 0.8rem;
    color: var(--it-text-muted);
    margin-bottom: 0.5rem;
}
.it-sidebar__link--tool:hover {
    color: var(--it-orange);
}

.it-sidebar__user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--it-text-soft);
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.it-sidebar__logout {
    margin: 0;
}

/* --- Hauptinhalt --- */
.it-main {
    flex: 1;
    margin-left: var(--it-sidebar-width);
    padding: 2rem;
    min-height: 100vh;
}

/* --- Auth Layout --- */
.it-auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.it-auth-container {
    width: 100%;
    max-width: 420px;
    padding: 1rem;
}

.it-auth-card {
    background: var(--it-bg-card);
    border: 1px solid var(--it-border);
    border-radius: 1rem;
    padding: 2.5rem;
}

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

.it-auth-card__icon {
    font-size: 3rem;
    color: var(--it-teal);
    display: block;
    margin-bottom: 0.75rem;
}

.it-auth-card__title {
    font-family: var(--it-font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--it-text);
    margin: 0;
}

.it-auth-card__subtitle {
    font-size: 1rem;
    color: var(--it-text-soft);
    text-align: center;
    margin-bottom: 0.5rem;
}

/* --- Formular-Elemente --- */
.form-label {
    color: var(--it-text-soft);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.375rem;
}

.it-input-group {
    position: relative;
}

.it-input-group i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--it-text-muted);
    font-size: 1rem;
    pointer-events: none;
}

.it-input {
    background: var(--it-bg-input);
    border: 1px solid var(--it-border);
    color: var(--it-text);
    padding: 0.625rem 1rem 0.625rem 2.75rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    transition: border-color 0.15s ease;
}

.it-input:focus {
    background: var(--it-bg-input);
    border-color: var(--it-teal);
    color: var(--it-text);
    box-shadow: var(--it-focus-ring);
}

.it-input::placeholder {
    color: var(--it-text-dim);
}

.it-input--code {
    font-family: var(--it-font-mono);
    font-size: 1.5rem;
    letter-spacing: 0.5em;
    text-align: center;
    padding-left: 2.75rem;
}

/* --- Buttons --- */
.it-btn-primary {
    background: var(--it-teal);
    color: #000;
    border: none;
    padding: 0.625rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
}

.it-btn-primary:hover {
    background: var(--it-teal-light);
    color: #000;
}

.it-btn-primary:focus-visible {
    box-shadow: var(--it-focus-ring);
}

.it-btn-secondary {
    background: var(--it-bg-card-hover);
    color: var(--it-text);
    border: 1px solid var(--it-border);
    padding: 0.625rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
}

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

.it-btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--it-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    min-height: 44px;
}

.it-btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--it-red);
}

/* --- Alert --- */
.it-alert {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--it-red);
    border-radius: 0.5rem;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.it-alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--it-green);
}

/* --- Karten --- */
.it-card {
    background: var(--it-bg-card);
    border: 1px solid var(--it-border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: border-color 0.15s ease;
}

.it-card:hover {
    border-color: var(--it-border-light);
}

.it-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.it-card__title {
    font-size: 0.85rem;
    color: var(--it-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin: 0;
}

.it-card__value {
    font-family: var(--it-font-mono);
    font-size: 2rem;
    font-weight: 700;
    color: var(--it-text);
    line-height: 1.2;
}

.it-card__value--teal {
    color: var(--it-teal);
}

.it-card__value--orange {
    color: var(--it-orange);
}

/* --- Timer-Widget --- */
.it-timer {
    background: var(--it-bg-card);
    border: 1px solid var(--it-border);
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.it-timer--running {
    border-color: var(--it-teal);
    box-shadow: 0 0 20px rgba(0, 212, 170, 0.1);
}

.it-timer--paused {
    border-color: var(--it-orange);
}

.it-timer__display {
    font-family: var(--it-font-mono);
    font-size: 3rem;
    font-weight: 700;
    text-align: center;
    color: var(--it-text);
    margin: 1rem 0;
    letter-spacing: 0.05em;
}

.it-timer__display--running {
    color: var(--it-teal);
}

.it-timer__display--paused {
    color: var(--it-orange);
}

.it-timer__status {
    text-align: center;
    font-size: 0.85rem;
    color: var(--it-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.it-timer__status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.it-timer__status-dot--running {
    background: var(--it-green);
    animation: it-pulse 2s infinite;
}

.it-timer__status-dot--paused {
    background: var(--it-orange);
}

.it-timer__status-dot--stopped {
    background: var(--it-text-muted);
}

@keyframes it-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.it-timer__controls {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.25rem;
}

/* --- Tabelle --- */
.it-table {
    width: 100%;
    border-collapse: collapse;
}

.it-table th {
    color: var(--it-text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--it-border);
    text-align: left;
}

.it-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--it-border);
    font-size: 0.9rem;
    color: var(--it-text-soft);
}

.it-table tr:hover td {
    background: var(--it-bg-card-hover);
}

.it-table__mono {
    font-family: var(--it-font-mono);
}

/* --- Badges --- */
.it-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.it-badge--teal {
    background: rgba(0, 212, 170, 0.1);
    color: var(--it-teal);
}

.it-badge--orange {
    background: rgba(245, 158, 11, 0.1);
    color: var(--it-orange);
}

.it-badge--purple {
    background: rgba(168, 85, 247, 0.1);
    color: var(--it-purple);
}

.it-badge--red {
    background: rgba(239, 68, 68, 0.1);
    color: var(--it-red);
}

.it-badge--blue {
    background: rgba(59, 130, 246, 0.1);
    color: var(--it-blue);
}

.it-badge--muted {
    background: rgba(100, 116, 139, 0.1);
    color: var(--it-text-muted);
}

/* --- Page Header --- */
.it-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.it-page-header__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--it-text);
    margin: 0;
}

/* --- Select & Eingabefelder (Dark Theme Override) --- */
.form-select.it-select {
    background-color: var(--it-bg-input);
    border-color: var(--it-border);
    color: var(--it-text);
}

.form-select.it-select:focus {
    border-color: var(--it-teal);
    box-shadow: var(--it-focus-ring);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .it-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .it-sidebar--open {
        transform: translateX(0);
    }

    .it-main {
        margin-left: 0;
        padding: 1rem;
    }

    .it-timer__display {
        font-size: 2rem;
    }

    .it-card__value {
        font-size: 1.5rem;
    }
}

/* --- Statistik-Karten --- */
.it-card--stat {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.it-card--compact {
    text-align: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem;
}

.it-stat__icon {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.it-stat__icon--teal {
    background: rgba(0, 212, 170, 0.1);
    color: var(--it-teal);
}

.it-stat__icon--cyan {
    background: rgba(34, 211, 238, 0.1);
    color: var(--it-cyan);
}

.it-stat__icon--green {
    background: rgba(34, 197, 94, 0.1);
    color: var(--it-green);
}

.it-stat__icon--orange {
    background: rgba(245, 158, 11, 0.1);
    color: var(--it-orange);
}

.it-stat__content {
    flex: 1;
    min-width: 0;
}

.it-stat__value {
    font-family: var(--it-font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--it-text);
    line-height: 1.2;
}

.it-stat__label {
    font-size: 0.8rem;
    color: var(--it-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- Badge-Erweiterung: Green --- */
.it-badge--green {
    background: rgba(34, 197, 94, 0.1);
    color: var(--it-green);
}

/* --- Detail-Liste (dt/dd) --- */
.it-detail-list {
    margin: 0;
}

.it-detail-list dt {
    font-size: 0.8rem;
    color: var(--it-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-top: 0.75rem;
}

.it-detail-list dt:first-child {
    margin-top: 0;
}

.it-detail-list dd {
    margin: 0.25rem 0 0;
    color: var(--it-text);
    font-size: 0.9rem;
}

/* --- Farb-Punkte (Projekte) --- */
.it-color-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.375rem;
    vertical-align: middle;
}

.it-color-dot--lg {
    width: 14px;
    height: 14px;
}

/* --- Links im Dark Theme --- */
.it-link {
    color: var(--it-teal);
    text-decoration: none;
    transition: color 0.15s ease;
}

.it-link:hover {
    color: var(--it-teal-light);
    text-decoration: underline;
}

/* --- Progress-Bars (Budget-Auslastung) --- */
.it-progress {
    height: 8px;
    background: var(--it-bg-input);
    border-radius: 4px;
    overflow: hidden;
}

.it-progress .progress-bar {
    font-size: 0;
    line-height: 8px;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.it-bg-teal {
    background-color: var(--it-teal);
}

/* --- Formular-Erweiterungen (ohne Icon-Padding) --- */
.form-control.it-input:not(.it-input-group .it-input) {
    padding-left: 1rem;
}

.form-control-color.it-input {
    padding: 0.375rem;
    height: 44px;
}

/* --- Text-Farben Utility --- */
.it-text-soft {
    color: var(--it-text-soft);
}

/* --- Checkbox im Dark Theme --- */
.form-check-input {
    background-color: var(--it-bg-input);
    border-color: var(--it-border);
}

.form-check-input:checked {
    background-color: var(--it-teal);
    border-color: var(--it-teal);
}

.form-check-input:focus {
    box-shadow: var(--it-focus-ring);
    border-color: var(--it-teal);
}

.form-check-label {
    color: var(--it-text-soft);
}

/* --- Form-Text im Dark Theme --- */
.form-text.it-text-muted {
    color: var(--it-text-dim);
}

/* --- Utility --- */
.it-mono {
    font-family: var(--it-font-mono);
}

.it-text-teal { color: var(--it-teal); }
.it-text-orange { color: var(--it-orange); }
.it-text-purple { color: var(--it-purple); }
.it-text-red { color: var(--it-red); }
.it-text-blue { color: var(--it-blue); }
.it-text-green { color: var(--it-green); }
.it-text-muted { color: var(--it-text-muted); }

/* =============================================================================
 * Report-Kacheln
 * ============================================================================= */
.it-report-card {
    transition: border-color 0.2s ease, transform 0.2s ease;
    cursor: pointer;
}
.it-report-card:hover {
    border-color: var(--it-teal);
    transform: translateY(-2px);
}
.it-report-card__icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* =============================================================================
 * Budget-Fortschrittsbalken (Report-spezifisch)
 * ============================================================================= */
.it-progress__bar--warning {
    background-color: var(--it-orange) !important;
}
.it-progress__bar--danger {
    background-color: var(--it-red) !important;
}
