/* dashboard.css — vytaženo z inline <style> bloků dashboard.html (cache mezi návštěvami) */
    /* === PRO EMAIL MODAL === */
    /* === PRO EMAIL MODAL === */
    .pro-modal {
      padding: 12px;
      overflow: hidden;
      border-radius: 20px;
      box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
      max-height: min(920px, 90vh);
      display: flex;
      flex-direction: column;
      gap: 10px;
      background: linear-gradient(160deg, rgba(14, 165, 233, 0.18) 0%, rgba(59, 130, 246, 0.14) 48%, rgba(99, 102, 241, 0.12) 100%);
    }

    .pro-modal__header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: .85rem;
      padding: 12px 16px;
      background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 60%, #6366f1 100%);
      color: #fff;
      border-radius: 16px;
      box-shadow: 0 6px 20px rgba(14, 116, 233, 0.28);
    }

    .pro-modal__id {
      display: flex;
      align-items: center;
      gap: 12px;
      min-width: 0;
    }

    .pro-headings {
      min-width: 0;
    }

    .pro-title {
      font-weight: 700;
      font-size: 1.1rem;
      line-height: 1.25;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .pro-subtitle {
      opacity: .95;
      font-size: .9rem;
      display: flex;
      align-items: center;
      gap: .5rem;
      flex-wrap: wrap;
      row-gap: .25rem;
    }

    .pro-subtitle span {
      min-width: 0;
      overflow-wrap: anywhere;
    }

    .pro-dot {
      opacity: .75;
      flex-shrink: 0;
    }

    .pro-avatar {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      display: grid;
      place-items: center;
      background: rgba(255, 255, 255, .2);
      border: 1px solid rgba(255, 255, 255, .35);
      font-weight: 700;
      backdrop-filter: blur(6px);
    }

    .pro-actions {
      display: flex;
      align-items: center;
      gap: .5rem;
    }

    .pro-chip {
      background: rgba(255, 255, 255, .18);
      border-color: rgba(255, 255, 255, .35);
      color: #fff;
    }

    .pro-chip:hover {
      background: rgba(255, 255, 255, .28);
    }

    .pro-close {
      margin-left: .25rem;
      width: 36px;
      height: 36px;
      border-radius: 10px;
      background: rgba(255, 255, 255, .15);
      border: 1px solid rgba(255, 255, 255, .35);
      color: #fff;
      cursor: pointer;
    }

    .pro-close:hover {
      background: rgba(255, 255, 255, .28);
    }

    .pro-modal__body {
      padding: 16px 18px 18px;
      display: grid;
      grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
      gap: 18px;
      flex: 1;
      min-height: 0;
      align-items: stretch;
      background: #ffffff;
      border-radius: 18px;
      box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
      overflow: hidden;
    }

    .pro-modal__body>* {
      min-width: 0;
    }

    @media (max-width: 1080px) {
      .pro-modal__body {
        grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
      }
    }

    @media (max-width: 860px) {
      .pro-modal__body {
        grid-template-columns: 1fr;
        gap: 16px;
        overflow-y: auto;
      }
    }

    .pro-sidebar {
      display: flex;
      flex-direction: column;
      gap: 16px;
      background: #f8fafc;
      border: 1px solid rgba(148, 163, 184, 0.28);
      border-radius: 16px;
      padding: 14px;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
    }

    .pro-sidebar .pro-meta {
      border: none;
      background: transparent;
      padding: 0;
      box-shadow: none;
    }

    .pro-content {
      display: flex;
      flex-direction: column;
      gap: 18px;
      min-height: 0;
      overflow-y: auto;
      padding-right: 4px;
      scrollbar-gutter: stable both-edges;
    }

    .pro-content::-webkit-scrollbar {
      width: 10px;
    }

    .pro-content::-webkit-scrollbar-thumb {
      background: rgba(148, 163, 184, 0.45);
      border-radius: 8px;
    }

    .pro-content::-webkit-scrollbar-track {
      background: rgba(241, 245, 249, 0.8);
      border-radius: 8px;
    }

    .pro-body-card--email {
      flex: 1 1 auto;
      min-height: 0;
    }

    .pro-body-card--ai {
      flex: 0 0 auto;
    }

    .ai-inline-card {
      position: sticky;
      bottom: 0;
      z-index: 5;
      box-shadow: 0 -16px 30px rgba(15, 23, 42, 0.12);
      border: 1px solid rgba(148, 163, 184, 0.35);
    }

    .ai-inline-card::before {
      content: "";
      position: absolute;
      inset: 0;
      background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #ffffff 40%);
      pointer-events: none;
      border-radius: inherit;
      opacity: 0.92;
    }

    .ai-inline-card .pro-body-card__content {
      position: relative;
      z-index: 1;
    }

    @media (max-width: 860px) {
      .pro-sidebar {
        background: transparent;
        border: none;
        padding: 0;
        box-shadow: none;
      }

      .pro-content {
        overflow: visible;
        padding-right: 0;
      }

      .ai-inline-card {
        position: static;
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
      }

      .ai-inline-card::before {
        display: none;
      }
    }


    .pro-meta {
      background: #f8fafc;
      border: 1px solid rgba(148, 163, 184, 0.35);
      border-radius: 14px;
      padding: 10px 12px;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
    }

    .pro-meta__row {
      display: grid;
      grid-template-columns: 108px 1fr;
      gap: 10px;
      padding: 10px 6px;
      align-items: start;
    }

    .pro-meta__label {
      font-size: .8rem;
      color: #64748b;
    }

    .pro-meta__value {
      font-size: .95rem;
      color: #0f172a;
      word-break: break-word;
      overflow-wrap: anywhere;
    }

    .pro-body-card {
      background: #ffffff;
      border: 1px solid rgba(148, 163, 184, 0.35);
      border-radius: 14px;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      min-height: 0;
      box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    }

    .pro-body-card__title {
      padding: 12px 16px;
      font-weight: 600;
      color: #0f172a;
      background: #f8fafc;
      border-bottom: 1px solid rgba(148, 163, 184, 0.35);
    }

    .pro-body-card__content {
      padding: 18px 16px;
      white-space: pre-wrap;
      line-height: 1.55;
      color: #111827;
      min-height: 0;
    }

    #ed-body {
      overflow-y: auto;
      max-height: clamp(360px, calc(74vh - 220px), 620px);
      min-height: clamp(280px, 38vh, 520px);
      padding-right: 6px;
      scrollbar-gutter: stable both-edges;
    }

    @media (max-width: 860px) {
      #ed-body {
        max-height: none;
      }
    }

    .pro-modal__footer {
      padding: 12px 18px;
      display: flex;
      justify-content: flex-end;
      gap: 10px;
      border-top: 1px solid #e5e7eb;
      background: #fff;
    }

    /* drobnosti */
    #emailDetailModal .btn {
      border-radius: 10px;
      padding: 8px 12px;
    }

    #emailDetailModal.show .modal {
      transform: translateY(0);
      opacity: 1;
      transition: .28s ease;
    }

    #emailDetailModal .modal {
      transform: translateY(8px);
      opacity: 0;
    }








    .toast .toast-action:hover {
      opacity: .9;
    }

    /* === STYLY PRO NOVÉ MODÁLNÍ OKNO === */
    .modal-overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.6);
      backdrop-filter: blur(4px);
      display: none;
      /* Skryté ve výchozím stavu */
      align-items: center;
      justify-content: center;
      z-index: 2000;
      opacity: 0;
      transition: opacity 0.3s ease;
    }

    .email-item {
      cursor: pointer;
    }

    .email-item .analyze-btn {
      cursor: default;
    }

    #emailDetailModal {
      z-index: 2050;
    }

    #emailDetailModal .modal-body {
      max-height: calc(90vh - 160px);
      overflow: auto;
    }

    #analysisModal {
      z-index: 2000;
    }

    #templatePicker {
      z-index: 2100;
    }

    .modal-overlay.show {
      opacity: 1;
      display: flex;
    }

    .modal {
      background: white;
      border-radius: 20px;
      width: 94%;
      max-width: 1040px;
      box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
      transform: scale(0.95);
      transition: transform 0.3s ease;
      display: flex;
      flex-direction: column;
      max-height: 90vh;
    }

    .modal-overlay.show .modal {
      transform: scale(1);
    }

    .modal-header {
      padding: 1.5rem 2rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1px solid #e2e8f0;
      flex-shrink: 0;
    }

    .modal-title {
      font-size: 1.5rem;
      font-weight: 700;
      color: #1e293b;
      display: flex;
      align-items: center;
      gap: 0.75rem;
    }

    .modal-close {
      background: none;
      border: none;
      font-size: 1.5rem;
      color: #64748b;
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .modal-close:hover {
      color: #1e293b;
      transform: rotate(90deg);
    }

    .modal-body {
      padding: 2rem;
      overflow-y: auto;
    }

    .modal-footer {
      padding: 1.5rem 2rem;
      display: flex;
      gap: 1rem;
      justify-content: flex-end;
      border-top: 1px solid #e2e8f0;
      background: #f8fafc;
      border-radius: 0 0 20px 20px;
      flex-shrink: 0;
    }

    .list-action-group {
      display: flex;
      flex-direction: column;
      gap: 6px;
      align-items: flex-end;
    }

    .list-action-group .btn {
      width: 190px;
    }

    @keyframes pulse-red {
      0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
        transform: scale(1);
      }

      50% {
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
        transform: scale(1.08);
      }

      100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
        transform: scale(1);
      }
    }

    button.quick-action {
      background: #f1f5f9;
      color: #0f172a;
      border: 1px solid #e2e8f0;
    }

    .quick-ai-btn:hover {
      background: #e2e8f0;
      color: #0f172a;
    }

    .ai-composer-overlay {
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.45);
      backdrop-filter: blur(6px);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 2300;
      transition: opacity .25s ease;
      opacity: 0;
      padding: 1.5rem;
    }

    .ai-composer-overlay.show {
      display: flex;
      opacity: 1;
    }

    .ai-composer-panel {
      width: min(960px, 96vw);
      background: #ffffff;
      border-radius: 24px;
      box-shadow: 0 20px 60px rgba(15, 23, 42, 0.22);
      overflow: hidden;
      transform: translateY(12px);
      transition: transform .25s ease;
      display: flex;
      flex-direction: column;
      max-height: 90vh;
    }

    .ai-composer-overlay.show .ai-composer-panel {
      transform: translateY(0);
    }

    .ai-composer-header {
      padding: 1.5rem 2rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
    }

    .ai-composer-title {
      font-size: 1.4rem;
      font-weight: 700;
      color: #1e1b4b;
      display: flex;
      align-items: center;
      gap: .65rem;
    }

    .ai-composer-title span {
      font-size: 1.6rem;
    }

    .ai-composer-context {
      color: #4338ca;
      font-weight: 500;
      font-size: .95rem;
    }

    .ai-composer-close {
      border: none;
      background: rgba(255, 255, 255, 0.65);
      color: #4338ca;
      width: 42px;
      height: 42px;
      border-radius: 14px;
      display: grid;
      place-items: center;
      font-size: 1.4rem;
      cursor: pointer;
      transition: .2s ease;
    }

    .ai-composer-close:hover {
      background: rgba(255, 255, 255, 0.9);
      transform: rotate(90deg);
    }

    .ai-composer-body {
      padding: 1.75rem 2rem;
      overflow: auto;
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 1.4rem;
    }

    .ai-composer-note {
      padding: 1rem 1.25rem;
      background: #e2e8f0;
      border-radius: 16px;
      color: #334155;
      font-size: .95rem;
      line-height: 1.5;
    }

    .ai-composer-field label {
      display: block;
      font-weight: 600;
      margin-bottom: .5rem;
      color: #0f172a;
    }

    .ai-composer-field textarea {
      width: 100%;
      border: 1px solid #e2e8f0;
      border-radius: 14px;
      padding: 1rem 1.1rem;
      font-size: 1rem;
      line-height: 1.6;
      resize: vertical;
      min-height: 120px;
      background: #f8fafc;
    }

    .ai-composer-field textarea:focus {
      outline: none;
      border-color: #818cf8;
      box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
      background: #fff;
    }

    .ai-composer-select {
      width: 100%;
      border: 1px solid #e2e8f0;
      border-radius: 12px;
      padding: .75rem;
      font-size: .95rem;
      background: #fff;
      color: #0f172a;
    }

    .ai-composer-tag {
      font-size: .85rem;
      color: #475569;
      background: #e2e8f0;
      padding: .4rem .7rem;
      border-radius: 999px;
      display: inline-flex;
      align-items: center;
      gap: .35rem;
    }

    .ai-composer-profile {
      color: #64748b;
      font-size: .9rem;
    }

    .ai-composer-status {
      font-size: .9rem;
      color: #334155;
    }

    .ai-composer-loader {
      width: 44px;
      height: 44px;
      border-radius: 50%;
      border: 4px solid #e2e8f0;
      border-top-color: #6366f1;
      animation: spin 1s linear infinite;
      margin: 1rem auto;
    }

    .ai-composer-result {
      border: 1px solid #e2e8f0;
      border-radius: 16px;
      background: #f8fafc;
      padding: 1rem;
      display: none;
      flex-direction: column;
      gap: .75rem;
    }

    .ai-composer-result.show {
      display: flex;
    }

    .ai-composer-result textarea {
      width: 100%;
      border: none;
      background: transparent;
      resize: vertical;
      min-height: 220px;
      line-height: 1.6;
      font-size: .97rem;
      color: #0f172a;
    }

    .ai-composer-result textarea:focus {
      outline: none;
    }

    .ai-composer-result-actions {
      display: flex;
      justify-content: flex-end;
      gap: .75rem;
    }

    .ai-composer-footer {
      padding: 1.25rem 2rem 2rem;
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 1rem;
      flex-wrap: wrap;
    }

    .ai-composer-footer .btn-primary {
      min-width: 180px;
    }

    .ai-inline-card {
      grid-column: 1 / -1;
      position: relative;
      width: 100%;
      max-width: none;
      align-self: stretch;
      min-height: clamp(300px, 44vh, 500px);
      display: flex;
      flex-direction: column;
    }

    .ai-inline-card .pro-body-card__title {
      display: flex;
      align-items: center;
      gap: .75rem;
    }

    .ai-inline-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 32px;
      height: 32px;
      border-radius: 10px;
      background: linear-gradient(135deg, #6366f1, #8b5cf6);
      color: #fff;
      font-size: 1.15rem;
    }

    .ai-inline-content {
      display: flex;
      gap: 1.25rem;
      align-items: stretch;
      flex: 1;
      min-height: 0;
      flex-wrap: wrap;
    }

    .ai-inline-main {
      display: flex;
      flex-direction: column;
      gap: .75rem;
      min-width: 260px;
      min-height: 0;
      flex: 1 1 340px;
    }

    .ai-inline-lead {
      font-size: .95rem;
      color: #475569;
      line-height: 1.55;
    }

    .ai-inline-input {
      min-height: clamp(160px, 28vh, 360px);
      resize: vertical;
      background: #f8fafc;
      border: 1px solid #dbe3f3;
      border-radius: 14px;
      padding: 1rem 1.1rem;
      line-height: 1.6;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
      transition: border-color .2s ease, box-shadow .2s ease;
      flex: 1;
      min-width: 0;
    }

    .ai-inline-input:focus {
      outline: none;
      border-color: #818cf8;
      box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
      background: #fff;
    }

    .ai-inline-side {
      display: flex;
      flex-direction: column;
      gap: 1rem;
      background: #f1f5f9;
      border: 1px solid #e2e8f0;
      border-radius: 16px;
      padding: 1.1rem 1.25rem;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
      min-width: 260px;
      align-self: stretch;
      flex: 1 1 260px;
    }

    .ai-inline-hint {
      background: rgba(99, 102, 241, 0.08);
      border: 1px solid rgba(99, 102, 241, 0.18);
      border-radius: 12px;
      padding: 1rem 1.15rem;
      color: #312e81;
      line-height: 1.5;
    }

    .ai-inline-hint-title {
      display: block;
      font-weight: 600;
      margin-bottom: .55rem;
      font-size: .92rem;
      color: #1e1b4b;
    }

    .ai-inline-list {
      margin: 0;
      padding-left: 1.1rem;
      display: flex;
      flex-direction: column;
      gap: .45rem;
      font-size: .9rem;
      color: #4338ca;
    }

    .ai-inline-button {
      width: 100%;
      display: inline-flex;
      justify-content: center;
      gap: .5rem;
      font-weight: 600;
      box-shadow: 0 12px 25px rgba(99, 102, 241, 0.18);
      align-self: flex-start;
    }

    .ai-inline-note {
      font-size: .85rem;
      color: #475569;
      text-align: center;
    }

    @media (min-width: 720px) {
      .ai-inline-content {
        flex-wrap: nowrap;
        min-height: clamp(360px, 48vh, 560px);
      }
    }

    @media (max-width: 719px) {
      .ai-inline-side {
        padding: 1rem;
      }

      .ai-inline-button {
        width: auto;
        align-self: flex-start;
      }

      .ai-inline-note {
        text-align: left;
      }
    }

    .analysis-section {
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.1);
      backdrop-filter: blur(10px);
      border-radius: 16px;
      padding: 1.5rem;
      margin-bottom: 1.5rem;
    }

    .section-header {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      margin-bottom: 1rem;
    }

    .section-icon {
      font-size: 1.5rem;
    }

    .section-title {
      font-size: 1.2rem;
      font-weight: 600;
      color: #ffffff;
    }

    .section-content {
      color: #cbd5e1;
      line-height: 1.6;
      font-size: 0.95rem;
    }

    .response-section {
      padding: 1.5rem 0;
    }

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

    .response-title {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      font-size: 1.3rem;
      font-weight: 700;
      color: #ffffff;
    }

    .response-content {
      background: rgba(0, 0, 0, 0.2);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 12px;
      padding: 1.5rem;
      color: #ecf0f1;
      line-height: 1.7;
      font-size: 0.95rem;
      white-space: pre-wrap;
    }

    .btn-success {
      background: #22c55e;
      color: white;
    }

    .loading {
      display: inline-block;
      width: 40px;
      height: 40px;
      border: 4px solid #f3f3f3;
      border-top: 4px solid #667eea;
      border-radius: 50%;
      animation: spin 1s linear infinite;
    }

    .usage-panel {
      margin-top: 1rem;
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.1);
      backdrop-filter: blur(10px);
      border-radius: 16px;
      padding: 1.25rem;
    }

    .usage-title {
      margin: 0 0 1rem 0;
      color: #ffffff;
      font-weight: 600;
    }

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

    .usage-card {
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 12px;
      padding: 1rem;
      transition: .2s ease;
      background: rgba(255, 255, 255, 0.03);
    }

    .usage-card:hover {
      border-color: #667eea;
      box-shadow: 0 8px 25px rgba(102, 126, 234, .15);
      transform: translateY(-2px);
    }

    .usage-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: .5rem;
    }

    .usage-name {
      font-weight: 600;
      color: #ffffff;
    }

    .usage-count {
      font-weight: 700;
      color: #ffffff;
    }

    .usage-bar {
      width: 100%;
      height: 10px;
      background: #e5e7eb;
      border-radius: 999px;
      overflow: hidden;
    }

    .usage-bar-fill {
      height: 100%;
      background: linear-gradient(90deg, #667eea, #764ba2);
      width: 0%;
      transition: width .4s ease;
    }

    .usage-foot {
      margin-top: .5rem;
      color: #94a3b8;
      /* Lighter */
      font-size: .9rem;
    }

    .usage-period {
      margin-top: .75rem;
      color: #94a3b8;
      /* Lighter */
      font-size: .9rem;
    }

    @keyframes spin {
      0% {
        transform: rotate(0deg);
      }

      100% {
        transform: rotate(360deg);
      }
    }




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

    body {
      font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
      background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
      color: #ecf0f1;
      overflow-x: hidden;
      /* Prevent horizontal scroll on body */
      width: 100%;
      min-height: 100vh;
    }


    /* FIX: Global Input Styling for Readability in Dark Mode */
    input,
    select,
    textarea {
      background-color: rgba(0, 0, 0, 0.3) !important;
      color: #ffffff !important;
      border: 1px solid rgba(255, 255, 255, 0.1) !important;
    }

    /* FIX: Placeholder styling for better contrast */
    ::placeholder {
      color: #94a3b8 !important;
      opacity: 1;
    }

    /* FIX: Reset margins for first children to remove gaps */
    .page-content>*:first-child {
      margin-top: 0 !important;
    }

    /* FIX: Connect negative margins to specific sections to reduce gap */
    #admin,
    #analytics,
    #integrations {
      margin-top: 0 !important;
      padding-top: 1rem !important;
    }

    #admin>*:first-child,
    #analytics>*:first-child,
    #integrations>*:first-child {
      margin-top: 0 !important;
      padding-top: 0 !important;
    }

    .dashboard-container {
      display: flex;
      min-height: 100vh;
    }

    .tpl-help {
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.1);
      backdrop-filter: blur(10px);
      border-radius: 16px;
      padding: 1.25rem;
      margin-bottom: var(--section-gap);
    }

    .tpl-help h3 {
      margin: 0 0 .75rem 0;
      font-size: 1.15rem;
      color: #ffffff;
    }

    .tpl-help .muted {
      color: #cbd5e1;
      /* Much lighter */
      font-size: .92rem;
    }

    .tpl-help .chip-grid {
      display: flex;
      flex-wrap: wrap;
      gap: .5rem;
      margin: .75rem 0 1rem 0;
    }

    .tpl-help .chip {
      border: 1px solid rgba(255, 255, 255, 0.2);
      background: rgba(255, 255, 255, 0.1);
      border-radius: 999px;
      padding: .35rem .65rem;
      font-size: .85rem;
      cursor: pointer;
      color: #e2e8f0;
    }

    .tpl-help .chip:hover {
      background: #eef2ff;
      border-color: #c7d2fe;
    }

    .tpl-help .code {
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
      background: rgba(0, 0, 0, 0.3);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 10px;
      padding: .75rem;
      font-size: .9rem;
      color: #e2e8f0;
    }

    .tpl-help .row {
      display: grid;
      grid-template-columns: 1.2fr .8fr;
      gap: 1rem;
    }

    @media (max-width: 900px) {
      .tpl-help .row {
        grid-template-columns: 1fr;
      }
    }

    .tpl-help .warn {
      margin-top: .6rem;
      color: #fbbf24;
      /* Warn yellow/orange for dark mode */
      background: rgba(245, 158, 11, 0.15);
      border: 1px solid rgba(245, 158, 11, 0.3);
      padding: .6rem .75rem;
      border-radius: 8px;
      font-size: .9rem;
    }

    .tpl-help .ok {
      margin-top: .6rem;
      color: #065f46;
      background: #ecfdf5;
      border: 1px solid #10b98133;
      padding: .6rem .75rem;
      border-radius: 8px;
      font-size: .9rem;
    }

    .tpl-help .btn-mini {
      display: inline-flex;
      align-items: center;
      gap: .4rem;
      border: none;
      border-radius: 8px;
      padding: .5rem .7rem;
      background: #f1f5f9;
      cursor: pointer;
    }

    .tpl-help .btn-mini:hover {
      background: #e2e8f0;
    }

    .empty-state {
      text-align: center;
      padding: 4rem 2rem;
      color: #94a3b8;
      height: 100%;
      /* PŘIDÁNO PRO VYCENTROVÁNÍ: */
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
    }

    /* Sidebar */
    .sidebar {
      width: 280px;
      padding: 2rem 0;
      position: fixed;
      height: 100vh;
      overflow-y: auto;
      transition: all 0.3s ease;
      z-index: 1000;
      background: rgba(255, 255, 255, 0.05);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      border-right: 1px solid rgba(255, 255, 255, 0.1);
      color: white;
    }

    .sidebar.collapsed {
      width: 80px;
    }

    .sidebar-header {
      padding: 0 2rem;
      margin-bottom: 2rem;
      display: flex;
      align-items: center;
      gap: 1rem;
    }

    .logo {
      font-size: 1.5rem;
      font-weight: 700;
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }



    .collapse-btn {
      background: rgba(255, 255, 255, 0.1);
      border: none;
      color: white;
      padding: 8px;
      border-radius: 8px;
      cursor: pointer;
      transition: all 0.3s ease;
      margin-left: auto;
    }

    .collapse-btn:hover {
      background: rgba(255, 255, 255, 0.2);
    }

    .nav-menu {
      list-style: none;
      padding: 0 1rem;
    }

    .nav-item {
      margin-bottom: 0.5rem;
    }

    .nav-link {
      display: flex;
      align-items: center;
      gap: 1rem;
      padding: 1rem;
      color: rgba(255, 255, 255, 0.8);
      text-decoration: none;
      border-radius: 12px;
      transition: all 0.3s ease;
      position: relative;
    }

    .nav-link:hover,
    .nav-link.active {
      background: rgba(255, 255, 255, 0.1);
      color: white;
      transform: translateX(5px);
    }

    .nav-link.active::before {
      content: '';
      position: absolute;
      left: 0;
      top: 50%;
      transform: translateY(-50%);
      width: 4px;
      height: 60%;
      background: white;
      border-radius: 2px;
    }

    .nav-icon {
      font-size: 1.2rem;
      min-width: 20px;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .nav-icon svg {
      width: 20px;
      height: 20px;
      opacity: 0.8;
      stroke: currentColor;
      stroke-width: 2;
      fill: none;
    }

    .nav-text {
      transition: opacity 0.3s ease;
    }

    .sidebar.collapsed .nav-text {
      opacity: 0;
    }

    .sidebar.collapsed .logo span {
      display: none;
    }



    /* --- Oddělení bloků a hlavička seznamu šablon --- */


    .section-divider::before,
    .section-divider::after {
      content: "";
      height: 1px;
      background: #e5e7eb;
      flex: 1;
    }

    :root {
      --section-gap: 1.5rem;
    }



    /* „karta“ kolem seznamu šablon, aby byl vizuálně samostatně */
    .templates-section {
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 16px;
      padding: 1rem 1rem 1.25rem;
      margin-top: 0;
    }

    .templates-title {
      margin: 0 0 .75rem 0;
      font-weight: 700;
      color: #ffffff;
    }

    .templates-header {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: .75rem;
      margin-bottom: .75rem;
    }

    .templates-header .left {
      font-weight: 700;
      color: #ffffff;
    }

    .templates-header .left .sub {
      margin-left: .6rem;
      font-weight: 500;
      color: #94a3b8;
      font-size: .95rem;
    }

    .templates-header .meta {
      color: #6b7280;
      font-size: .92rem;
    }



    .faq-generator-status {
      text-align: center;
      padding: 3rem 1.5rem;
      border: 2px dashed #e5e7eb;
      border-radius: 16px;
      background-color: #f9fafb;
      color: #4b5563;
    }

    .faq-spinner {
      display: inline-block;
      width: 40px;
      height: 40px;
      border: 4px solid #d1d5db;
      border-top-color: #6366f1;
      border-radius: 50%;
      animation: spin 1s linear infinite;
      margin-bottom: 1rem;
    }

    .faq-status-text {
      font-weight: 500;
      font-size: 1.1rem;
    }

    .faq-status-subtext {
      margin-top: 0.5rem;
      font-size: 0.9rem;
      color: #6b7280;
    }

    @keyframes spin {
      to {
        transform: rotate(360deg);
      }
    }


    /* Main Content */
    .main-content {
      flex: 1;
      margin-left: 280px;
      transition: margin-left 0.3s ease;
    }

    .sidebar.collapsed+.main-content {
      margin-left: 80px;
    }

    .user-info {
      padding: 1.5rem 2rem;
      display: flex;
      justify-content: flex-end;
      align-items: center;
      gap: 20px;
      /* Remove full width background to match preview "floating" look */
      background: transparent;
      box-shadow: none;
      border-bottom: none;
    }

    .page-title {
      font-size: 1.5rem;
      font-weight: 600;
      color: #ffffff;
    }

    /* Component Styles from Index.html Preview */
    .notification-bell {
      position: relative;
      width: 40px;
      height: 40px;
      background: white;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #f59e0b;
      /* Orange/Gold icon */
      cursor: pointer;
      transition: transform 0.2s;
      border: none;
    }

    .notification-bell:hover {
      transform: scale(1.05);
    }

    .notification-badge {
      position: absolute;
      top: -2px;
      right: -2px;
      background: #ef4444;
      color: white;
      font-size: 0.7rem;
      width: 18px;
      height: 18px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      border: 2px solid #232436;
      /* Match dark bg for cut-out effect */
    }

    /* Redefine user-profile to match preview pill style */
    .user-profile-pill {
      background: #393a5b;
      /* Lighter purple block */
      border-radius: 30px;
      padding: 6px 6px 6px 20px;
      display: flex;
      align-items: center;
      gap: 12px;
      color: white;
      font-size: 0.9rem;
      font-weight: 500;
      cursor: default;
    }

    .user-avatar-pill {
      width: 36px;
      height: 36px;
      background: #6366f1;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 600;
      color: white;
    }

    .logout-btn-styled {
      background: white;
      color: #1e1e2d;
      padding: 8px 16px;
      border-radius: 20px;
      font-size: 0.85rem;
      font-weight: 600;
      cursor: pointer;
      border: none;
      transition: transform 0.2s;
    }

    .logout-btn-styled:hover {
      transform: scale(1.05);
    }

    .notifications {
      position: relative;
      background: #f1f5f9;
      border: none;
      padding: 10px;
      border-radius: 10px;
      cursor: pointer;
      transition: all 0.3s ease;
    }

    .notifications:hover {
      background: #e2e8f0;
      transform: translateY(-2px);
    }

    .notification-badge {
      position: absolute;
      top: -5px;
      right: -5px;
      background: #ef4444;
      color: white;
      font-size: 0.75rem;
      width: 20px;
      height: 20px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .user-avatar {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      background: linear-gradient(45deg, #667eea, #764ba2);
      display: flex;
      align-items: center;
      justify-content: center;
      color: white;
      font-weight: 600;
      cursor: pointer;
    }

    .content-area {
      padding: 1rem;
      min-height: 100vh;
      overflow-y: auto;
    }

    .page-content {
      display: none;
    }

    .page-content.active {
      display: block;
      animation: fadeIn 0.5s ease-in;
    }

    #er-tags .tag {
      padding: .25rem .5rem;
      border: 1px solid rgba(255, 255, 255, 0.2);
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.1);
      font-size: .8rem;
      color: #e2e8f0;
      /* Lighter text for tags */
    }

    @keyframes fadeIn {
      from {
        opacity: 0;
        transform: translateY(20px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

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

    .stat-card {
      background: rgba(255, 255, 255, 0.05);
      backdrop-filter: blur(10px);
      padding: 1.5rem;
      border-radius: 16px;
      box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.1);
      transition: all 0.3s ease;
    }

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

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

    .stat-title {
      font-size: 0.9rem;
      color: #cbd5e1;
      /* Lighter */
      font-weight: 500;
    }

    .stat-icon {
      font-size: 1.5rem;
      padding: 8px;
      border-radius: 10px;
      background: rgba(255, 255, 255, 0.1);
      /* Transparent bg */
      color: white;
      /* Ensure icon is visible */
    }

    .stat-value {
      font-size: 2rem;
      font-weight: 700;
      color: #ffffff;
      margin-bottom: 0.5rem;
    }

    .stat-change {
      font-size: 0.875rem;
      display: flex;
      align-items: center;
      gap: 0.25rem;
    }

    .stat-change.positive {
      color: #16a34a;
    }

    .stat-change.negative {
      color: #dc2626;
    }

    /* Emails Header */
    .emails-header {
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 16px;
      padding: 1.5rem;
      margin-bottom: 2rem;
    }

    .emails-header h3 {
      color: #ffffff;
      margin-bottom: 1rem;
    }

    /* Email List */
    .email-list {
      background: rgba(255, 255, 255, 0.05);
      backdrop-filter: blur(10px);
      border-radius: 16px;
      box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.1);
      overflow: hidden;
    }

    .email-list-header {
      padding: 1.5rem;
      border-bottom: 1px solid rgba(255, 255, 255, 0.1);
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .email-item {
      padding: 1rem 1.5rem;
      border-bottom: 1px solid rgba(255, 255, 255, 0.05);
      display: flex;
      align-items: center;
      gap: 1rem;
      transition: all 0.3s ease;
      cursor: pointer;
    }

    .email-item:hover {
      background: rgba(255, 255, 255, 0.05);
    }

    .email-item:last-child {
      border-bottom: none;
    }

    .email-item.unread .email-sender,
    .email-item.unread .email-subject {
      font-weight: 600;
      color: #ffffff;
    }

    .pagination-container {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.75rem;
      flex-wrap: wrap;
      padding: 1rem 1.5rem;
      border-top: 1px solid rgba(255, 255, 255, 0.1);
      background: transparent;
    }

    .pagination-info {
      font-size: 0.875rem;
      color: #94a3b8;
    }

    .pagination-buttons {
      display: flex;
      gap: 0.5rem;
      flex-wrap: wrap;
    }

    .pagination-button {
      min-width: 38px;
      padding: 0.4rem 0.65rem;
      border-radius: 999px;
      border: 1px solid #cbd5f5;
      background: #f1f5f9;
      color: #1e293b;
      font-size: 0.85rem;
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .pagination-button:hover:not(.active):not(:disabled) {
      background: #e2e8f0;
    }

    .pagination-button.active {
      background: #2563eb;
      border-color: #2563eb;
      color: #fff;
    }

    .pagination-button:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }


    .email-status {
      width: 12px;
      height: 12px;
      border-radius: 50%;
      background: #e2e8f0;
    }

    .email-status.unread {
      background: #3b82f6;
    }

    .email-status.processed {
      background: #16a34a;
    }

    .email-status.pending {
      background: #f59e0b;
    }

    .email-content {
      flex: 1;
      min-width: 0;
    }

    .email-sender {
      font-weight: 600;
      color: #ffffff;
      margin-bottom: 0.25rem;
      overflow-wrap: anywhere;
    }

    .email-subject {
      color: #cbd5e1;
      /* Lighter */
      font-size: 0.9rem;
      margin-bottom: 0.25rem;
      overflow-wrap: anywhere;
    }

    .email-preview {
      color: #94a3b8;
      /* Lighter */
      font-size: 0.8rem;
      overflow-wrap: anywhere;
    }

    .email-meta {
      text-align: right;
      font-size: 0.8rem;
      color: #94a3b8;
      /* Lighter */
    }

    .email-actions {
      display: flex;
      gap: 0.5rem;
      opacity: 0;
      transition: opacity 0.3s ease;
    }

    .email-item:hover .email-actions {
      opacity: 1;
    }

    .action-btn {
      background: #f1f5f9;
      border: none;
      padding: 6px 12px;
      border-radius: 8px;
      cursor: pointer;
      transition: all 0.3s ease;
      font-size: 0.8rem;
    }

    /* === PLAN – STYLING === */
    .plan-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
      gap: 1.25rem;
      margin-top: .75rem;
    }

    .plan-card {
      position: relative;
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 16px;
      padding: 1.25rem;
      transition: all .25s ease;
      cursor: pointer;
      display: block;
    }

    .plan-card:has(.plan-input:checked) {
      outline: none;
      /* zruší původní outline */
      border-color: #667eea;
      /* jemné zvýraznění rámečku karty */
      box-shadow: 0 10px 25px rgba(102, 126, 234, .15);
    }

    .plan-card:hover {
      border-color: #667eea;
      box-shadow: 0 10px 25px rgba(102, 126, 234, .15);
      transform: translateY(-2px);
    }

    .plan-card.popular {
      border-color: #764ba2;
    }

    .plan-input {
      display: none;
    }

    .plan-inner {
      display: flex;
      flex-direction: column;
      gap: .75rem;
    }

    .plan-badge {
      align-self: flex-start;
      background: linear-gradient(45deg, #667eea, #764ba2);
      color: #fff;
      font-size: .7rem;
      font-weight: 700;
      padding: .25rem .5rem;
      border-radius: 999px;
      letter-spacing: .5px;
    }

    .plan-head {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: .75rem;
    }

    .plan-name {
      font-weight: 700;
      color: #ffffff;
    }

    .plan-price {
      font-size: 1.1rem;
      font-weight: 700;
      color: #ffffff;
    }

    .plan-price span {
      color: #64748b;
      font-weight: 600;
      font-size: .9rem;
    }

    .plan-features {
      list-style: none;
      color: #cbd5e1;
      display: flex;
      flex-direction: column;
      gap: .35rem;
      margin: .25rem 0 0 0;
      padding: 0;
      font-size: .92rem;
    }

    .plan-actions {
      margin-top: 1rem;
      display: flex;
      align-items: center;
      gap: .75rem;
    }

    .action-btn:hover {
      background: #e2e8f0;
      transform: translateY(-2px);
    }

    .action-btn.approve {
      background: #dcfce7;
      color: #16a34a;
    }

    .action-btn.reject {
      background: #fef2f2;
      color: #dc2626;
    }

    /* Forms */
    .form-section {
      background: rgba(255, 255, 255, 0.05);
      padding: 2rem;
      border-radius: 16px;
      box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.1);
      margin-bottom: 2rem;
      backdrop-filter: blur(10px);
    }

    .form-section h3 {
      font-size: 1.2rem;
      font-weight: 600;
      color: #ffffff;
      margin-bottom: 1.5rem;
    }

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

    .form-group {
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
    }

    .form-label {
      font-weight: 500;
      color: #cbd5e1;
      font-size: 0.9rem;
    }

    .form-control {
      padding: 12px 16px;
      border: 2px solid rgba(255, 255, 255, 0.1);
      border-radius: 10px;
      font-size: 0.9rem;
      transition: all 0.3s ease;
      background: rgba(0, 0, 0, 0.3);
      color: white;
    }

    .form-control:focus {
      outline: none;
      border-color: #667eea;
      box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    }

    .form-control select {
      cursor: pointer;
    }

    textarea.form-control {
      resize: vertical;
      min-height: 100px;
    }

    .btn {
      padding: 12px 24px;
      border: none;
      border-radius: 10px;
      font-size: 0.9rem;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.3s ease;
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
    }

    .btn-primary {
      background: linear-gradient(45deg, #667eea, #764ba2);
      color: white;
    }

    .btn-primary:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    }

    .btn-secondary {
      background: rgba(255, 255, 255, 0.1);
      color: #cbd5e1;
      border: 1px solid rgba(255, 255, 255, 0.2);
    }

    .btn-secondary:hover {
      background: #e2e8f0;
    }

    /* Templates */
    .template-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
      gap: 1.5rem;
      margin-top: 1rem;
    }

    .template-card {
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 16px;
      padding: 1.5rem;
      transition: all 0.3s ease;
      cursor: pointer;
    }

    .template-card:hover {
      border-color: #667eea;
      transform: translateY(-5px);
      box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    }

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

    .template-name {
      font-weight: 600;
      color: #ffffff;
    }

    .template-actions {
      display: flex;
      gap: 0.5rem;
    }

    .template-preview {
      color: #64748b;
      font-size: 0.9rem;
      line-height: 1.5;
      margin-bottom: 1rem;
    }

    .template-stats {
      display: flex;
      justify-content: space-between;
      font-size: 0.8rem;
      color: #94a3b8;
    }

    /* Analytics */
    .chart-container {
      background: rgba(255, 255, 255, 0.05);
      backdrop-filter: blur(10px);
      padding: 2rem;
      border-radius: 16px;
      box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.1);
      margin-bottom: 2rem;
    }

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

    .chart-title {
      font-size: 1.2rem;
      font-weight: 600;
      color: #ffffff;
    }

    .chart-filters {
      display: flex;
      gap: 1rem;
    }

    .filter-btn {
      padding: 6px 16px;
      background: #f1f5f9;
      border: none;
      border-radius: 8px;
      cursor: pointer;
      transition: all 0.3s ease;
      font-size: 0.8rem;
    }

    .filter-btn.active {
      background: #667eea;
      color: white;
    }

    .chart-placeholder {
      height: 300px;
      background: #f8fafc;
      border-radius: 12px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #94a3b8;
      font-size: 1.1rem;
    }

    /* Settings */
    .settings-tabs {
      display: flex;
      gap: 1rem;
      margin-bottom: 2rem;
      border-bottom: 1px solid #e2e8f0;
    }

    .settings-tab {
      padding: 1rem 0;
      border-bottom: 2px solid transparent;
      cursor: pointer;
      font-weight: 500;
      color: #64748b;
      transition: all 0.3s ease;
    }

    .settings-tab.active {
      color: #667eea;
      border-bottom-color: #667eea;
    }

    .switch {
      position: relative;
      display: inline-block;
      width: 50px;
      height: 24px;
    }

    .switch input {
      opacity: 0;
      width: 0;
      height: 0;
    }

    .slider {
      position: absolute;
      cursor: pointer;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-color: #e2e8f0;
      transition: 0.3s;
      border-radius: 24px;
    }

    .slider:before {
      position: absolute;
      content: "";
      height: 18px;
      width: 18px;
      left: 3px;
      bottom: 3px;
      background-color: white;
      transition: 0.3s;
      border-radius: 50%;
    }

    input:checked+.slider {
      background-color: #667eea;
    }

    input:checked+.slider:before {
      transform: translateX(26px);
    }

    /* Responsive */
    @media (max-width: 768px) {
      .sidebar {
        transform: translateX(-100%);
        width: 280px !important;
        /* Force width ignoring .collapsed */
      }

      /* Hide collapse button on mobile */
      .collapse-btn {
        display: none !important;
      }

      /* Force text visibility on mobile */
      .sidebar .nav-text {
        opacity: 1 !important;
        display: inline-block !important;
      }

      /* Hide logo text if needed or ensure it is visible */
      .sidebar .logo span {
        display: inline-block !important;
      }

      .sidebar.open {
        transform: translateX(0);
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.5);
      }

      .main-content {
        margin-left: 0;
      }

      .user-info {
        padding: 1rem;
        justify-content: space-between;
        /* Allow button on left, user info on right */
      }

      .mobile-menu-btn {
        display: flex !important;
        /* Force show on mobile */
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.1);
        color: white;
        border: 1px solid rgba(255, 255, 255, 0.2);
        padding: 8px 12px;
        border-radius: 8px;
        cursor: pointer;
        font-size: 1.2rem;
        margin-right: auto;
        /* Push to the left */
        z-index: 1001;
        /* Ensure on top */
      }

      .stats-grid {
        grid-template-columns: 1fr;
      }

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

      .template-grid {
        grid-template-columns: 1fr;
      }

      /* Ensure modal is responsive */
      .pro-modal {
        width: 95%;
        height: 90vh;
      }

      /* Adjust padding for content */
      .content-area {
        padding: 1rem 0.5rem;
      }

      .page-container {
        width: 100%;
      }

      /* FIX: Stack custom grids on mobile */
      .admin-stats,
      .chart-container .chart-wrapper,
      /* if wrapper exists */
      div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
      }

      /* FIX: Ensure charts fit screen */
      .chart-placeholder,
      canvas {
        width: 100% !important;
        max-width: 100%;
      }

      /* FIX: Table responsiveness */
      .users-section {
        overflow-x: auto;
      }

      .users-table {
        min-width: 600px;
        /* Force min width to trigger scroll */
      }

      /* FIX: Settings tabs scrolling */
      .settings-tabs {
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 0.5rem;
      }

      .settings-tab {
        flex: 0 0 auto;
        /* Prevent shrinking */
      }

      /* GLOBAL MOBILE RESET */
      html,
      body {
        overflow-x: hidden !important;
        width: 100%;
      }

      .main-content {
        width: 100vw;
        max-width: 100vw;
        overflow-x: hidden;
        padding-right: 0;
      }

      /* Ensure containers don't push width */
      .page-container,
      .content-area {
        max-width: 100%;
        box-sizing: border-box;
      }

      /* Admin Specifics */
      .users-section {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
      }

      /* Settings Specifics */
      .settings-tabs {
        width: 100%;
        max-width: 100%;
        padding-right: 1rem;
        /* Space for scroll */
      }
    }

    /* Overlay for mobile sidebar */
    .sidebar-overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.5);
      backdrop-filter: blur(3px);
      z-index: 999;
      /* Below sidebar (1000) */
      opacity: 0;
      visibility: hidden;
      transition: all 0.3s ease;
    }

    .sidebar-overlay.show {
      opacity: 1;
      visibility: visible;
    }

    .mobile-menu-btn {
      display: none;
      /* Hidden by default */
    }

    /* Loading Animation */
    .loading {
      display: inline-block;
      width: 20px;
      height: 20px;
      border: 2px solid #f3f3f3;
      border-top: 2px solid #667eea;
      border-radius: 50%;
      animation: spin 1s linear infinite;
    }

    @keyframes spin {
      0% {
        transform: rotate(0deg);
      }

      100% {
        transform: rotate(360deg);
      }
    }

    /* Toast Notifications */
    .toast {
      position: fixed;
      top: 20px;
      right: 20px;
      background: white;
      color: #1e293b !important;
      border-left: 4px solid #16a34a;
      padding: 1rem 1.5rem;
      border-radius: 8px;
      box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
      z-index: 2000;
      transform: translateX(100%);
      transition: transform 0.3s ease;
    }

    .toast * {
      color: #1e293b !important;
    }

    .toast.show {
      transform: translateX(0);
    }

    .toast.error {
      border-left-color: #dc2626;
    }

    .toast.warning {
      border-left-color: #f59e0b;
    }

    .page-container {
      width: 100%;
      max-width: 1500px;
      /* ZDE MĚŇTE POŽADOVANOU ŠÍŘKU */
      margin: 0 auto;
      /* Toto vycentruje obsah na stránce */
    }


    .container {
      max-width: 900px;
      margin: 0 auto;
      background: white;
      border-radius: 16px;
      box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
      overflow: hidden;
    }

    .header {
      background: linear-gradient(45deg, #667eea, #764ba2);
      color: white;
      padding: 30px;
      text-align: center;
    }

    .header h1 {
      font-size: 28px;
      margin-bottom: 10px;
      font-weight: 600;
    }

    .header p {
      opacity: 0.9;
      font-size: 16px;
    }

    .content {
      padding: 30px;
    }

    .section-title {
      font-size: 20px;
      font-weight: 600;
      margin-bottom: 20px;
      color: #333;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .bulk-actions {
      display: flex;
      gap: 10px;
    }

    .bulk-btn {
      padding: 6px 12px;
      border: none;
      border-radius: 6px;
      font-size: 12px;
      cursor: pointer;
      transition: all 0.3s ease;
      font-weight: 500;
    }

    .bulk-btn.enable-all {
      background: #10b981;
      color: white;
    }

    .bulk-btn.disable-all {
      background: #ef4444;
      color: white;
    }

    .bulk-btn:hover {
      opacity: 0.8;
      transform: translateY(-1px);
    }

    .email-list {
      display: flex;
      flex-direction: column;
      gap: 15px;
      margin-bottom: 30px;
    }

    .email-item {
      display: flex;
      align-items: center;
      padding: 20px;
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 12px;
      cursor: pointer;
      transition: all 0.3s ease;
      background: rgba(255, 255, 255, 0.05);
    }

    .email-item:hover {
      border-color: #667eea;
      transform: translateY(-2px);
      box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
    }

    .email-item.active {
      border-color: #10b981;
      background: linear-gradient(45deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.1));
      box-shadow: 0 8px 25px rgba(16, 185, 129, 0.2);
    }

    .checkbox-wrapper {
      position: relative;
      margin-right: 15px;
    }

    .checkbox-input {
      width: 20px;
      height: 20px;
      cursor: pointer;
      opacity: 0;
      position: absolute;
    }

    .checkbox-custom {
      width: 20px;
      height: 20px;
      border: 2px solid #d1d5db;
      border-radius: 4px;
      background: white;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.3s ease;
      position: relative;
    }

    .checkbox-input:checked+.checkbox-custom {
      background: #10b981;
      border-color: #10b981;
    }

    .checkbox-custom::after {
      content: '✓';
      color: white;
      font-size: 12px;
      font-weight: bold;
      opacity: 0;
      transition: opacity 0.2s ease;
    }

    .checkbox-input:checked+.checkbox-custom::after {
      opacity: 1;
    }

    .email-info {
      flex: 1;
      min-width: 0;
    }

    .email-address {
      font-size: 16px;
      font-weight: 600;
      color: #111827;
      margin-bottom: 5px;
      overflow-wrap: anywhere;
    }

    .email-provider {
      font-size: 14px;
      color: #6b7280;
      display: flex;
      align-items: center;
      gap: 5px;
      flex-wrap: wrap;
    }

    .provider-icon {
      width: 16px;
      height: 16px;
      border-radius: 3px;
    }



    .modal.modal-full-width .response-section {
      flex-grow: 1;
      display: flex;
      flex-direction: column;
    }

    .modal.modal-full-width #response-editor {
      flex-grow: 1;
      /* Textové pole zabere všechno volné místo */
      height: 100%;
    }

    .gmail-icon {
      background: #ea4335;
    }

    .outlook-icon {
      background: #0078d4;
    }

    .email-controls {
      display: flex;
      align-items: center;
      gap: 15px;
      margin-left: 15px;
    }

    .status-badge {
      padding: 6px 12px;
      border-radius: 20px;
      font-size: 12px;
      font-weight: 600;
      background: #f3f4f6;
      color: #6b7280;
    }

    .status-badge.active {
      background: #10b981;
      color: white;
    }

    .radio-wrapper {
      display: flex;
      align-items: center;
      gap: 8px;
      cursor: pointer;
      padding: 6px 12px;
      border-radius: 6px;
      transition: all 0.3s ease;
    }

    .radio-wrapper:hover {
      background: rgba(102, 126, 234, 0.1);
    }

    .radio-wrapper.selected {
      background: transparent;
      /* odstraní šedý obdélník uvnitř */
      border: none;
    }

    .radio-input {
      width: 16px;
      height: 16px;
      opacity: 0;
      position: absolute;
      cursor: pointer;
    }

    .radio-custom {
      width: 16px;
      height: 16px;
      border: 2px solid #d1d5db;
      border-radius: 50%;
      background: white;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.3s ease;
      position: relative;
    }

    .radio-input:checked+.radio-custom {
      border-color: #667eea;
      background: #667eea;
    }

    .radio-custom::after {
      content: '';
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: white;
      opacity: 0;
      transition: opacity 0.2s ease;
    }

    .radio-input:checked+.radio-custom::after {
      opacity: 1;
    }

    .radio-label {
      font-size: 12px;
      font-weight: 500;
      color: #6b7280;
      user-select: none;
    }

    .disconnect-btn {
      width: 24px;
      height: 24px;
      border: none;
      border-radius: 50%;
      background: #ef4444;
      color: white;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.3s ease;
      margin-left: 8px;
      opacity: 0.7;
    }

    .disconnect-btn:hover {
      opacity: 1;
      background: #dc2626;
      transform: scale(1.1);
    }

    .disconnect-icon {
      font-size: 16px;
      font-weight: bold;
      line-height: 1;
    }

    .add-account {
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 20px;
      border: 2px dashed rgba(255, 255, 255, 0.2);
      border-radius: 12px;
      cursor: pointer;
      transition: all 0.3s ease;
      color: #94a3b8;
      margin-top: 15px;
    }

    .add-account:hover {
      border-color: #667eea;
      color: #667eea;
      background: rgba(102, 126, 234, 0.05);
    }


    /* === MODÁLNÍ OKNO === */
    /* Overlay - překryv celé obrazovky */
    #modal-overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.6);
      backdrop-filter: blur(5px);
      display: none;
      /* Skryté ve výchozím stavu */
      justify-content: center;
      align-items: center;
      z-index: 1000;
      animation: fadeIn 0.3s ease;
    }

    @keyframes fadeIn {
      from {
        opacity: 0;
      }

      to {
        opacity: 1;
      }
    }

    /* Kontejner modálního okna */
    #modal-content {
      background: rgba(30, 41, 59, 0.95);
      backdrop-filter: blur(10px);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 16px;
      box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
      width: 90%;
      max-width: 480px;
      transform: scale(0.9);
      animation: modalAppear 0.3s ease forwards;
    }

    @keyframes modalAppear {
      to {
        transform: scale(1);
      }
    }

    /* Add class .modal style for consistency with #modal-content */
    .modal {
      background: rgba(30, 41, 59, 0.95);
      backdrop-filter: blur(10px);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 16px;
      box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
      width: 90%;
      max-width: 480px;
      margin: auto;
      transform: scale(0.9);
      animation: modalAppear 0.3s ease forwards;
    }

    /* Hlavička modálního okna */
    .modal-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 24px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .modal-title {
      font-size: 1.4em;
      font-weight: 600;
      color: #ffffff;
    }

    .modal-close {
      background: none;
      border: none;
      font-size: 24px;
      cursor: pointer;
      color: #94a3b8;
      transition: all 0.3s ease;
    }

    .modal-close:hover {
      color: #ffffff;
      transform: rotate(90deg);
    }

    /* Tělo modálního okna */
    .modal-body {
      padding: 24px;
    }

    .provider-buttons {
      display: flex;
      flex-direction: column;
      gap: 16px;
    }

    .provider-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 12px;
      padding: 16px 24px;
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 12px;
      background: rgba(255, 255, 255, 0.05);
      font-size: 16px;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.3s ease;
      color: #ffffff;
    }

    .provider-btn:hover {
      border-color: #667eea;
      transform: translateY(-2px);
      box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
    }

    .provider-icon {
      width: 24px;
      height: 24px;
    }


    /* Styly pro nový header s filtry */
    .emails-header {
      background: white;
      border-radius: 16px;
      padding: 1.5rem;
      margin-bottom: 1.5rem;
      box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    }

    .form-control {
      width: 100%;
      padding: 10px 12px;
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 8px;
      font-size: 0.9rem;
      background: rgba(0, 0, 0, 0.3);
      color: #ffffff;
    }

    .form-control:focus {
      outline: none;
      border-color: #667eea;
    }

    .search-container {
      display: flex;
      gap: 1rem;
      margin-bottom: 1rem;
    }

    .search-box {
      flex: 1;
      position: relative;
    }

    .search-input {
      width: 100%;
      padding: 12px 16px 12px 45px;
      border: 2px solid #e5e7eb;
      border-radius: 12px;
      font-size: 0.95rem;
      transition: all 0.3s ease;
      background: white;
    }

    .search-input:focus {
      outline: none;
      border-color: #667eea;
      box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    }

    .search-icon {
      position: absolute;
      left: 15px;
      top: 50%;
      transform: translateY(-50%);
      color: #94a3b8;
      font-size: 1.1rem;
    }

    /* Hint pro význam proměnných */
    .tpl-var-hint {
      display: none;
      margin-top: .5rem;
      font-size: .9rem;
      color: #334155;
      background: #eef2ff;
      border: 1px solid #c7d2fe;
      padding: .5rem .75rem;
      border-radius: 10px;
    }

    .tpl-var-hint strong {
      color: #1f2937;
    }

    /* schovej text „Vaše šablony“ v headeru karty */
    .templates-header .left {
      display: none;
    }

    /* ať zůstane jen pravá část s počtem */
    .templates-header {
      justify-content: flex-end;
    }



    /* Styly pro Admin Dashboard */
    .admin-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 2rem;
    }

    .admin-title {
      font-size: 2rem;
      font-weight: 700;
      color: #1e293b;
      display: flex;
      align-items: center;
      gap: 0.75rem;
    }

    .admin-stats {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
      gap: 1.5rem;
      margin-bottom: 2rem;
    }

    .stat-card {
      background: rgba(255, 255, 255, 0.05);
      backdrop-filter: blur(10px);
      padding: 1.5rem;
      border-radius: 16px;
      box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.1);
    }

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

    .stat-title {
      font-size: 0.9rem;
      color: #94a3b8;
      font-weight: 500;
    }

    .stat-icon {
      font-size: 1.5rem;
      padding: 8px;
      border-radius: 10px;
      background: rgba(255, 255, 255, 0.1);
      color: #ffffff;
    }

    .stat-value {
      font-size: 2rem;
      font-weight: 700;
      color: #ffffff;
    }

    .users-section {
      background: rgba(255, 255, 255, 0.05);
      backdrop-filter: blur(10px);
      border-radius: 16px;
      box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.1);
      overflow: hidden;
    }

    .section-header {
      padding: 1.5rem 2rem;
      border-bottom: 1px solid rgba(255, 255, 255, 0.1);
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: transparent;
      flex-wrap: wrap;
      gap: 1rem;
    }

    .section-title {
      font-size: 1.3rem;
      font-weight: 600;
      color: #ffffff;
    }

    .search-filters {
      display: flex;
      gap: 1rem;
      align-items: center;
      flex-wrap: wrap;
    }

    .search-box {
      position: relative;
    }

    .search-input {
      padding: 8px 12px 8px 35px;
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 8px;
      font-size: 0.9rem;
      width: 250px;
      background: rgba(0, 0, 0, 0.3);
      color: #ffffff;
    }

    .search-input:focus {
      outline: none;
      border-color: #667eea;
    }

    .search-icon {
      position: absolute;
      left: 10px;
      top: 50%;
      transform: translateY(-50%);
      color: #94a3b8;
    }

    .filter-select {
      padding: 8px 12px;
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 8px;
      font-size: 0.9rem;
      background: rgba(0, 0, 0, 0.3);
      color: #ffffff;
      cursor: pointer;
    }

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

    .users-table th,
    .users-table td {
      padding: 1rem 1.5rem;
      text-align: left;
      border-bottom: 1px solid rgba(255, 255, 255, 0.05);
      color: #cbd5e1;
    }

    .users-table th {
      background: rgba(255, 255, 255, 0.05);
      font-weight: 600;
      color: #e2e8f0;
      font-size: 0.875rem;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .users-table tbody tr:hover {
      background: rgba(255, 255, 255, 0.05);
    }

    .activity-action {
      font-weight: 600;
      color: #ffffff;
    }

    .activity-detail {
      margin-top: 0.25rem;
      color: #94a3b8;
      font-size: 0.85rem;
      white-space: pre-line;
    }

    .user-info-cell {
      display: flex;
      align-items: center;
      gap: 0.75rem;
    }

    .user-avatar-small {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      background: #667eea;
      display: flex;
      align-items: center;
      justify-content: center;
      color: white;
      font-size: 0.8rem;
      font-weight: 600;
    }

    .user-details {
      display: flex;
      flex-direction: column;
    }

    .user-name {
      font-weight: 600;
      color: #ffffff;
    }

    .user-email {
      font-size: 0.875rem;
      color: #94a3b8;
    }

    .role-badge {
      padding: 0.25rem 0.75rem;
      border-radius: 999px;
      font-size: 0.75rem;
      font-weight: 600;
      display: inline-block;
    }

    .role-admin {
      background: rgba(254, 243, 199, 0.1);
      color: #fcd34d;
      border: 1px solid rgba(252, 211, 77, 0.3);
    }

    .role-user {
      background: rgba(219, 234, 254, 0.1);
      color: #93c5fd;
      border: 1px solid rgba(147, 197, 253, 0.3);
    }

    .action-buttons {
      display: flex;
      gap: 0.5rem;
    }

    .btn-sm {
      padding: 4px 8px;
      font-size: 0.75rem;
    }

    /* Header BG Animation */
    .header-bg {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: -1;
      opacity: 0.4;
      background-image:
        linear-gradient(rgba(102, 126, 234, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(102, 126, 234, 0.1) 1px, transparent 1px);
      background-size: 50px 50px;
      animation: gridMove 20s linear infinite;
      pointer-events: none;
    }

    @keyframes gridMove {
      0% {
        transform: translateY(0);
      }

      100% {
        transform: translateY(50px);
      }
    }

    /* === PRO MODAL REDESIGN (Dark Theme - Refined) === */
    .pro-modal {
      background: #0f172a;
      /* Solid dark color to prevent transparency issues */
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 16px;
      box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
      width: 90%;
      max-width: 1100px;
      margin: auto;
      color: #fff;
      display: flex;
      flex-direction: column;
      height: 85vh;
      /* Fixed height for consistency */
      overflow: hidden;
      animation: modalAppear 0.3s ease forwards;
    }

    .pro-modal__header {
      padding: 1.5rem 2rem;
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: rgba(15, 23, 42, 0.95);
      flex-shrink: 0;
    }

    .pro-avatar {
      width: 48px;
      height: 48px;
      background: linear-gradient(135deg, #667eea, #764ba2);
      color: white;
      border-radius: 12px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.5rem;
      box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
      flex-shrink: 0;
    }

    .pro-modal__id {
      display: flex;
      gap: 1rem;
      align-items: center;
    }

    .pro-modal__body {
      padding: 0;
      display: flex;
      flex-direction: column;
      flex: 1;
      /* Take remaining height */
      overflow-y: auto;
      background: #0f172a;
    }

    /* Hide sidebar as requested */
    .pro-sidebar {
      display: none !important;
    }

    /* Hide top buttons as requested */
    .pro-actions #ed-copy,
    .pro-actions #ed-reply-open {
      display: none !important;
    }

    .pro-content {
      width: 100%;
      padding: 2rem;
      display: flex;
      flex-direction: column;
      gap: 1.5rem;
      height: 100%;
    }

    .pro-headings .pro-title {
      color: white;
      font-size: 1.3rem;
      font-weight: 700;
      margin-bottom: 4px;
      line-height: 1.2;
    }

    .pro-headings .pro-subtitle {
      color: #94a3b8;
      font-size: 0.95rem;
      display: flex;
      gap: 0.75rem;
      align-items: center;
    }

    .pro-dot {
      color: rgba(255, 255, 255, 0.2);
    }

    .pro-body-card {
      background: rgba(30, 41, 59, 0.5);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 16px;
      padding: 0;
      /* Remove padding from container to let header span full width if needed, or manage internally */
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }

    .pro-body-card--email {
      flex: 1;
      /* Expand to fill space */
      min-height: 300px;
    }

    .pro-body-card__title {
      background: rgba(255, 255, 255, 0.03);
      padding: 1rem 1.75rem;
      border-bottom: 1px solid rgba(255, 255, 255, 0.05);
      font-size: 0.9rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: #94a3b8;
      display: flex;
      gap: 0.75rem;
      align-items: center;
    }

    .pro-body-card__content {
      padding: 1.75rem;
      color: #e2e8f0;
      line-height: 1.8;
      font-size: 1.05rem;
    }

    /* AI Inline Card - Quick Reply Design Fix */
    .ai-inline-card {
      background: linear-gradient(145deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
      border: 1px solid rgba(102, 126, 234, 0.3);
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    }

    .ai-inline-card .pro-body-card__title {
      background: linear-gradient(90deg, rgba(102, 126, 234, 0.1), transparent);
      color: #a5b4fc;
      border-bottom: 1px solid rgba(102, 126, 234, 0.15);
    }

    .ai-inline-card .pro-body-card__content {
      display: grid;
      grid-template-columns: 1.5fr 1fr;
      /* Adjusted ratio */
      gap: 2rem;
      padding: 1.5rem 1.75rem;
    }

    @media (max-width: 768px) {
      .ai-inline-card .pro-body-card__content {
        grid-template-columns: 1fr;
      }
    }

    .ai-inline-main {
      display: flex;
      flex-direction: column;
      gap: 1rem;
    }

    .ai-inline-lead {
      font-size: 0.9rem;
      color: #cbd5e1;
      margin: 0;
    }

    .ai-inline-side {
      background: rgba(30, 41, 59, 0.4);
      padding: 1.25rem;
      border-radius: 12px;
      border: 1px solid rgba(255, 255, 255, 0.05);
      display: flex;
      flex-direction: column;
      gap: 1rem;
    }

    .ai-inline-hint-title {
      color: #fff;
      font-weight: 600;
      font-size: 0.9rem;
      display: block;
      margin-bottom: 0.5rem;
    }

    .ai-inline-list {
      list-style: none;
      padding: 0;
      margin: 0;
      display: flex;
      flex-direction: column;
      gap: 0.6rem;
    }

    .ai-inline-list li {
      position: relative;
      padding-left: 1.5rem;
      font-size: 0.85rem;
      color: #94a3b8;
      line-height: 1.4;
    }

    .ai-inline-list li::before {
      content: "✨";
      font-size: 0.8rem;
      position: absolute;
      left: 0;
      top: 2px;
    }

    .ai-inline-input {
      background: rgba(15, 23, 42, 0.8);
      color: white;
      border: 1px solid rgba(255, 255, 255, 0.15);
      border-radius: 12px;
      padding: 1rem;
      min-height: 120px;
      font-size: 0.95rem;
      resize: none;
      transition: all 0.2s;
      width: 100%;
    }

    .ai-inline-input:focus {
      border-color: #667eea;
      box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
      outline: none;
      background: rgba(15, 23, 42, 1);
    }

    .ai-inline-input::placeholder {
      color: rgba(255, 255, 255, 0.3);
    }

    .ai-inline-button {
      width: 100%;
      justify-content: center;
      padding: 0.9rem;
      font-weight: 600;
      margin-top: auto;
      border-radius: 10px;
      background: linear-gradient(135deg, #667eea, #764ba2);
      box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
      border: none;
      color: white;
    }

    .ai-inline-button:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    }

    .ai-inline-note {
      font-size: 0.75rem;
      color: #64748b;
      text-align: center;
      margin: 0.5rem 0 0 0;
    }

    .pro-modal__footer {
      padding: 1.5rem 2rem;
      border-top: 1px solid rgba(255, 255, 255, 0.08);
      display: flex;
      justify-content: flex-end;
      gap: 1rem;
      background: rgba(15, 23, 42, 0.95);
      flex-shrink: 0;
    }

    .pro-close {
      background: none;
      border: none;
      color: rgba(255, 255, 255, 0.5);
      cursor: pointer;
      padding: 0.5rem;
      transition: color 0.2s;
      font-size: 1.5rem;
      line-height: 1;
    }

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

    /* === AI COMPOSER DARK THEME === */
    .ai-composer-panel {
      background: #0f172a !important;
      /* Extremely darker blue/slate */
      border: 1px solid rgba(255, 255, 255, 0.1);
      box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
      color: white;
    }

    .ai-composer-header {
      border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
      background: rgba(15, 23, 42, 0.95);
    }

    .ai-composer-title {
      color: white !important;
    }

    .ai-composer-context {
      color: #94a3b8 !important;
    }

    .ai-composer-close {
      color: #94a3b8 !important;
    }

    .ai-composer-close:hover {
      color: white !important;
      background: rgba(255, 255, 255, 0.1) !important;
    }

    .ai-composer-body {
      background: #0f172a !important;
    }

    .ai-composer-select,
    .ai-composer-field textarea,
    .ai-composer-result textarea {
      background: rgba(30, 41, 59, 0.6) !important;
      border: 1px solid rgba(255, 255, 255, 0.1) !important;
      color: white !important;
      border-radius: 10px;
    }

    .ai-composer-select:focus,
    .ai-composer-field textarea:focus {
      border-color: #667eea !important;
      outline: none;
      background: rgba(30, 41, 59, 1) !important;
    }

    .ai-composer-note {
      color: #64748b !important;
    }

    .ai-composer-footer {
      border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
      background: rgba(0, 0, 0, 0.2) !important;
    }

    .ai-composer-tag {
      background: #667eea !important;
      color: white !important;
    }

/* === Druhý blok (email detail modal) === */
            .email-detail-compact {
              width: 100%;
              max-width: 850px;
              border-radius: 12px;
              background: #1e293b;
              color: #f8fafc;
              box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
              display: flex;
              flex-direction: column;
              border: 1px solid rgba(255, 255, 255, 0.1);
              overflow: hidden;
              max-height: 90vh;
              /* Celý modál má maximální výšku okna */
            }

            .email-detail-compact .modal-header-compact {
              padding: 16px 24px;
              border-bottom: 1px solid rgba(255, 255, 255, 0.08);
              display: flex;
              justify-content: space-between;
              align-items: flex-start;
              gap: 16px;
              background: rgba(15, 23, 42, 0.5);
            }

            .email-detail-compact .header-info {
              display: flex;
              flex-direction: column;
              gap: 6px;
              flex: 1;
              min-width: 0;
            }

            .email-detail-compact .header-title-row {
              display: flex;
              align-items: center;
              gap: 12px;
            }

            .email-detail-compact .subject-text {
              font-size: 1.15rem;
              font-weight: 600;
              color: #fff;
              margin: 0;
              white-space: nowrap;
              overflow: hidden;
              text-overflow: ellipsis;
            }

            .email-detail-compact .header-meta-row {
              font-size: 0.9rem;
              color: #94a3b8;
              display: flex;
              align-items: center;
              gap: 8px;
            }

            .email-detail-compact .meta-avatar {
              width: 24px;
              height: 24px;
              border-radius: 50%;
              background: #475569;
              color: white;
              display: flex;
              align-items: center;
              justify-content: center;
              font-size: 0.75rem;
              font-weight: bold;
              flex-shrink: 0;
            }

            .email-detail-compact .header-actions {
              display: flex;
              gap: 8px;
              align-items: center;
              flex-shrink: 0;
            }

            .email-detail-compact .ai-summary-bar {
              padding: 12px 24px;
              background: rgba(30, 41, 59, 0.8);
              border-bottom: 1px solid rgba(255, 255, 255, 0.05);
              display: flex;
              align-items: center;
              gap: 16px;
              font-size: 0.9rem;
            }

            .email-detail-compact .ai-summary-icon {
              font-size: 1.2rem;
              flex-shrink: 0;
            }

            .email-detail-compact .ai-summary-content {
              flex: 1;
              line-height: 1.4;
            }

            .email-detail-compact .ai-sentiment-badge {
              display: inline-flex;
              align-items: center;
              gap: 6px;
              padding: 4px 10px;
              border-radius: 9999px;
              font-size: 0.8rem;
              font-weight: 500;
              background: #334155;
              color: #f1f5f9;
              white-space: nowrap;
              flex-shrink: 0;
            }

            .email-detail-compact .ai-sentiment-dot {
              width: 8px;
              height: 8px;
              border-radius: 50%;
              background: #94a3b8;
            }

            /* Add specific coloring based on sentiment text */
            .email-detail-compact .ai-sentiment-badge:has(strong:contains("pozitivní")) .ai-sentiment-dot {
              background: #10b981;
            }

            .email-detail-compact .ai-sentiment-badge:has(strong:contains("negativní")) .ai-sentiment-dot {
              background: #ef4444;
            }

            .email-detail-compact .email-body-area {
              padding: 24px;
              font-size: 0.95rem;
              line-height: 1.6;
              color: #e2e8f0;
              background: #1e293b;
              height: auto !important;
              max-height: none !important;
              overflow: visible !important;
            }

            .email-detail-compact #ed-body {
              height: auto !important;
              max-height: none !important;
              overflow: visible !important;
            }

            /* Obal, který bude scrollovat jako jeden celek (střed modálu) */
            .email-detail-compact .modal-scroll-content {
              flex: 1;
              overflow-y: auto;
              height: 100%;
            }

            .email-detail-compact .modal-scroll-content::-webkit-scrollbar {
              width: 8px;
            }

            .email-detail-compact .modal-scroll-content::-webkit-scrollbar-track {
              background: rgba(0, 0, 0, 0.1);
            }

            .email-detail-compact .modal-scroll-content::-webkit-scrollbar-thumb {
              background: rgba(255, 255, 255, 0.15);
              border-radius: 4px;
            }

            .email-detail-compact .modal-scroll-content::-webkit-scrollbar-thumb:hover {
              background: rgba(255, 255, 255, 0.25);
            }

            .email-detail-compact .ai-draft-area {
              padding: 16px 24px;
              background: rgba(15, 23, 42, 0.5);
              border-top: 1px solid rgba(255, 255, 255, 0.08);
            }

            .email-detail-compact .ai-draft-box {
              position: relative;
              background: rgba(30, 41, 59, 0.6);
              border: 1px solid rgba(147, 197, 253, 0.2);
              border-radius: 8px;
              overflow: hidden;
            }

            .email-detail-compact .ai-draft-header {
              padding: 8px 12px;
              font-size: 0.8rem;
              color: #94a3b8;
              border-bottom: 1px solid rgba(255, 255, 255, 0.05);
              display: flex;
              align-items: center;
              gap: 6px;
            }

            .email-detail-compact .ai-draft-textarea {
              width: 100%;
              min-height: 120px;
              background: transparent;
              border: none;
              color: #f8fafc;
              padding: 12px;
              font-family: inherit;
              font-size: 0.95rem;
              line-height: 1.5;
              resize: vertical;
              outline: none;
            }

            .email-detail-compact .ai-draft-textarea:focus {
              background: rgba(255, 255, 255, 0.02);
            }

            .email-detail-compact .modal-footer-compact {
              padding: 16px 24px;
              display: flex;
              justify-content: flex-end;
              align-items: center;
              gap: 12px;
              border-top: 1px solid rgba(255, 255, 255, 0.05);
              background: #0f172a;
            }

            /* AI Button Gradient */
            .btn-ai-magic {
              background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
              border: none;
              color: white;
            }

            .btn-ai-magic:hover {
              background: linear-gradient(135deg, #4f46e5 0%, #9333ea 100%);
            }