/* ================================================================
   CHRONOWL — Stylesheet  v0.2
   Bootstrap 5.3 + Bootstrap Icons 1.11
   ================================================================ */

:root {
    --cw-primary:       #4f46e5;
    --cw-primary-dark:  #3730a3;
    --cw-primary-light: #e0e7ff;
    --cw-dark:          #1e1b4b;
    --cw-sidebar-w:     260px;
    --cw-topbar-h:      60px;
    --cw-radius:        12px;
    --cw-shadow:        0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
    --cw-shadow-md:     0 4px 16px rgba(0,0,0,.10);
}

/* ── Bootstrap overrides ─────────────────────────────────────── */
.btn-primary {
    --bs-btn-bg:                 var(--cw-primary);
    --bs-btn-border-color:       var(--cw-primary);
    --bs-btn-hover-bg:           var(--cw-primary-dark);
    --bs-btn-hover-border-color: var(--cw-primary-dark);
    --bs-btn-active-bg:          var(--cw-primary-dark);
}
.btn-outline-primary {
    --bs-btn-color:              var(--cw-primary);
    --bs-btn-border-color:       var(--cw-primary);
    --bs-btn-hover-bg:           var(--cw-primary);
    --bs-btn-hover-border-color: var(--cw-primary);
}
.text-primary      { color: var(--cw-primary)       !important; }
.bg-primary        { background: var(--cw-primary)  !important; }
.border-primary    { border-color: var(--cw-primary) !important; }
.bg-primary-subtle { background: var(--cw-primary-light) !important; }
.text-primary-emphasis { color: var(--cw-primary-dark) !important; }
a { color: var(--cw-primary); }
a:hover { color: var(--cw-primary-dark); }

/* ================================================================
   LAYOUT
   ================================================================ */
.cw-layout {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.cw-sidebar {
    width: var(--cw-sidebar-w);
    background: var(--cw-dark);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform .25s ease;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.1) transparent;
}

/* Top: brand + company switcher */
.cw-sidebar__top {
    border-bottom: 1px solid rgba(255,255,255,.08);
    flex-shrink: 0;
}
.cw-sidebar__brand-btn {
    width: 100%;
    background: none;
    border: none;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    cursor: pointer;
    text-align: left;
    color: white;
    transition: background .15s;
}
.cw-sidebar__brand-btn:hover { background: rgba(255,255,255,.06); }
.cw-brand-icon { font-size: 1.5rem; color: color-mix(in srgb, var(--cw-primary) 60%, white); flex-shrink: 0; }
.cw-sidebar__brand-text { flex: 1; overflow: hidden; }
.cw-sidebar__brand-name { display: block; font-weight: 700; font-size: 1rem; color: #fff; line-height: 1.2; }
.cw-sidebar__company-name { display: block; font-size: .75rem; color: rgba(255,255,255,.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Nav */
.cw-sidebar__nav { flex: 1; padding: .5rem 0 1rem; }
.cw-nav-section {
    padding: .8rem 1.25rem .3rem;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: rgba(255,255,255,.3);
}
.cw-nav-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .55rem 1.25rem;
    color: rgba(255,255,255,.62);
    font-size: .875rem;
    font-weight: 500;
    text-decoration: none;
    transition: background .12s, color .12s;
    border-radius: 0;
    position: relative;
}
.cw-nav-link i { font-size: 1rem; width: 18px; flex-shrink: 0; }
.cw-nav-link:hover { color: #fff; background: rgba(255,255,255,.07); }
.cw-nav-link.active {
    color: #fff;
    background: color-mix(in srgb, var(--cw-primary) 35%, transparent);
}
.cw-nav-link.active::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: color-mix(in srgb, var(--cw-primary) 60%, white);
    border-radius: 0 2px 2px 0;
}
.cw-nav-link--addon { opacity: .6; }
.cw-nav-link--addon:hover { opacity: .85; }
.cw-addon-badge {
    margin-left: auto;
    font-size: .62rem;
    background: color-mix(in srgb, var(--cw-primary) 40%, transparent);
    color: color-mix(in srgb, var(--cw-primary) 40%, white);
    border-radius: 4px;
    padding: 1px 6px;
    font-weight: 600;
    letter-spacing: .3px;
}

/* Portal sidebar variant */
.cw-sidebar--portal { background: color-mix(in srgb, var(--cw-dark) 80%, black); }

/* "← Zurück zur App" link at portal sidebar top */
.cw-sidebar__back {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .7rem 1.25rem;
    color: rgba(255,255,255,.45);
    font-size: .8rem;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,.06);
    transition: color .15s, background .15s;
    flex-shrink: 0;
}
.cw-sidebar__back:hover { color: #fff; background: rgba(255,255,255,.05); }
.cw-sidebar__back i { font-size: .9rem; }

/* Company avatar initials badge in portal sidebar */
.cw-sidebar__company-avatar {
    width: 30px; height: 30px;
    border-radius: 7px;
    background: var(--cw-primary);
    color: #fff;
    font-weight: 700;
    font-size: .8rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

/* "→ Verwaltung" link at app sidebar bottom */
.cw-sidebar__portal-link {
    border-top: 1px solid rgba(255,255,255,.06);
    padding: .25rem 0;
    flex-shrink: 0;
}

/* Portal topbar accent */
.cw-topbar--portal { background: #fafafa; border-bottom-color: #e5e7eb; }

/* User footer */
.cw-sidebar__user {
    border-top: 1px solid rgba(255,255,255,.08);
    padding: .85rem 1.25rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-shrink: 0;
}
.cw-sidebar__avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--cw-primary);
    color: #fff;
    font-weight: 700;
    font-size: .875rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.cw-sidebar__user-info { flex: 1; overflow: hidden; }
.cw-sidebar__user-name  { font-size: .8rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-sidebar__user-email { font-size: .68rem; color: rgba(255,255,255,.4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Overlay */
.cw-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1039;
}

/* ── Main content ────────────────────────────────────────────── */
.cw-main {
    margin-left: var(--cw-sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f5f6fa;
    min-height: 100vh;
}

/* Topbar */
.cw-topbar {
    height: var(--cw-topbar-h);
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    position: sticky;
    top: 0; z-index: 100;
    gap: 1rem;
    box-shadow: 0 1px 0 #e5e7eb;
    flex-shrink: 0;
}
.cw-topbar__title { font-weight: 700; font-size: 1rem; color: var(--cw-dark); }

/* Content area */
.cw-content { flex: 1; padding: 1.75rem; }

/* ── Page header ─────────────────────────────────────────────── */
.cw-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.75rem;
}
.cw-page-title { font-size: 1.35rem; font-weight: 800; margin: 0; color: var(--cw-dark); }
.cw-page-sub   { color: #9ca3af; font-size: .85rem; margin: .2rem 0 0; }

/* ================================================================
   COMPONENTS
   ================================================================ */

/* ── Card ────────────────────────────────────────────────────── */
.cw-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: var(--cw-radius);
    box-shadow: var(--cw-shadow);
    overflow: hidden;
}
.cw-card-header {
    padding: .9rem 1.25rem;
    border-bottom: 1px solid #f3f4f6;
    background: #fafafa;
}
.cw-card-body   { padding: 1.25rem; }
.cw-card-footer { padding: .75rem 1.25rem; border-top: 1px solid #f3f4f6; background: #fafafa; }

/* ── Stats card ──────────────────────────────────────────────── */
.cw-stat-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: var(--cw-radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--cw-shadow);
}
.cw-stat-icon {
    width: 46px; height: 46px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; flex-shrink: 0;
}
.cw-stat-value { font-size: 1.5rem; font-weight: 800; line-height: 1; color: var(--cw-dark); }
.cw-stat-label { font-size: .75rem; color: #9ca3af; margin-top: .25rem; }

/* ── Table ───────────────────────────────────────────────────── */
.cw-table thead th {
    background: #f9fafb;
    font-size: .72rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .6px;
    border-bottom: 1px solid #e5e7eb;
    padding: .7rem 1.25rem;
    white-space: nowrap;
}
.cw-table tbody td {
    padding: .75rem 1.25rem;
    font-size: .875rem;
    vertical-align: middle;
    border-bottom: 1px solid #f3f4f6;
}
.cw-table tbody tr:last-child td { border-bottom: none; }
.cw-table tbody tr:hover td { background: #fafafa; }

/* ── Clock button ────────────────────────────────────────────── */
.cw-clock-btn {
    width: 108px; height: 108px;
    border-radius: 50%;
    font-weight: 600;
    font-size: .88rem;
    border-width: 2.5px;
    display: inline-flex;
    flex-direction: column;
    align-items: center; justify-content: center;
    gap: 4px;
    transition: transform .18s, box-shadow .18s;
}
.cw-clock-btn:hover { transform: scale(1.06); box-shadow: 0 8px 24px rgba(0,0,0,.14); }

/* ── Blink animation ─────────────────────────────────────────── */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: .3; }
}

/* ================================================================
   LANDING PAGE
   ================================================================ */

/* Navbar */
.cw-nav {
    background: transparent;
    transition: background .3s, box-shadow .3s, padding .3s;
    padding: 1rem 0;
}
.cw-nav.cw-nav--solid { background: var(--cw-dark) !important; box-shadow: 0 2px 24px rgba(0,0,0,.3); padding: .55rem 0; }
.cw-nav .navbar-brand  { font-size: 1.35rem; font-weight: 700; color: #fff !important; }
.cw-nav .navbar-brand i { color: color-mix(in srgb, var(--cw-primary) 60%, white); }
.cw-nav .nav-link      { color: rgba(255,255,255,.75) !important; font-weight: 500; }
.cw-nav .nav-link:hover{ color: #fff !important; }

/* Hero */
.cw-hero {
    min-height: 100vh;
    background: linear-gradient(145deg, var(--cw-dark) 0%, color-mix(in srgb, var(--cw-primary) 40%, var(--cw-dark)) 55%, #1e3a5f 100%);
    display: flex; align-items: center;
    padding-top: 80px; overflow: hidden; position: relative;
}
.cw-hero::after {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 70% 50%, rgba(99,102,241,.18) 0%, transparent 65%);
    pointer-events: none;
}
.cw-hero__badge {
    display: inline-flex; align-items: center; gap: .4rem;
    background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18);
    color: color-mix(in srgb, var(--cw-primary) 40%, white); font-size: .75rem; font-weight: 600; letter-spacing: .6px;
    text-transform: uppercase; padding: .35rem .9rem; border-radius: 100px; margin-bottom: 1.5rem;
}
.cw-hero h1 { font-size: clamp(2rem,4.5vw,3.2rem); font-weight: 800; line-height: 1.15; color: #fff; }
.cw-hero h1 span { color: color-mix(in srgb, var(--cw-primary) 60%, white); }
.cw-hero .lead { color: rgba(255,255,255,.65); line-height: 1.7; }
.cw-hero__checks { color: rgba(255,255,255,.55); font-size: .85rem; }
.cw-hero__checks i { color: #6ee7b7; }

/* Mockup */
.cw-mockup { border-radius: 14px; overflow: hidden; box-shadow: 0 40px 80px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.08); transform: perspective(1000px) rotateY(-4deg) rotateX(2deg); transition: transform .4s; }
.cw-mockup:hover { transform: none; }
.cw-mockup-sidebar { width: 54px; background: #1e1b4b; padding: .75rem .5rem; display: flex; flex-direction: column; gap: .6rem; align-items: center; }
.cw-mockup-sidebar-icon { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.4); font-size: .95rem; }
.cw-mockup-sidebar-icon.active { background: color-mix(in srgb, var(--cw-primary) 50%, transparent); color: #fff; }
.cw-mockup-body { background: #f5f6fa; flex: 1; padding: .75rem; }

/* Sections */
.cw-section      { padding: 5.5rem 0; }
.cw-section--alt { background: #f8f7ff; }
.cw-section-title { font-size: clamp(1.6rem,3vw,2.4rem); font-weight: 800; letter-spacing: -.3px; }
.cw-section-sub   { color: #6b7280; max-width: 560px; margin: .75rem auto 0; line-height: 1.7; }

/* Feature cards */
.cw-feat-card { border: 1px solid #e5e7eb; border-radius: 16px; padding: 2rem; height: 100%; background: #fff; transition: transform .2s, box-shadow .2s, border-color .2s; }
.cw-feat-card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px color-mix(in srgb, var(--cw-primary) 12%, transparent); border-color: var(--cw-primary-light); }
.cw-feat-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--cw-primary-light); color: var(--cw-primary); display: flex; align-items: center; justify-content: center; font-size: 1.45rem; margin-bottom: 1.25rem; }

/* Addon cards */
.cw-addon-card { border: 2px solid #e5e7eb; border-radius: 18px; padding: 1.75rem; height: 100%; background: #fff; position: relative; overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.cw-addon-card:hover { border-color: var(--cw-primary); box-shadow: 0 8px 32px color-mix(in srgb, var(--cw-primary) 14%, transparent); }
.cw-addon-card .badge { position: absolute; top: 1.25rem; right: 1.25rem; font-size: .7rem; background: var(--cw-primary-light); color: var(--cw-primary); }

/* Pricing */
.cw-price-card { border: 2px solid #e5e7eb; border-radius: 20px; padding: 2.25rem; height: 100%; transition: all .2s; }
.cw-price-card--featured { border-color: var(--cw-primary); box-shadow: 0 0 0 6px var(--cw-primary-light), 0 16px 48px color-mix(in srgb, var(--cw-primary) 16%, transparent); }
.cw-price-amount { font-size: 2.8rem; font-weight: 800; line-height: 1; color: var(--cw-dark); }
.cw-price-list li { padding: .35rem 0; font-size: .9rem; }
.cw-price-list li i { color: #6ee7b7; width: 18px; }
.cw-price-list li.text-muted i { color: #d1d5db; }

/* CTA */
.cw-cta { background: linear-gradient(135deg, var(--cw-dark) 0%, color-mix(in srgb, var(--cw-primary) 40%, var(--cw-dark)) 100%); padding: 5.5rem 0; position: relative; overflow: hidden; }
.cw-cta::before { content: ''; position: absolute; width: 500px; height: 500px; background: radial-gradient(circle, rgba(99,102,241,.3) 0%, transparent 70%); top: -150px; right: -150px; pointer-events: none; }

/* Footer */
.cw-footer { background: #0f0e24; color: rgba(255,255,255,.55); padding: 3rem 0 2rem; font-size: .9rem; }
.cw-footer a { color: rgba(255,255,255,.55); text-decoration: none; }
.cw-footer a:hover { color: #fff; }
.cw-footer__brand { color: #fff; font-weight: 700; font-size: 1.2rem; }
.cw-footer__brand i { color: color-mix(in srgb, var(--cw-primary) 60%, white); }

/* ================================================================
   AUTH PAGES
   ================================================================ */
.cw-auth-wrap { min-height: 100vh; background: linear-gradient(135deg, color-mix(in srgb, var(--cw-primary) 5%, white) 0%, var(--cw-primary-light) 100%); display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.cw-auth-card { background: #fff; border-radius: 20px; box-shadow: 0 20px 64px color-mix(in srgb, var(--cw-primary) 13%, transparent); overflow: hidden; width: 100%; max-width: 480px; }
.cw-auth-card-header { background: linear-gradient(135deg, var(--cw-dark), color-mix(in srgb, var(--cw-primary) 40%, var(--cw-dark))); padding: 2rem 2rem 1.5rem; color: #fff; }
.cw-auth-card-body { padding: 2rem; }
.cw-auth-tabs .nav-link { color: #6b7280; font-weight: 500; border: none; border-bottom: 2px solid transparent; border-radius: 0; padding: .65rem 1rem; }
.cw-auth-tabs .nav-link.active { color: var(--cw-primary); border-bottom-color: var(--cw-primary); background: none; }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 991.98px) {
    .cw-sidebar { transform: translateX(-100%); }
    .cw-sidebar.open { transform: translateX(0); }
    .cw-main { margin-left: 0; }
    .cw-content { padding: 1.25rem 1rem; }
    .cw-page-header { margin-bottom: 1.25rem; }
}

/* ================================================================
   KALENDER-RASTER (shared by time, tasks, absences, shifts)
   ================================================================ */
.cw-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}
.cw-cal-dow {
    text-align: center;
    font-size: .72rem;
    font-weight: 600;
    color: #6b7280;
    padding: .5rem 0;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}
.cw-cal-day {
    min-height: 100px;
    border-right: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    padding: .35rem .4rem;
    vertical-align: top;
    background: #fff;
}
.cw-cal-day--other   { background: #f9fafb; }
.cw-cal-day--weekend { background: #f9fafb; }
.cw-cal-day--today   { background: color-mix(in srgb, var(--cw-primary) 4%, white); }
.cw-cal-day--interactive { cursor: pointer; }
.cw-cal-day--interactive:hover { background: color-mix(in srgb, var(--cw-primary) 6%, white); }
.cw-cal-day--interactive:hover .cw-cal-add-hint { opacity: .8 !important; }
.cw-cal-day__num {
    font-size: .78rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: .25rem;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cw-cal-day__num--today {
    background: var(--cw-primary);
    color: #fff;
    border-radius: 50%;
}
.cw-cal-event {
    font-size: .68rem;
    padding: .15rem .4rem;
    border-radius: .25rem;
    margin-bottom: .15rem;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}
.cw-cal-event:hover { filter: brightness(.93); }
.cw-cal-more { font-size: .65rem; color: #9ca3af; padding: .1rem .4rem; }
