/* ============================================
   Energetik Verwaltung - Stylesheet
   Warmes, beruhigendes Design
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Lora:ital,wght@0,400;0,500;1,400&display=swap');

:root {
    --color-primary: #5B7B6F;
    --color-primary-light: #7A9B8E;
    --color-primary-dark: #3D5A4F;
    --color-primary-subtle: #E8F0EC;
    
    --color-accent: #C4956A;
    --color-accent-light: #D4AD88;
    --color-accent-dark: #A67A4F;
    --color-accent-subtle: #F5EDE4;
    
    --color-bg: #FAF8F5;
    --color-bg-card: #FFFFFF;
    --color-bg-sidebar: #2C3E3A;
    --color-bg-sidebar-hover: #3A504B;
    --color-bg-sidebar-active: #4A6560;
    
    --color-text: #2C3E3A;
    --color-text-light: #6B7F7A;
    --color-text-muted: #9BA8A4;
    --color-text-sidebar: #C8D5D1;
    --color-text-sidebar-active: #FFFFFF;
    
    --color-border: #E2DDD7;
    --color-border-light: #F0ECE7;
    
    --color-success: #5B8C5A;
    --color-success-bg: #EDF5ED;
    --color-warning: #C49A3C;
    --color-warning-bg: #FDF5E6;
    --color-danger: #C45B5B;
    --color-danger-bg: #FDEDED;
    --color-info: #5B7B9B;
    --color-info-bg: #EDF2F7;
    
    --shadow-sm: 0 1px 3px rgba(44,62,58,0.06);
    --shadow-md: 0 4px 12px rgba(44,62,58,0.08);
    --shadow-lg: 0 8px 30px rgba(44,62,58,0.12);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 50%;
    
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-serif: 'Lora', Georgia, serif;
    
    --sidebar-width: 260px;
    --header-height: 64px;
}

/* === Reset & Base === */

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

html { font-size: 15px; -webkit-font-smoothing: antialiased; }

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--color-primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--color-primary-dark); }

img { max-width: 100%; }

/* === Layout === */

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* === Sidebar === */

.sidebar {
    width: var(--sidebar-width);
    background: var(--color-bg-sidebar);
    color: var(--color-text-sidebar);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.3s;
}

.sidebar-brand {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    flex-shrink: 0;
}

.sidebar-brand h1 {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    letter-spacing: -0.02em;
}

.sidebar-brand small {
    display: block;
    font-size: 0.7rem;
    font-weight: 300;
    color: var(--color-text-sidebar);
    opacity: 0.7;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }

.sidebar-section {
    margin-bottom: 24px;
}

.sidebar-section-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-sidebar);
    opacity: 0.5;
    padding: 0 12px;
    margin-bottom: 6px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--color-text-sidebar);
    font-size: 0.9rem;
    font-weight: 400;
    transition: all 0.2s;
    margin-bottom: 2px;
}

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

.sidebar-link.active {
    background: var(--color-bg-sidebar-active);
    color: var(--color-text-sidebar-active);
    font-weight: 500;
}

.sidebar-link svg {
    width: 18px;
    height: 18px;
    opacity: 0.7;
    flex-shrink: 0;
}

.sidebar-link.active svg { opacity: 1; }

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 0.8rem;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.sidebar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
    color: white;
}

.sidebar-user-info { flex: 1; overflow: hidden; }
.sidebar-user-name { font-weight: 500; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 0.7rem; opacity: 0.6; }

.sidebar-logout {
    display: block;
    text-align: center;
    padding: 8px;
    border-radius: var(--radius-sm);
    color: var(--color-text-sidebar);
    opacity: 0.6;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.sidebar-logout:hover { opacity: 1; background: rgba(196,91,91,0.2); color: var(--color-danger); }

/* === Main Content === */

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-header {
    padding: 28px 36px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.03em; }
.page-subtitle { color: var(--color-text-light); font-size: 0.85rem; margin-top: 2px; }

.page-body { padding: 0 36px 36px; flex: 1; }

/* === Cards === */

.card {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border-light);
    overflow: hidden;
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--color-border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-header h2 { font-size: 1rem; font-weight: 600; }
.card-body { padding: 24px; }
.card-footer { padding: 16px 24px; border-top: 1px solid var(--color-border-light); background: var(--color-bg); }

/* === Buttons === */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}

.btn svg { width: 16px; height: 16px; }

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

.btn-accent { background: var(--color-accent); color: white; }
.btn-accent:hover { background: var(--color-accent-dark); color: white; }

.btn-outline {
    background: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-border);
}
.btn-outline:hover { background: var(--color-bg); border-color: var(--color-text-muted); color: var(--color-text); }

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

.btn-success { background: var(--color-success); color: white; }
.btn-success:hover { background: #4a7a49; color: white; }

.btn-sm { padding: 6px 12px; font-size: 0.78rem; }
.btn-lg { padding: 12px 24px; font-size: 0.95rem; }

.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* === Forms === */

.form-group { margin-bottom: 18px; }

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 5px;
    letter-spacing: 0.01em;
}

.form-label .required { color: var(--color-danger); }

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: var(--color-text);
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
    line-height: 1.5;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-subtle);
}

.form-control::placeholder { color: var(--color-text-muted); }

textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { appearance: auto; }

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

.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }

.form-hint { font-size: 0.75rem; color: var(--color-text-muted); margin-top: 4px; }

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
}

/* === Tables === */

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

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

table th, table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--color-border-light);
    font-size: 0.87rem;
}

table th {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-light);
    background: var(--color-bg);
}

table tr:hover td { background: rgba(91,123,111,0.03); }

table .actions { white-space: nowrap; text-align: right; }

/* === Alerts / Flash === */

.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 0.87rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert-success { background: var(--color-success-bg); color: var(--color-success); border: 1px solid rgba(91,140,90,0.2); }
.alert-error { background: var(--color-danger-bg); color: var(--color-danger); border: 1px solid rgba(196,91,91,0.2); }
.alert-warning { background: var(--color-warning-bg); color: var(--color-warning); border: 1px solid rgba(196,154,60,0.2); }
.alert-info { background: var(--color-info-bg); color: var(--color-info); border: 1px solid rgba(91,123,155,0.2); }

/* === Badge === */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-admin { background: var(--color-accent-subtle); color: var(--color-accent-dark); }
.badge-editor { background: var(--color-primary-subtle); color: var(--color-primary-dark); }
.badge-reader { background: var(--color-bg); color: var(--color-text-light); border: 1px solid var(--color-border); }
.badge-success { background: var(--color-success-bg); color: var(--color-success); }
.badge-warning { background: var(--color-warning-bg); color: var(--color-warning); }
.badge-danger { background: var(--color-danger-bg); color: var(--color-danger); }
.badge-info { background: var(--color-info-bg); color: var(--color-info); }

/* === Stats / Dashboard === */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border-light);
}

.stat-card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    font-size: 18px;
}

.stat-card-icon.green { background: var(--color-primary-subtle); color: var(--color-primary); }
.stat-card-icon.amber { background: var(--color-accent-subtle); color: var(--color-accent); }
.stat-card-icon.blue { background: var(--color-info-bg); color: var(--color-info); }
.stat-card-icon.red { background: var(--color-danger-bg); color: var(--color-danger); }

.stat-value { font-size: 1.8rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.stat-label { font-size: 0.8rem; color: var(--color-text-light); margin-top: 4px; }

/* === Notes / Chat === */

.notes-container {
    display: flex;
    flex-direction: column;
    height: 500px;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--color-bg);
}

.notes-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.note-item {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border-light);
    box-shadow: var(--shadow-sm);
    position: relative;
}

.note-item.own {
    align-self: flex-end;
    background: var(--color-primary-subtle);
    border-color: rgba(91,123,111,0.15);
}

.note-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 0.72rem;
    color: var(--color-text-muted);
}

.note-author { font-weight: 600; color: var(--color-primary); }
.note-text { font-size: 0.9rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.note-delete { position: absolute; top: 8px; right: 8px; opacity: 0; transition: opacity 0.2s; }
.note-item:hover .note-delete { opacity: 1; }

.notes-input {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    background: var(--color-bg-card);
    border-top: 1px solid var(--color-border-light);
}

.notes-input textarea {
    flex: 1;
    resize: none;
    height: 44px;
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.87rem;
}

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

/* === Search Bar === */

.search-bar {
    position: relative;
    max-width: 360px;
}

.search-bar input {
    width: 100%;
    padding: 9px 14px 9px 38px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.87rem;
    background: white;
}

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

.search-bar svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--color-text-muted);
}

/* === Login Page === */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-bg-sidebar) 0%, #1a2b27 100%);
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.login-header {
    padding: 36px 36px 24px;
    text-align: center;
}

.login-logo {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    margin: 0 auto 16px;
}

.login-header h1 { font-size: 1.4rem; font-weight: 700; }
.login-header p { color: var(--color-text-light); font-size: 0.85rem; margin-top: 4px; }

.login-body { padding: 0 36px 36px; }

.login-body .form-control {
    padding: 12px 16px;
    font-size: 0.95rem;
}

.login-body .btn { width: 100%; padding: 12px; font-size: 0.95rem; justify-content: center; }

.login-footer { padding: 16px 36px; background: var(--color-bg); text-align: center; font-size: 0.78rem; color: var(--color-text-muted); }

/* === Invoice === */

.invoice-preview {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 40px;
    max-width: 800px;
    margin: 0 auto;
}

.invoice-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
}

.invoice-company h2 { font-family: var(--font-serif); font-size: 1.3rem; color: var(--color-primary-dark); }
.invoice-company p { font-size: 0.8rem; color: var(--color-text-light); line-height: 1.6; margin-top: 4px; }

.invoice-title { text-align: right; }
.invoice-title h1 { font-size: 1.8rem; font-weight: 700; color: var(--color-accent); letter-spacing: -0.03em; }
.invoice-title p { font-size: 0.85rem; color: var(--color-text-light); }

.invoice-parties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 36px;
}

.invoice-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-text-muted); font-weight: 600; margin-bottom: 6px; }

.invoice-table { width: 100%; margin-bottom: 28px; }
.invoice-table th { background: var(--color-primary-subtle); color: var(--color-primary-dark); font-size: 0.75rem; padding: 10px 14px; }
.invoice-table td { padding: 12px 14px; border-bottom: 1px solid var(--color-border-light); font-size: 0.87rem; }
.invoice-table .text-right { text-align: right; }

.invoice-totals {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 32px;
}

.invoice-totals table { width: 260px; }
.invoice-totals td { padding: 6px 0; font-size: 0.87rem; border: none; }
.invoice-totals .total-row { font-weight: 700; font-size: 1.05rem; border-top: 2px solid var(--color-text); padding-top: 10px; }

.invoice-footer-note {
    padding-top: 20px;
    border-top: 1px solid var(--color-border-light);
    font-size: 0.78rem;
    color: var(--color-text-light);
    line-height: 1.6;
}

/* === Pagination & Empty === */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-muted);
}

.empty-state svg { width: 48px; height: 48px; margin-bottom: 14px; opacity: 0.4; }
.empty-state h3 { font-size: 1.05rem; color: var(--color-text-light); margin-bottom: 6px; }
.empty-state p { font-size: 0.85rem; margin-bottom: 16px; }

/* === Tabs === */

.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--color-border-light);
    margin-bottom: 24px;
}

.tab-link {
    padding: 10px 18px;
    font-size: 0.87rem;
    font-weight: 500;
    color: var(--color-text-light);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab-link:hover { color: var(--color-text); }
.tab-link.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }

/* === Modal (simple) === */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(44,62,58,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--color-border-light); }
.modal-header h3 { font-size: 1.05rem; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--color-border-light); display: flex; justify-content: flex-end; gap: 8px; }

/* === Print === */

@media print {
    .sidebar, .page-header .btn, .no-print { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .invoice-preview { border: none; box-shadow: none; padding: 0; }
    body { background: white; }
}

/* === Mobile === */

.mobile-toggle {
    display: none;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 101;
    width: 40px;
    height: 40px;
    background: var(--color-bg-sidebar);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .mobile-toggle { display: flex; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .page-header { padding: 20px 20px 14px; padding-top: 64px; }
    .page-body { padding: 0 20px 20px; }
    .form-row { grid-template-columns: 1fr; }
    .form-row-3 { grid-template-columns: 1fr; }
    .invoice-parties { grid-template-columns: 1fr; gap: 20px; }
    .invoice-header-row { flex-direction: column; gap: 16px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* === Utilities === */

.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.text-small { font-size: 0.8rem; }
.text-danger { color: var(--color-danger); }
.text-success { color: var(--color-success); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.gap-1 { gap: 8px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.w-100 { width: 100%; }

/* === Calendar === */

.calendar-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.calendar-table th {
    padding: 10px 8px;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-light);
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border-light);
}

.calendar-table th.weekend { color: var(--color-text-muted); }

.cal-day {
    vertical-align: top;
    height: 110px;
    padding: 6px 8px;
    border: 1px solid var(--color-border-light);
    position: relative;
    transition: background 0.15s;
}

.cal-day:hover { background: rgba(91,123,111,0.02); }

.cal-empty { background: var(--color-bg); }

.cal-today {
    background: var(--color-primary-subtle) !important;
    border-color: var(--color-primary-light);
}

.cal-today .cal-day-num {
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cal-weekend { background: rgba(0,0,0,0.015); }

.cal-day-num {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 4px;
    display: inline-block;
}

.cal-event {
    display: block;
    padding: 3px 6px;
    margin-bottom: 2px;
    border-radius: 4px;
    font-size: 0.7rem;
    line-height: 1.3;
    color: var(--color-primary-dark);
    background: rgba(91,123,111,0.1);
    border-left: 3px solid var(--color-primary);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: background 0.15s;
}

.cal-event:hover {
    background: rgba(91,123,111,0.2);
    color: var(--color-primary-dark);
}

.cal-event-time {
    font-weight: 600;
    font-size: 0.68rem;
}

.cal-add {
    position: absolute;
    bottom: 4px;
    right: 6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-border-light);
    color: var(--color-text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
    text-decoration: none;
}

.cal-day:hover .cal-add { opacity: 1; }
.cal-add:hover { background: var(--color-primary); color: white; }

/* Calendar mobile */
@media (max-width: 768px) {
    .cal-day {
        height: 70px;
        padding: 4px;
    }
    .cal-event {
        font-size: 0.6rem;
        padding: 2px 4px;
    }
    .cal-event-time { display: none; }
    .cal-day-num { font-size: 0.72rem; }
    .calendar-table th { padding: 6px 4px; font-size: 0.65rem; }
}
