/* ============================================
   Zápisník - styly
   ============================================ */

:root {
    --color-primary:     #2c5aa0;
    --color-primary-dk:  #1f4272;
    --color-accent:      #e8a33d;
    --color-text:        #1a1a1a;
    --color-muted:       #6c6c6c;
    --color-border:      #e0e0e0;
    --color-bg:          #fafafa;
    --color-bg-card:     #ffffff;
    --color-success:     #2d7a2d;
    --color-error:       #c0392b;
    --color-warn:        #b8860b;
    --color-tag-bg:      #e8eef7;
    --color-tag-text:    #2c5aa0;
    
    --radius:  8px;
    --shadow:  0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.12);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.2);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, 
                 "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--color-text);
    background: var(--color-bg);
}

a {
    color: var(--color-primary);
    text-decoration: none;
}
a:hover { text-decoration: underline; }

code {
    font-family: Consolas, "Courier New", monospace;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}

kbd {
    display: inline-block;
    padding: 1px 6px;
    font-family: Consolas, monospace;
    font-size: 0.85em;
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-bottom-width: 2px;
    border-radius: 4px;
}

/* --- Topbar --- */
.topbar {
    background: var(--color-primary);
    color: white;
    padding: 0;
    box-shadow: var(--shadow);
}
.topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.brand {
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
}
.brand:hover { text-decoration: none; opacity: 0.9; }

.user-info {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.9rem;
}
.user-email { opacity: 0.9; }

.btn-link {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.4);
    color: white;
    padding: 4px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.85rem;
    font-family: inherit;
}
.btn-link:hover { background: rgba(255,255,255,0.1); }

/* --- Main --- */
.main-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* --- Footer --- */
.footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--color-muted);
    font-size: 0.85rem;
}

/* --- Flashes --- */
.flashes {
    max-width: 1100px;
    margin: 0 auto;
    padding: 12px 20px 0;
}
.flash {
    padding: 10px 16px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    font-size: 0.95rem;
}
.flash-success { background: #e8f5e9; color: var(--color-success); border: 1px solid #c8e6c9; }
.flash-error   { background: #fdecea; color: var(--color-error);   border: 1px solid #f5c6cb; }
.flash-warn    { background: #fff8e1; color: var(--color-warn);    border: 1px solid #ffe082; }
.flash-info    { background: #e3f2fd; color: var(--color-primary); border: 1px solid #bbdefb; }

.muted { color: var(--color-muted); }

/* --- Login --- */
.login-box {
    max-width: 420px;
    margin: 60px auto;
    background: var(--color-bg-card);
    padding: 40px 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    text-align: center;
}
.login-box h1 {
    margin-top: 0;
    color: var(--color-primary);
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    font-family: inherit;
}
.btn-google {
    background: white;
    color: var(--color-text);
    border: 1px solid var(--color-border);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    margin: 10px 0;
}
.btn-google:hover { 
    background: #f8f8f8; 
    text-decoration: none;
    box-shadow: var(--shadow);
}

.dev-notice {
    margin-top: 24px;
    padding: 12px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: var(--radius);
    font-size: 0.85rem;
    color: #5d4b00;
    text-align: left;
}

/* ============================================
   TOOLBAR (search + filtry)
   ============================================ */

.toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.search-wrap {
    position: relative;
    flex: 1;
    min-width: 240px;
    max-width: 500px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-muted);
    font-size: 0.9rem;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 10px 36px 10px 36px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-bg-card);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.search-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
}

.search-clear {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--color-muted);
    font-size: 1.4rem;
    line-height: 1;
    padding: 4px 10px;
    cursor: pointer;
    border-radius: 4px;
}
.search-clear:hover { background: #f0f0f0; color: var(--color-text); }

.toolbar-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.result-count {
    font-size: 0.9rem;
    color: var(--color-muted);
}

.clear-filters {
    padding: 6px 12px;
}

/* Tag chips */
.tag-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
    padding: 2px 0;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-card);
    border-radius: 16px;
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.15s;
}
.tag-chip:hover {
    border-color: var(--color-primary);
    background: var(--color-tag-bg);
}
.tag-chip.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.tag-chip .tag-count {
    background: rgba(0, 0, 0, 0.08);
    color: inherit;
    font-size: 0.75rem;
    padding: 0 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}
.tag-chip.active .tag-count {
    background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   DASHBOARD - QUICK NOTES
   ============================================ */

/* --- Input pro novou poznámku --- */
.note-input-wrap {
    max-width: 600px;
    margin: 0 auto 30px;
}

.note-input {
    background: var(--color-bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 12px 16px;
    transition: box-shadow 0.15s;
}

.note-input-wrap.expanded .note-input {
    box-shadow: var(--shadow-md);
}

.note-input-title,
.note-input-content,
.note-input-tags {
    width: 100%;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 1rem;
    background: transparent;
    color: var(--color-text);
    padding: 4px 0;
    resize: none;
}

.note-input-title {
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 4px;
}

.note-input-content {
    line-height: 1.5;
    min-height: 24px;
    overflow: hidden;
}

.note-input-tags {
    font-size: 0.85rem;
    color: var(--color-muted);
    border-top: 1px solid var(--color-border);
    padding-top: 8px;
    margin-top: 8px;
}

.note-input-actions {
    margin-top: 10px;
}

.note-input-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}

.btn-text {
    background: transparent;
    border: none;
    color: var(--color-muted);
    padding: 8px 14px;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
}
.btn-text:hover { background: #f0f0f0; color: var(--color-text); }
.btn-text.btn-danger { color: var(--color-error); }
.btn-text.btn-danger:hover { background: #fdecea; }

.btn-primary {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
}
.btn-primary:hover { background: var(--color-primary-dk); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.input-hint {
    text-align: center;
    font-size: 0.8rem;
    color: var(--color-muted);
    margin: 8px 0 0;
}

/* --- Notes Grid --- */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.note-card {
    background: var(--color-bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    cursor: pointer;
    transition: box-shadow 0.15s, transform 0.15s;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px solid transparent;
}

.note-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--color-border);
}

.note-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--color-text);
    word-break: break-word;
}

.note-content {
    font-size: 0.95rem;
    color: #444;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.4;
}

.note-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.tag {
    background: var(--color-tag-bg);
    color: var(--color-tag-text);
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.note-meta {
    margin-top: auto;
    padding-top: 6px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--color-muted);
}

/* --- Empty state --- */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--color-muted);
}
.empty-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}
.empty-state h3 {
    color: var(--color-text);
    margin: 10px 0 4px;
}

/* ============================================
   MODAL
   ============================================ */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.15s ease;
}

.modal-backdrop[hidden] { display: none; }

.modal {
    background: var(--color-bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.2s ease;
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}
.modal-close {
    background: transparent;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--color-muted);
    cursor: pointer;
    padding: 0 4px;
    border-radius: 4px;
}
.modal-close:hover { background: #f0f0f0; color: var(--color-text); }

.modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
}
.modal-body .note-input-title {
    font-size: 1.1rem;
    padding: 6px 0;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 12px;
}
.modal-body .edit-textarea {
    font-size: 1rem;
    min-height: 120px;
    resize: vertical;
    overflow: auto;
    padding: 8px 0;
    line-height: 1.5;
    width: 100%;
    border: none;
    outline: none;
    font-family: inherit;
}
.modal-body .note-input-tags {
    border-top: 1px solid var(--color-border);
    margin-top: 12px;
    padding-top: 10px;
}

.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

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

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 600px) {
    .topbar-inner { padding: 10px 14px; }
    .main-content { padding: 20px 14px; }
    .brand span { display: none; }
    .user-email { display: none; }
    .login-box { margin: 30px 14px; padding: 30px 20px; }
    
    .notes-grid {
        grid-template-columns: 1fr;
    }
    
    .modal {
        max-height: 95vh;
    }
    
    .toolbar {
        gap: 8px;
    }
    .search-wrap {
        min-width: 100%;
    }
    .toolbar-info {
        margin-left: 0;
    }
}

/* ============================================
   APP LAYOUT (sidebar + main)
   ============================================ */

.app-layout {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - 130px);
}

.sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--color-bg-card);
    border-right: 1px solid var(--color-border);
    padding: 20px 14px;
    overflow-y: auto;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--color-text);
    font-size: 0.95rem;
    transition: background 0.15s;
}
.sidebar-link:hover {
    text-decoration: none;
    background: #f0f0f0;
}
.sidebar-link.active {
    background: var(--color-tag-bg);
    color: var(--color-primary);
    font-weight: 500;
}

.sidebar-icon {
    font-size: 1.15rem;
    flex-shrink: 0;
}

.sidebar-notebooks {
    margin-top: 8px;
    padding-left: 12px;
    border-left: 2px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-notebook {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: var(--radius);
    color: var(--color-text);
    font-size: 0.88rem;
    transition: background 0.15s;
}
.sidebar-notebook:hover {
    text-decoration: none;
    background: #f0f0f0;
}
.sidebar-notebook.active {
    background: var(--color-tag-bg);
    font-weight: 500;
}

.notebook-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--color-muted);
}
.notebook-color-dot.large {
    width: 16px;
    height: 16px;
}

.notebook-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-layout > .main-content {
    flex: 1;
    max-width: none;
    padding: 30px 30px;
    min-width: 0;
}

.sidebar-toggle {
    display: none;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.4);
    color: white;
    padding: 4px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1.1rem;
    margin-right: 12px;
}
.sidebar-toggle:hover { background: rgba(255,255,255,0.1); }

/* ============================================
   NOTEBOOKS PAGE
   ============================================ */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 10px;
}
.page-header h1 {
    margin: 0;
    color: var(--color-primary);
}

.notebooks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.notebook-card {
    --notebook-color: #6c757d;
    background: var(--color-bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: box-shadow 0.15s, transform 0.15s;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}
.notebook-card:hover {
    box-shadow: var(--shadow-md);
    text-decoration: none;
    transform: translateY(-2px);
}

.notebook-card-bar {
    height: 6px;
    background: var(--notebook-color);
}

.notebook-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.notebook-card-title {
    margin: 0;
    font-size: 1.05rem;
    color: var(--color-text);
    word-break: break-word;
}

.notebook-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--color-border);
}

.notebook-count {
    font-size: 0.85rem;
    color: var(--color-muted);
}

.notebook-card-edit {
    background: transparent;
    border: none;
    color: var(--color-muted);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px 10px;
    border-radius: 4px;
    line-height: 1;
}
.notebook-card-edit:hover {
    background: #f0f0f0;
    color: var(--color-text);
}

/* ============================================
   NOTEBOOK DETAIL
   ============================================ */

.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}
.breadcrumb a {
    color: var(--color-muted);
}
.breadcrumb a:hover { color: var(--color-primary); }
.breadcrumb-sep {
    color: var(--color-muted);
}
.breadcrumb-current {
    color: var(--color-text);
    font-weight: 500;
}

.detail-header {
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 16px;
    margin-bottom: 24px;
}

.detail-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    color: var(--color-text);
    word-break: break-word;
}

.detail-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.section-heading {
    font-size: 1rem;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 24px 0 12px;
    font-weight: 500;
}

.sections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.section-card {
    background: var(--color-bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-text);
    transition: box-shadow 0.15s, background 0.15s;
    border-left: 3px solid var(--notebook-color, #6c757d);
}
.section-card:hover {
    text-decoration: none;
    box-shadow: var(--shadow-md);
    background: #fafafa;
}
.section-card-icon {
    font-size: 1.3rem;
}
.section-card-title {
    font-weight: 500;
    word-break: break-word;
    flex: 1;
}

/* Quick notes grid reuse for notebook notes */
.notebook-detail .notes-grid .note-card {
    border-left: 3px solid var(--notebook-color, transparent);
}

.detail-footer-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
    flex-wrap: wrap;
}

.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
    padding: 8px 16px;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
}
.btn-outline:hover {
    background: var(--color-tag-bg);
}

/* ============================================
   FORM INPUTS (modals)
   ============================================ */

.form-label {
    display: block;
    font-size: 0.85rem;
    color: var(--color-muted);
    margin-bottom: 4px;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.15s;
}
.form-input:focus {
    border-color: var(--color-primary);
}

/* ============================================
   COLOR PALETTE (pro sešity)
   ============================================ */

.color-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s;
    padding: 0;
}
.color-swatch:hover {
    transform: scale(1.1);
}
.color-swatch.active {
    border-color: var(--color-text);
    transform: scale(1.1);
}

/* ============================================
   RESPONSIVE (sidebar collapse)
   ============================================ */

@media (max-width: 900px) {
    .sidebar-toggle {
        display: inline-block;
    }
    
    .sidebar {
        position: fixed;
        top: 54px; /* pod topbarem */
        left: 0;
        bottom: 0;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        box-shadow: var(--shadow-lg);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    
    .app-layout > .main-content {
        padding: 20px 16px;
    }
}

@media (max-width: 600px) {
    .sections-grid {
        grid-template-columns: 1fr 1fr;
    }
    .notebooks-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   MODAL - rozšířené funkce (expand, header actions)
   ============================================ */

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.modal-action {
    background: transparent;
    border: none;
    font-size: 1.15rem;
    line-height: 1;
    color: var(--color-muted);
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
}
.modal-action:hover {
    background: #f0f0f0;
    color: var(--color-text);
}
.modal-action:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Expanded modal - na celou obrazovku */
.modal.modal-expanded {
    max-width: 95vw;
    width: 95vw;
    max-height: 95vh;
    height: 95vh;
}

.modal.modal-expanded .modal-body {
    display: flex;
    flex-direction: column;
}

.modal.modal-expanded .edit-textarea {
    flex: 1;
    min-height: 50vh;
}

/* ============================================
   PRINT STYLES
   ============================================ */

/* Preview div - skrytý na obrazovce, viditelný v tisku */
.print-preview {
    display: none;
}

@media print {
    /* Skrýt úplně vše */
    body > * {
        display: none !important;
    }
    
    /* Zobrazit pouze print-preview */
    #print-preview {
        display: block !important;
        font-family: Arial, sans-serif;
        color: #000;
        background: white;
        padding: 0;
        margin: 0;
    }
    
    .print-title {
        font-size: 18pt;
        font-weight: bold;
        color: #000;
        margin: 0 0 10pt 0;
        padding-bottom: 6pt;
        border-bottom: 1.5pt solid #2c5aa0;
    }
    
    .print-content {
        font-size: 11pt;
        line-height: 1.6;
        white-space: pre-wrap;
        margin-top: 12pt;
    }
    
    .print-tags {
        font-size: 9pt;
        color: #666;
        margin-top: 16pt;
        padding-top: 6pt;
        border-top: 0.5pt solid #ccc;
    }
    
    @page {
        margin: 2cm;
    }
}

/* ============================================
   CHECKLIST - quick notes
   ============================================ */

/* Karta checklistu */
.note-card-checklist .note-content { display: none; }

.checklist-preview {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 2px 0;
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.92rem;
    line-height: 1.35;
    padding: 2px 0;
    word-break: break-word;
    cursor: default;
}

.checklist-item.checked .checklist-text {
    text-decoration: line-through;
    color: var(--color-muted);
}

.checklist-checkbox {
    flex-shrink: 0;
    font-size: 1.05rem;
    line-height: 1;
    color: var(--color-primary);
    user-select: none;
    cursor: pointer;
    padding: 1px 2px;
    border-radius: 3px;
    transition: background 0.1s;
}
.checklist-checkbox:hover {
    background: var(--color-tag-bg);
}

.checklist-item.checked .checklist-checkbox {
    color: var(--color-success);
}

.checklist-text {
    flex: 1;
    min-width: 0;
}

.checklist-more {
    font-size: 0.8rem;
    margin-top: 4px;
    padding-top: 2px;
}

.checklist-empty {
    font-size: 0.9rem;
    font-style: italic;
}

/* Mode toggle tlačítka (vedle Hotovo/Zrušit) */
.btn-mode-toggle {
    background: transparent;
    border: 1px solid transparent;
    color: var(--color-muted);
    padding: 4px 10px;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
}
.btn-mode-toggle:hover {
    background: #f0f0f0;
    color: var(--color-text);
}
.btn-mode-toggle.active {
    background: var(--color-tag-bg);
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.note-input-buttons .spacer {
    flex: 1;
}

.note-input-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
}

/* Mode switching - skryje neaktivní režim */
.note-input-wrap[data-mode="text"] .checklist-mode-only,
.modal[data-mode="text"] .checklist-mode-only {
    display: none !important;
}
.note-input-wrap[data-mode="checklist"] .text-mode-only,
.modal[data-mode="checklist"] .text-mode-only {
    display: none !important;
}

/* Editor checklistu */
.new-checklist-items,
.edit-checklist-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 4px;
}

.editable-checklist-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.editable-checklist-item .checklist-checkbox-btn {
    background: transparent;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 2px 4px;
    color: var(--color-primary);
    flex-shrink: 0;
}

.editable-checklist-item .checklist-edit-input {
    flex: 1;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 0.95rem;
    padding: 4px 0;
    background: transparent;
    color: var(--color-text);
}

.editable-checklist-item.checked .checklist-edit-input {
    text-decoration: line-through;
    color: var(--color-muted);
}
.editable-checklist-item.checked .checklist-checkbox-btn {
    color: var(--color-success);
}

.editable-checklist-item .checklist-remove-btn {
    background: transparent;
    border: none;
    color: transparent;
    cursor: pointer;
    font-size: 1rem;
    padding: 2px 8px;
    border-radius: 4px;
    flex-shrink: 0;
}
.editable-checklist-item:hover .checklist-remove-btn {
    color: var(--color-muted);
}
.editable-checklist-item .checklist-remove-btn:hover {
    color: var(--color-error);
    background: #fdecea;
}

.new-checklist-add {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0 2px;
    border-top: 1px solid var(--color-border);
    margin-top: 4px;
}

.checklist-checkbox-static {
    font-size: 1.1rem;
    color: var(--color-muted);
    flex-shrink: 0;
}

.new-checklist-input-field {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.95rem;
    padding: 4px 0;
    color: var(--color-text);
}
.new-checklist-input-field::placeholder {
    color: var(--color-muted);
}

/* ============================================
   SEARCH V SEŠITECH - path breadcrumb u výsledků
   ============================================ */

.search-result-path {
    font-size: 0.75rem;
    color: var(--color-muted);
    padding: 2px 6px;
    background: #f5f5f5;
    border-radius: 4px;
    margin-bottom: 4px;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-card {
    border-left: 3px solid var(--notebook-color, #2c5aa0);
}

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

.reminder-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0 4px;
    margin-top: 8px;
    border-top: 1px solid var(--color-border);
    flex-wrap: wrap;
}

.reminder-label {
    font-size: 0.9rem;
    color: var(--color-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.reminder-icon {
    font-size: 1.05rem;
}

.reminder-input {
    padding: 6px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.9rem;
    background: white;
    color: var(--color-text);
    outline: none;
}
.reminder-input:focus {
    border-color: var(--color-primary);
}

.reminder-clear {
    background: transparent;
    border: none;
    color: var(--color-error);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}
.reminder-clear:hover {
    background: #fdecea;
}

.reminder-status {
    font-size: 0.8rem;
    color: var(--color-muted);
}
.reminder-status.active {
    color: var(--color-primary);
    font-weight: 500;
}

/* Reminder badge na kartě */
.note-reminder-badge {
    font-size: 0.72rem;
    background: #fff3cd;
    color: #7a5d00;
    padding: 1px 7px;
    border-radius: 10px;
    border: 1px solid #ffe082;
    white-space: nowrap;
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Admin sekce v sidebaru */
.sidebar-admin {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

.sidebar-admin-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--color-muted);
    cursor: pointer;
    text-align: left;
}
.sidebar-admin-btn:hover {
    background: #f0f0f0;
    color: var(--color-text);
}
.sidebar-admin-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.draft-status {
    font-size: 0.82rem;
    color: #46566b;
    margin: 8px 16px;
}
.draft-status:empty { display: none; }
.library-page, .note-detail-page { max-width: 980px; margin: 0 auto; }
.library-search { display: grid; gap: 10px; max-width: 680px; margin: 24px 0; }
.library-results { display: grid; gap: 14px; }
.library-result { background: #fff; border: 1px solid #e2e6eb; border-radius: 12px; padding: 18px; overflow-wrap: anywhere; }
.library-result h2 { margin: 8px 0; font-size: 1.1rem; }
.library-path { color: #52657d; font-size: .85rem; overflow-wrap: anywhere; }
.library-preview { white-space: pre-wrap; margin: 12px 0; }
.library-pagination, .detail-buttons, .detail-add-row { display: flex; gap: 12px; align-items: center; margin: 18px 0; flex-wrap: wrap; }
.detail-add-row > .form-input { flex: 1; min-width: 180px; }
.note-detail-page form { background: #fff; padding: 24px; border: 1px solid #e2e6eb; border-radius: 12px; }
.note-detail-page .form-label { display: block; margin: 16px 0 8px; }
.detail-content { resize: vertical; min-height: 280px; }
.detail-checklist-row { display: flex; gap: 12px; align-items: center; margin: 10px 0; }
.detail-checklist-row input[type=checkbox] { width: 24px; height: 24px; flex-shrink: 0; }
.detail-checklist-row input[type=checkbox]:checked + input { text-decoration: line-through; color: #667085; }
.detail-checklist-row .form-input { flex: 1; min-width: 0; }
.note-detail-link { color: #2c5aa0; font-size: .8rem; }
.note-meta { flex-wrap: wrap; gap: 8px; }
@media (max-width: 600px) {
    .note-detail-page form { padding: 14px; }
    .detail-add-row > .form-input { width: 100%; }
    .detail-buttons > * { text-align: center; }
}
