/* ============================================
   ADMIN / AGENDA – CSS Styles
   ============================================ */

/* ---------- Admin Body ---------- */
.admin-body {
    background: #f0f2f5;
    min-height: 100vh;
}

/* ---------- Admin Header ---------- */
.admin-header {
    background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);
    color: #fff;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.admin-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.admin-logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
}

.admin-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-user {
    font-size: 0.9rem;
    opacity: 0.8;
}

.admin-link {
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.2s;
}

.admin-link:hover {
    color: #fff;
}

.admin-logout {
    background: rgba(255,255,255,0.15);
    padding: 6px 14px;
    border-radius: 6px;
}

.admin-logout:hover {
    background: rgba(255,255,255,0.25);
}

/* ---------- Admin Main ---------- */
.admin-main {
    padding: 24px 0 60px;
}

.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Stats Grid ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border-left: 4px solid #2c3e50;
}

.stat-card.stat-new { border-left-color: #f39c12; }
.stat-card.stat-active { border-left-color: #27ae60; }
.stat-card.stat-inactive { border-left-color: #95a5a6; }

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
}

.stat-label {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-top: 4px;
}

/* ---------- Admin Grid ---------- */
.admin-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 24px;
}

.admin-col-main { min-width: 0; }
.admin-col-side { min-width: 0; }

/* ---------- Admin Panel ---------- */
.admin-panel {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 24px;
    margin-bottom: 24px;
}

.panel-header {
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.panel-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

/* ---------- Filter Bar ---------- */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-search {
    flex: 1;
    min-width: 200px;
}

.filter-select {
    width: 180px;
}

/* ---------- Admin Table ---------- */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-table th {
    background: #f8f9fa;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #ecf0f1;
    white-space: nowrap;
}

.admin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}

.admin-table tr:hover td {
    background: #f8f9fa;
}

.admin-table td.center {
    text-align: center;
}

.admin-table td a {
    color: #2c3e50;
    font-weight: 600;
    text-decoration: none;
}

.admin-table td a:hover {
    color: #27ae60;
}

/* ---------- Buttons - Admin ---------- */
.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-xs {
    padding: 4px 10px;
    font-size: 0.78rem;
    border-radius: 6px;
}

.btn-text {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 4px 8px;
    transition: color 0.2s;
}

.btn-danger-text {
    color: #95a5a6;
}

.btn-danger-text:hover {
    color: #e74c3c;
}

/* ---------- Empty State ---------- */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #95a5a6;
}

.empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 12px;
}

.text-muted {
    color: #95a5a6;
    font-size: 0.9rem;
}

/* ---------- Upcoming List ---------- */
.upcoming-list {
    display: flex;
    flex-direction: column;
}

.upcoming-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
}

.upcoming-item:hover {
    background: #f8f9fa;
    margin: 0 -24px;
    padding: 12px 24px;
}

.upcoming-item:last-child {
    border-bottom: none;
}

.upcoming-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 50px;
}

.upcoming-day {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1;
}

.upcoming-month {
    font-size: 0.72rem;
    color: #95a5a6;
}

.upcoming-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.upcoming-info strong {
    font-size: 0.9rem;
    color: #2c3e50;
}

.upcoming-info span {
    font-size: 0.8rem;
    color: #7f8c8d;
}

.upcoming-info small {
    font-size: 0.78rem;
    color: #95a5a6;
}

/* ---------- Login Page ---------- */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);
}

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px 32px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 12px;
}

.login-header h1 {
    font-size: 1.6rem;
    color: #2c3e50;
    margin: 0;
}

.login-header p {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-top: 4px;
}

.login-back {
    text-align: center;
    margin-top: 20px;
    font-size: 0.85rem;
}

.login-back a {
    color: #7f8c8d;
    text-decoration: none;
}

.login-back a:hover {
    color: #2c3e50;
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: #7f8c8d;
    text-decoration: none;
}

.breadcrumb a:hover {
    color: #2c3e50;
}

/* ---------- Client Header ---------- */
.client-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 20px;
    gap: 16px;
    flex-wrap: wrap;
}

.client-info h1 {
    font-size: 1.6rem;
    color: #2c3e50;
    margin: 0 0 8px;
}

.client-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.88rem;
    color: #7f8c8d;
}

.client-status .stav-select {
    width: auto;
    font-size: 0.9rem;
    padding: 8px 32px 8px 12px;
}

.inline-form {
    display: inline;
}

/* ---------- Tabs ---------- */
.tabs {
    display: flex;
    gap: 4px;
    background: #fff;
    border-radius: 12px 12px 0 0;
    padding: 4px 4px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab {
    padding: 12px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #7f8c8d;
    text-decoration: none;
    border-radius: 8px 8px 0 0;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab:hover {
    color: #2c3e50;
    background: #f0f2f5;
}

.tab.active {
    color: #2c3e50;
    background: #f0f2f5;
    font-weight: 600;
}

.tab .badge {
    display: inline-block;
    background: #ecf0f1;
    color: #7f8c8d;
    font-size: 0.72rem;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 4px;
}

.tab.active .badge {
    background: #27ae60;
    color: #fff;
}

.tab-content {
    background: transparent;
}

.tab-content > .admin-panel {
    border-radius: 0 0 12px 12px;
}

/* ---------- Detail Grid ---------- */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
}

.detail-item {
    font-size: 0.9rem;
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
}

.detail-label {
    font-weight: 600;
    color: #2c3e50;
    margin-right: 8px;
}

/* ---------- Dotazník Sections ---------- */
.dotaznik-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ecf0f1;
}

.dotaznik-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.dotaznik-section h4 {
    font-size: 1.05rem;
    color: #2c3e50;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #ecf0f1;
}

.dotaznik-section p {
    margin: 6px 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ---------- Notes ---------- */
.note-form {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ecf0f1;
}

.note-item {
    padding: 14px 0;
    border-bottom: 1px solid #f5f5f5;
}

.note-item:last-child {
    border-bottom: none;
}

.note-text {
    font-size: 0.92rem;
    line-height: 1.5;
    color: #333;
}

.note-meta {
    font-size: 0.78rem;
    color: #95a5a6;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ---------- Meetings ---------- */
.meeting-form {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ecf0f1;
}

.meeting-item {
    padding: 14px 0;
    border-bottom: 1px solid #f5f5f5;
}

.meeting-item-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.meeting-edit-form {
    padding: 14px 0 4px 76px;
    border-top: 1px solid #ecf0f1;
    margin-top: 10px;
}

.meeting-item:last-child {
    border-bottom: none;
}

.meeting-item.zrusena {
    opacity: 0.5;
}

.meeting-item.dokoncena .meeting-date-col {
    color: #27ae60;
}

.meeting-date-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
    font-weight: 600;
    color: #2c3e50;
}

.meeting-day {
    font-size: 1rem;
}

.meeting-time {
    font-size: 0.82rem;
    color: #7f8c8d;
}

.meeting-info {
    flex: 1;
}

.meeting-duration {
    font-size: 0.82rem;
    color: #7f8c8d;
    margin-bottom: 2px;
}

.meeting-desc {
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 4px;
}

.meeting-meta {
    font-size: 0.78rem;
    color: #95a5a6;
}

.meeting-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

/* ---------- Meal Plans ---------- */
.meal-form {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ecf0f1;
}

.meal-item {
    padding: 16px 0;
    border-bottom: 1px solid #f5f5f5;
}

.meal-item:last-child {
    border-bottom: none;
}

.meal-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
    gap: 12px;
    flex-wrap: wrap;
}

.meal-header h4 {
    font-size: 1rem;
    color: #2c3e50;
    margin: 0;
}

.meal-dates {
    font-size: 0.82rem;
    color: #7f8c8d;
}

.meal-content {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #333;
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    white-space: pre-wrap;
    margin-bottom: 8px;
}

.meal-meta {
    font-size: 0.82rem;
    color: #95a5a6;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.meal-meta .meal-date {
    color: #95a5a6;
}

.meal-actions {
    display: flex;
    gap: 6px;
    margin-left: auto;
}

.meal-actions .btn-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 6px;
    border: 1px solid;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    background: #fff;
    transition: all 0.2s;
    text-decoration: none;
}

.meal-actions .btn-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.btn-action.btn-preview {
    color: #FF9800;
    border-color: #FF9800;
}

.btn-action.btn-preview:hover {
    background: #FFF3E0;
}

.btn-action.btn-send {
    color: #1976D2;
    border-color: #1976D2;
}

.btn-action.btn-send:hover {
    background: #E3F2FD;
}

.btn-action.btn-delete {
    color: #e74c3c;
    border-color: #e74c3c;
}

.btn-action.btn-delete:hover {
    background: #FFEBEE;
}

/* ---------- Modern confirm/alert modal ---------- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    animation: modalFadeIn 0.2s ease;
}

.modal-overlay.show {
    display: flex;
}

.modal-box {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 16px 48px rgba(0,0,0,0.2);
    text-align: center;
    animation: modalSlideIn 0.25s ease;
}

.modal-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.modal-text {
    font-size: 0.92rem;
    color: #666;
    margin-bottom: 24px;
    line-height: 1.5;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.modal-btn {
    padding: 10px 24px;
    border-radius: 8px;
    border: none;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 100px;
}

.modal-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

.modal-btn-cancel {
    background: #f5f5f5;
    color: #555;
}

.modal-btn-cancel:hover {
    background: #e0e0e0;
}

.modal-btn-confirm {
    background: #4CAF50;
    color: #fff;
}

.modal-btn-confirm:hover {
    background: #43A047;
}

.modal-btn-danger {
    background: #e74c3c;
    color: #fff;
}

.modal-btn-danger:hover {
    background: #d63031;
}

.modal-btn-info {
    background: #1976D2;
    color: #fff;
}

.modal-btn-info:hover {
    background: #1565C0;
}

.modal-btn-ok {
    background: #4CAF50;
    color: #fff;
    min-width: 120px;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideIn {
    from { transform: translateY(-20px) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

/* ---------- Admin Responsive ---------- */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .admin-grid {
        grid-template-columns: 1fr;
    }

    .admin-header-inner {
        flex-wrap: wrap;
        gap: 8px;
        padding: 12px 16px;
    }

    .admin-header-right {
        gap: 10px;
        flex-wrap: wrap;
    }

    .admin-user {
        display: none;
    }

    .admin-main {
        padding: 16px 0 40px;
    }

    .admin-container {
        padding: 0 12px;
    }

    .admin-panel {
        padding: 16px;
        border-radius: 10px;
    }

    .filter-bar {
        flex-direction: column;
    }

    .filter-search,
    .filter-select {
        width: 100%;
    }

    /* Tabulka klientů – mobilní karty */
    .admin-table thead {
        display: none;
    }

    .admin-table,
    .admin-table tbody,
    .admin-table tr,
    .admin-table td {
        display: block;
        width: 100%;
    }

    .admin-table tr {
        background: #fff;
        border-bottom: 2px solid #f0f2f5;
        padding: 14px 0;
        position: relative;
    }

    .admin-table td {
        padding: 3px 0;
        border-bottom: none;
        font-size: 0.88rem;
    }

    .admin-table td:before {
        content: attr(data-label);
        font-weight: 600;
        color: #7f8c8d;
        font-size: 0.78rem;
        display: inline-block;
        min-width: 80px;
        margin-right: 8px;
    }

    .admin-table td.center {
        text-align: left;
        display: inline-block;
        width: auto;
        padding: 3px 8px 3px 0;
    }

    .admin-table td.mobile-hidden {
        display: none;
    }

    .admin-table td:last-child {
        margin-top: 8px;
    }

    .admin-table td:last-child a.btn {
        width: 100%;
        text-align: center;
        display: block;
        padding: 8px;
    }

    .client-header {
        padding: 16px;
    }

    .client-info h1 {
        font-size: 1.3rem;
    }

    .client-meta {
        gap: 8px;
        font-size: 0.82rem;
    }

    .tabs {
        border-radius: 8px 8px 0 0;
        gap: 2px;
        padding: 4px 4px 0;
    }

    .tab {
        padding: 10px 12px;
        font-size: 0.78rem;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .meeting-item-row {
        flex-direction: column;
        gap: 8px;
    }

    .meeting-edit-form {
        padding-left: 0;
    }

    .meeting-date-col {
        flex-direction: row;
        gap: 8px;
    }

    .meeting-actions {
        margin-top: 4px;
    }

    .meal-form .form-row {
        grid-template-columns: 1fr !important;
    }

    .meeting-form .form-row {
        grid-template-columns: 1fr !important;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .login-card {
        padding: 28px 20px;
    }

    .upcoming-item:hover {
        margin: 0 -16px;
        padding: 12px 16px;
    }

    /* Panel header */
    .panel-header h2 {
        font-size: 1.05rem;
    }
}

@media (max-width: 480px) {
    .admin-header-inner {
        padding: 10px 12px;
    }

    .admin-logo {
        font-size: 1.15rem;
    }

    .admin-link {
        font-size: 0.8rem;
    }

    .admin-logout {
        padding: 5px 10px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .stat-card {
        padding: 14px 10px;
    }

    .stat-number {
        font-size: 1.3rem;
    }

    .stat-label {
        font-size: 0.78rem;
    }

    .admin-container {
        padding: 0 8px;
    }

    .admin-panel {
        padding: 12px;
    }

    .tab {
        padding: 8px 10px;
        font-size: 0.75rem;
    }

    .client-info h1 {
        font-size: 1.15rem;
    }
}
