/**
 * 3task Calendar Admin Styles v1.3
 *
 * @package 3task Calendar
 * @since 1.0.0
 */

/* Reset */
.threecal-wrap {
    margin: 0;
    padding: 0;
    max-width: 100%;
}

.threecal-wrap * {
    box-sizing: border-box;
}

/* Header */
.threecal-header {
    background: #fff;
    padding: 16px 24px;
    margin: -10px -20px 0 -20px;
    border-bottom: 1px solid #e1e5eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.threecal-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.threecal-logo h1 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2563eb;
    margin: 0;
    padding: 0;
}

.threecal-logo-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    color: #2563eb;
}

.threecal-version {
    font-size: 0.75rem;
    color: #9ca3af;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 4px;
}

.threecal-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.threecal-header-actions .button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    height: auto;
}

.threecal-header-actions .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Tabs Navigation */
.threecal-tabs {
    background: #fff;
    margin: 0 -20px;
    padding: 0 24px;
    border-bottom: 1px solid #e1e5eb;
    display: flex;
    gap: 0;
    overflow-x: auto;
}

.threecal-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 14px 18px;
    text-decoration: none;
    color: #6b7280;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

.threecal-tab .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.threecal-tab:hover {
    color: #2563eb;
    background: #f9fafb;
}

.threecal-tab.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    background: transparent;
}

/* Content */
.threecal-content {
    padding: 24px 0;
}

/* Cards */
.threecal-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
    padding: 24px;
    margin-bottom: 20px;
}

.threecal-card h3 {
    margin: 0 0 16px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a2e;
}

/* Stats Grid */
.threecal-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

@media (max-width: 1200px) {
    .threecal-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.threecal-stat-card {
    background: #fff;
    padding: 20px 24px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
}

.threecal-stat-card .stat-label {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 6px;
}

.threecal-stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a2e;
}

.threecal-stat-card.success .stat-value { color: #059669; }
.threecal-stat-card.warning .stat-value { color: #d97706; }
.threecal-stat-card.danger .stat-value { color: #dc2626; }

/* ==========================================================================
   CSS Variables
   ========================================================================== */
:root {
    --cc-primary: #6366f1;
    --cc-primary-light: #818cf8;
    --cc-primary-dark: #4f46e5;
    --cc-secondary: #ec4899;
    --cc-accent: #06b6d4;
    --cc-success: #10b981;
    --cc-warning: #f59e0b;
    --cc-danger: #ef4444;

    --cc-bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --cc-card-bg: #ffffff;
    --cc-border: #e5e7eb;
    --cc-text: #1f2937;
    --cc-text-light: #6b7280;
    --cc-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --cc-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --cc-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    --cc-radius: 12px;
    --cc-radius-sm: 8px;
    --cc-radius-lg: 16px;
    --cc-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Base Admin Styles
   ========================================================================== */
.threecal-admin {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.threecal-admin h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--cc-text);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.threecal-admin h1::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 32px;
    background: var(--cc-bg-gradient);
    border-radius: 3px;
}

.threecal-admin .page-title-action {
    background: var(--cc-bg-gradient);
    border: none;
    color: #fff;
    padding: 8px 16px;
    border-radius: var(--cc-radius-sm);
    font-weight: 500;
    text-decoration: none;
    transition: var(--cc-transition);
    box-shadow: var(--cc-shadow);
}

.threecal-admin .page-title-action:hover {
    transform: translateY(-2px);
    box-shadow: var(--cc-shadow-lg);
    color: #fff;
}

/* ==========================================================================
   Cards
   ========================================================================== */
.threecal-card {
    background: var(--cc-card-bg);
    border-radius: var(--cc-radius-lg);
    box-shadow: var(--cc-shadow);
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--cc-border);
    transition: var(--cc-transition);
}

.threecal-card:hover {
    box-shadow: var(--cc-shadow-lg);
}

.threecal-card h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--cc-text);
    margin: 0 0 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--cc-border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.threecal-card h2::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 20px;
    background: var(--cc-bg-gradient);
    border-radius: 2px;
}

/* ==========================================================================
   Meta Boxes (Sidebar)
   ========================================================================== */
.threecal-meta-box {
    background: var(--cc-card-bg);
    border-radius: var(--cc-radius);
    box-shadow: var(--cc-shadow);
    margin-bottom: 20px;
    overflow: hidden;
    border: 1px solid var(--cc-border);
}

.threecal-meta-box h3 {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    margin: 0;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--cc-text);
    border-bottom: 1px solid var(--cc-border);
}

.threecal-meta-box-content {
    padding: 16px;
}

/* ==========================================================================
   Form Fields
   ========================================================================== */
.threecal-field {
    margin-bottom: 20px;
}

.threecal-field label {
    display: block;
    font-weight: 500;
    color: var(--cc-text);
    margin-bottom: 8px;
    font-size: 14px;
}

.threecal-field label .required {
    color: var(--cc-danger);
}

.threecal-field input[type="text"],
.threecal-field input[type="email"],
.threecal-field input[type="url"],
.threecal-field input[type="tel"],
.threecal-field input[type="number"],
.threecal-field input[type="datetime-local"],
.threecal-field select,
.threecal-field textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--cc-border);
    border-radius: var(--cc-radius-sm);
    font-size: 14px;
    color: var(--cc-text);
    background: #fff;
    transition: var(--cc-transition);
}

.threecal-field input:focus,
.threecal-field select:focus,
.threecal-field textarea:focus {
    outline: none;
    border-color: var(--cc-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.threecal-field .threecal-organizer-url {
    margin-top: 8px;
}

.threecal-field-row {
    display: flex;
    gap: 16px;
}

.threecal-field-half {
    flex: 1;
}

.threecal-field-third {
    flex: 0 0 33%;
}

.threecal-field-two-thirds {
    flex: 1;
}

.threecal-add-new {
    display: inline-block;
    margin-top: 8px;
    color: var(--cc-primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.threecal-add-new:hover {
    color: var(--cc-primary-dark);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.threecal-admin .button-primary,
.threecal-submit-actions .button-primary {
    background: var(--cc-bg-gradient);
    border: none;
    color: #fff;
    padding: 10px 24px;
    border-radius: var(--cc-radius-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--cc-transition);
    box-shadow: var(--cc-shadow);
}

.threecal-admin .button-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--cc-shadow-lg);
}

.threecal-admin .button {
    border-radius: var(--cc-radius-sm);
    transition: var(--cc-transition);
}

.threecal-delete-link {
    color: var(--cc-danger);
    text-decoration: none;
    margin-left: 12px;
}

.threecal-delete-link:hover {
    color: #dc2626;
    text-decoration: underline;
}

.threecal-submit-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--cc-border);
    margin-top: 16px;
}

/* ==========================================================================
   Layout - Two Columns
   ========================================================================== */
.threecal-edit-container {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    margin-top: 24px;
}

.threecal-edit-main {
    background: var(--cc-card-bg);
    border-radius: var(--cc-radius-lg);
    padding: 24px;
    box-shadow: var(--cc-shadow);
    border: 1px solid var(--cc-border);
}

.threecal-two-columns {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 24px;
    margin-top: 24px;
}

.threecal-form-column .threecal-card {
    position: sticky;
    top: 40px;
}

/* ==========================================================================
   Categories List (Checkboxes)
   ========================================================================== */
.threecal-categories-list {
    max-height: 200px;
    overflow-y: auto;
    padding: 4px;
}

.threecal-categories-list label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--cc-radius-sm);
    cursor: pointer;
    transition: var(--cc-transition);
    margin-bottom: 4px;
}

.threecal-categories-list label:hover {
    background: #f8fafc;
}

.threecal-cat-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* ==========================================================================
   Color Indicator
   ========================================================================== */
.threecal-color-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    margin-right: 8px;
    vertical-align: middle;
}

/* ==========================================================================
   Image Upload
   ========================================================================== */
.threecal-image-upload {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.threecal-image-preview {
    max-width: 200px;
    border-radius: var(--cc-radius-sm);
    overflow: hidden;
}

.threecal-image-preview img {
    display: block;
    width: 100%;
    height: auto;
}

/* ==========================================================================
   Status Labels
   ========================================================================== */
.threecal-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.threecal-status-draft {
    background: #fef3c7;
    color: #92400e;
}

.threecal-status-published {
    background: #d1fae5;
    color: #065f46;
}

.threecal-status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

/* ==========================================================================
   Category Tags
   ========================================================================== */
.threecal-category-tag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    color: #fff;
    margin-right: 4px;
}

/* ==========================================================================
   List Table Enhancements
   ========================================================================== */
.threecal-admin .wp-list-table {
    border-radius: var(--cc-radius);
    overflow: hidden;
    border: 1px solid var(--cc-border);
}

.threecal-admin .wp-list-table th {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    font-weight: 600;
}

.threecal-admin .wp-list-table td {
    vertical-align: middle;
}

.threecal-time,
.threecal-all-day {
    color: var(--cc-text-light);
    font-size: 12px;
}

.threecal-actions-col {
    width: 140px;
}

/* ==========================================================================
   Stats Box
   ========================================================================== */
.threecal-stats {
    background: linear-gradient(135deg, var(--cc-primary) 0%, var(--cc-secondary) 100%);
    border-radius: var(--cc-radius-lg);
    padding: 24px;
    margin-top: 24px;
    color: #fff;
}

.threecal-stats h3 {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 600;
    opacity: 0.9;
}

.threecal-stats ul {
    display: flex;
    gap: 32px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.threecal-stats li {
    display: flex;
    flex-direction: column;
}

.threecal-stats li strong {
    font-size: 28px;
    font-weight: 700;
}

/* ==========================================================================
   Settings Page
   ========================================================================== */
.threecal-settings-page .nav-tab-wrapper {
    border-bottom: 2px solid var(--cc-border);
    margin-bottom: 24px;
}

.threecal-settings-page .nav-tab {
    border: none;
    border-bottom: 3px solid transparent;
    background: transparent;
    padding: 12px 20px;
    font-weight: 500;
    color: var(--cc-text-light);
    margin-bottom: -2px;
    transition: var(--cc-transition);
}

.threecal-settings-page .nav-tab:hover {
    color: var(--cc-primary);
    background: transparent;
}

.threecal-settings-page .nav-tab-active {
    color: var(--cc-primary);
    border-bottom-color: var(--cc-primary);
    background: transparent;
}

.threecal-settings-content {
    background: var(--cc-card-bg);
    border-radius: var(--cc-radius-lg);
    padding: 24px 32px;
    box-shadow: var(--cc-shadow);
    border: 1px solid var(--cc-border);
}

.threecal-settings-content .form-table th {
    padding: 20px 10px 20px 0;
    font-weight: 500;
}

.threecal-settings-content .form-table td {
    padding: 15px 10px;
}

.threecal-warning {
    color: var(--cc-danger);
    font-weight: 500;
}

.threecal-shortcode-reference {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--cc-border);
}

.threecal-shortcode-reference h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.threecal-shortcode-reference code {
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'SFMono-Regular', Consolas, monospace;
}

/* ==========================================================================
   Notices
   ========================================================================== */
.threecal-admin .notice {
    border-radius: var(--cc-radius-sm);
    border-left-width: 4px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1200px) {
    .threecal-edit-container {
        grid-template-columns: 1fr;
    }

    .threecal-two-columns {
        grid-template-columns: 1fr;
    }

    .threecal-form-column .threecal-card {
        position: static;
    }
}

@media (max-width: 782px) {
    .threecal-field-row {
        flex-direction: column;
    }

    .threecal-stats ul {
        flex-wrap: wrap;
    }
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.threecal-admin .threecal-card,
.threecal-admin .threecal-meta-box {
    animation: fadeIn 0.4s ease-out;
}

/* ==========================================================================
   Color Picker Enhancement
   ========================================================================== */
.threecal-color-picker {
    max-width: 100px;
}

.wp-picker-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wp-picker-container .wp-color-result {
    border-radius: var(--cc-radius-sm);
}

/* ==========================================================================
   Submit Row
   ========================================================================== */
.threecal-submit-row {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--cc-border);
}

/* ==========================================================================
   No Items Message
   ========================================================================== */
.threecal-no-items {
    text-align: center;
    padding: 40px;
    color: var(--cc-text-light);
    font-style: italic;
}

/* ==========================================================================
   New Header Design
   ========================================================================== */
.threecal-header {
    background: #fff;
    padding: 16px 24px;
    margin: -10px -20px 0 -20px;
    border-bottom: 1px solid #e1e5eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.threecal-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.threecal-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.threecal-logo-icon {
    font-size: 28px;
    width: 28px;
    height: 28px;
    color: #2563eb;
}

.threecal-admin-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
    padding: 0;
    line-height: 1;
}

.threecal-version {
    font-size: 0.7rem;
    color: #9ca3af;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 4px;
}


/* ==========================================================================
   Nav Tab Wrapper - Integrate With WordPress
   ========================================================================== */
.threecal-tabs.nav-tab-wrapper {
    background: #fff;
    margin: 0 -20px;
    padding: 0 24px;
    border-bottom: 1px solid #e1e5eb;
}

.threecal-tabs .nav-tab {
    border: none;
    border-bottom: 3px solid transparent;
    background: transparent;
    padding: 14px 18px;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: -1px;
    transition: all 0.2s;
}

.threecal-tabs .nav-tab:hover {
    color: #2563eb;
    background: #f9fafb;
}

.threecal-tabs .nav-tab.nav-tab-active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    background: transparent;
}


/* ==========================================================================
   Tab Content
   ========================================================================== */
.threecal-tab-content {
    padding: 24px 0;
}


/* ==========================================================================
   Support Tab
   ========================================================================== */
.threecal-support-card {
    text-align: center;
}

.threecal-intro {
    font-size: 1.1rem;
    color: #6b7280;
    margin-bottom: 24px;
}

.threecal-benefits-list {
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.threecal-benefits-list li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.threecal-benefits-list .dashicons {
    color: #ef4444;
}

.threecal-support-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.threecal-support-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #f9fafb;
    border-radius: 8px;
    text-decoration: none;
    color: #374151;
    transition: all 0.2s;
}

.threecal-support-link:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.threecal-support-link .dashicons {
    color: #6b7280;
}

/* Help Page Styles */
.threecal-help-page .threecal-card {
    margin-bottom: 20px;
}

.threecal-code-block {
    display: block;
    background: #f6f7f7;
    padding: 12px 15px;
    border-radius: 4px;
    font-size: 13px;
    overflow-x: auto;
}

.threecal-help-page h4 {
    margin: 20px 0 10px;
    color: #1d2327;
}

.threecal-help-page .feature-item {
    padding: 15px;
    background: #f9f9f9;
    border-radius: 6px;
}

.threecal-help-page .feature-item .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    margin-bottom: 8px;
}

.threecal-help-page .feature-item strong {
    display: block;
    margin-bottom: 5px;
}

.threecal-help-page .feature-item p {
    margin: 0;
    color: #646970;
    font-size: 13px;
}

/* Series badge (1.3.0) */
.threecal-series-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 10px;
    background: #f0f6fc;
    color: #2271b1;
    font-size: 11px;
    font-weight: 600;
    vertical-align: 1px;
}


/* ==========================================================================
   3task design system (1.3.0): header, tabs, KPIs, panels
   Same structure as LinkTrade Monitor and 3task Glossary,
   own gradient for the calendar (blue to teal).
   ========================================================================== */
.threecal-admin {
    --tca-g1: #2563eb;
    --tca-g2: #0ea5e9;
    --tca-g3: #14b8a6;
    --tca-text: #0f172a;
    --tca-muted: #64748b;
    --tca-border: #e2e8f0;
    --tca-bg: #f8fafc;
    --tca-card: #ffffff;
    --tca-radius: 16px;
    --tca-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
    margin: 20px 20px 40px 0;
    color: var(--tca-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.threecal-admin .threecal-icon {
    display: inline-block;
    flex: 0 0 auto;
    vertical-align: middle;
}

/* Header */
.threecal-admin-header {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    padding: 30px 36px;
    overflow: hidden;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--tca-g1), var(--tca-g2), var(--tca-g3));
    background-size: 200% 200%;
    box-shadow: 0 12px 32px rgba(14, 116, 144, 0.22);
    color: #ffffff;
    animation: threecal-admin-shift 10s ease infinite;
}

.threecal-admin-header::before,
.threecal-admin-header::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

.threecal-admin-header::before {
    top: -40px;
    right: 12%;
    width: 140px;
    height: 140px;
}

.threecal-admin-header::after {
    bottom: -30px;
    right: 30%;
    width: 90px;
    height: 90px;
}

@keyframes threecal-admin-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.threecal-admin-header-left,
.threecal-admin-header-right {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 18px;
}

.threecal-admin-header-right {
    gap: 10px;
}

.threecal-admin-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.threecal-admin-title {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.threecal-admin-name {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.threecal-admin-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.threecal-admin-version {
    padding: 3px 12px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.2);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.threecal-admin-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.threecal-admin-status::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.25);
}

.threecal-admin .threecal-admin-header-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.threecal-admin .threecal-admin-header-btn:hover,
.threecal-admin .threecal-admin-header-btn:focus {
    background: rgba(255, 255, 255, 0.26);
    color: #ffffff;
    transform: translateY(-1px);
}

/* Tabs */
.threecal-admin-tabs {
    display: flex;
    gap: 4px;
    padding: 8px 14px 0;
    overflow-x: auto;
    border: 1px solid var(--tca-border);
    border-bottom: 0;
    border-radius: var(--tca-radius) var(--tca-radius) 0 0;
    background: var(--tca-card);
    scrollbar-width: none;
}

.threecal-admin .threecal-admin-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    border-radius: 12px 12px 0 0;
    color: var(--tca-muted);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.threecal-admin .threecal-admin-tab::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: linear-gradient(90deg, var(--tca-g1), var(--tca-g3));
    transform: translateX(-50%);
    transition: width 0.2s ease;
}

.threecal-admin .threecal-admin-tab:hover {
    background: var(--tca-bg);
    color: var(--tca-g1);
}

.threecal-admin .threecal-admin-tab.is-active {
    background: linear-gradient(180deg, #e0f2fe 0%, #ffffff 100%);
    color: var(--tca-g1);
}

.threecal-admin .threecal-admin-tab.is-active::after {
    width: 100%;
}

.threecal-admin .threecal-admin-tab:focus-visible {
    outline: 2px solid var(--tca-g1);
    outline-offset: -2px;
    box-shadow: none;
}

.threecal-admin-badge {
    padding: 1px 8px;
    border-radius: 100px;
    background: var(--tca-g3);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
}

.threecal-admin .threecal-admin-content {
    min-height: 480px;
    padding: 28px;
    border: 1px solid var(--tca-border);
    border-top: 0;
    border-radius: 0 0 var(--tca-radius) var(--tca-radius);
    background: var(--tca-card);
    box-shadow: var(--tca-shadow);
}

/* Onboarding */
.threecal-onboarding {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
    margin-bottom: 24px;
    padding: 22px 24px;
    border: 1px solid #bae6fd;
    border-radius: var(--tca-radius);
    background: linear-gradient(135deg, #eff6ff, #ecfeff);
}

.threecal-onboarding-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: #ffffff;
    color: var(--tca-g1);
    box-shadow: var(--tca-shadow);
}

.threecal-onboarding-text {
    flex: 1 1 260px;
}

.threecal-onboarding-text h2 {
    margin: 0 0 4px;
    font-size: 18px;
}

.threecal-onboarding-text p {
    margin: 0;
    color: var(--tca-muted);
}

/* Buttons */
.threecal-admin .threecal-btn-primary,
.threecal-admin .button-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 18px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--tca-g1), var(--tca-g2));
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    line-height: 40px;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.threecal-admin .threecal-btn-primary:hover,
.threecal-admin .button-primary:hover,
.threecal-admin .button-primary:focus {
    background: linear-gradient(135deg, #1d4ed8, #0284c7);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.3);
}

/* KPI cards */
.threecal-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.threecal-kpi {
    position: relative;
    padding: 22px;
    overflow: hidden;
    border: 1px solid var(--tca-border);
    border-radius: var(--tca-radius);
    background: var(--tca-card);
    box-shadow: var(--tca-shadow);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.threecal-kpi::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--kpi, var(--tca-g1));
}

.threecal-kpi:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.05), 0 16px 32px rgba(15, 23, 42, 0.1);
}

.kpi-blue { --kpi: #2563eb; }
.kpi-green { --kpi: #10b981; }
.kpi-orange { --kpi: #f59e0b; }
.kpi-teal { --kpi: #14b8a6; }

.threecal-kpi-head {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin-bottom: 12px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--kpi) 12%, #ffffff);
    color: var(--kpi);
}

.threecal-kpi-value {
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
}

.threecal-kpi-label {
    margin-top: 8px;
    color: var(--tca-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Panels */
.threecal-admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.threecal-admin-side {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.threecal-panel,
.threecal-admin .threecal-card {
    padding: 24px;
    border: 1px solid var(--tca-border);
    border-radius: var(--tca-radius);
    background: var(--tca-card);
    box-shadow: var(--tca-shadow);
}

.threecal-panel + .threecal-panel {
    margin-top: 0;
}

.threecal-design-form .threecal-panel {
    margin-bottom: 24px;
}

.threecal-admin .threecal-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px;
    padding: 0 0 14px;
    border-bottom: 1px solid var(--tca-border);
    font-size: 16px;
    font-weight: 700;
}

.threecal-panel-title .threecal-icon {
    color: var(--tca-g1);
}

.threecal-panel-tint {
    border-color: #bae6fd;
    background: linear-gradient(135deg, #f0f9ff, #f0fdfa);
}

.threecal-muted {
    color: var(--tca-muted);
}

.threecal-admin-upcoming {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.threecal-admin-upcoming li {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--tca-border);
    border-radius: 12px;
    background: var(--tca-bg);
}

.threecal-admin-date {
    display: flex;
    flex: 0 0 48px;
    flex-direction: column;
    align-items: center;
    padding: 6px 0;
    border-radius: 10px;
    background: color-mix(in srgb, var(--tc-ev, var(--tca-g1)) 14%, #ffffff);
    color: color-mix(in srgb, var(--tc-ev, var(--tca-g1)) 75%, #0f172a);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.1;
    text-transform: uppercase;
}

.threecal-admin-date strong {
    font-size: 20px;
}

.threecal-admin-upcoming-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.threecal-admin-upcoming-text a {
    overflow: hidden;
    color: var(--tca-text);
    font-weight: 650;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.threecal-admin-upcoming-text a:hover {
    color: var(--tca-g1);
}

.threecal-quick {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.threecal-admin .threecal-quick a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 18px 10px;
    border: 1px solid var(--tca-border);
    border-radius: 14px;
    background: var(--tca-bg);
    color: var(--tca-text);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.threecal-admin .threecal-quick a:hover {
    border-color: #7dd3fc;
    box-shadow: var(--tca-shadow);
    transform: translateY(-2px);
}

.threecal-quick-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #ffffff;
    color: var(--tca-g1);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.threecal-pill {
    display: inline-block;
    margin-bottom: 12px;
    padding: 4px 12px;
    border-radius: 100px;
    background: linear-gradient(135deg, var(--tca-g1), var(--tca-g3));
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.threecal-feature-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.threecal-feature-chips li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 6px 12px;
    border: 1px solid #bae6fd;
    border-radius: 100px;
    background: #ffffff;
    font-size: 13px;
    font-weight: 500;
}

.threecal-feature-chips .threecal-icon {
    color: var(--tca-g3);
}

/* Design tab */
.threecal-design-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 18px;
}

.threecal-design-option {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    border: 2px solid var(--tca-border);
    border-radius: 16px;
    background: var(--tca-bg);
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.threecal-design-option input {
    position: absolute;
    opacity: 0;
}

.threecal-design-option:hover {
    border-color: #7dd3fc;
}

.threecal-design-option.is-selected,
.threecal-design-option:has(input:checked) {
    border-color: var(--tca-g1);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.threecal-design-option:has(input:focus-visible) {
    outline: 2px solid var(--tca-g1);
    outline-offset: 2px;
}

.threecal-design-preview {
    display: block;
    pointer-events: none;
}

.threecal-design-preview .threecal-mini-wrapper {
    max-width: none;
}

.threecal-design-name {
    font-size: 15px;
    font-weight: 700;
}

.threecal-design-name code {
    margin-left: 4px;
    font-size: 11px;
}

.threecal-design-desc {
    color: var(--tca-muted);
    font-size: 13px;
}

@media (max-width: 1200px) {
    .threecal-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .threecal-admin-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 600px) {
    .threecal-admin {
        margin-right: 10px;
    }

    .threecal-admin-header {
        padding: 22px;
    }

    .threecal-admin .threecal-admin-content {
        padding: 16px;
    }

    .threecal-kpis {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    .threecal-admin-header {
        animation: none;
    }
}

/* Header text stays white (older rules use the same class names) */
.threecal-admin .threecal-admin-header .threecal-admin-title,
.threecal-admin .threecal-admin-header .threecal-admin-name,
.threecal-admin .threecal-admin-header .threecal-admin-meta,
.threecal-admin .threecal-admin-header .threecal-admin-status,
.threecal-admin .threecal-admin-header .threecal-admin-version {
    margin: 0;
    padding: 0;
    border: 0;
    background-color: transparent;
    color: #ffffff;
    font-size: inherit;
}

.threecal-admin .threecal-admin-header .threecal-admin-name {
    font-size: 26px;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.threecal-admin .threecal-admin-header .threecal-admin-meta {
    font-size: 13px;
}

.threecal-admin .threecal-admin-header .threecal-admin-version {
    padding: 3px 12px;
    background: rgba(255, 255, 255, 0.2);
    font-size: 11px;
}

/* Events list (1.3.0) */
.threecal-list-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.threecal-segmented {
    display: inline-flex;
    padding: 3px;
    border: 1px solid var(--tca-border);
    border-radius: 100px;
    background: var(--tca-bg);
}

.threecal-admin .threecal-segmented a {
    padding: 8px 16px;
    border-radius: 100px;
    color: var(--tca-muted);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.threecal-admin .threecal-segmented a.is-active {
    background: #ffffff;
    color: var(--tca-g1);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}

.threecal-event-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.threecal-event-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0;
    padding: 10px 14px;
    border: 1px solid var(--tca-border);
    border-left: 4px solid var(--tc-ev, var(--tca-g1));
    border-radius: 12px;
    background: #ffffff;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.threecal-event-row:hover {
    box-shadow: var(--tca-shadow);
}

.threecal-event-row.status-draft {
    background: #fffbeb;
}

.threecal-event-row.status-cancelled .threecal-event-row-title {
    text-decoration: line-through;
    opacity: 0.7;
}

.threecal-event-row-main {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.threecal-admin .threecal-event-row-title {
    overflow: hidden;
    color: var(--tca-text);
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.threecal-admin .threecal-event-row-title:hover {
    color: var(--tca-g1);
}

.threecal-event-row-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    color: var(--tca-muted);
    font-size: 12px;
}

.threecal-event-row-meta > span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.threecal-admin .threecal-series-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 1px 8px;
    border-radius: 100px;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 11px;
    font-weight: 600;
}

.threecal-cat-chip {
    padding: 1px 8px;
    border-radius: 100px;
    background: color-mix(in srgb, var(--tc-ev, var(--tca-g1)) 14%, #ffffff);
    color: color-mix(in srgb, var(--tc-ev, var(--tca-g1)) 70%, #0f172a);
    font-size: 11px;
    font-weight: 600;
}

.threecal-status {
    flex: 0 0 auto;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
}

.threecal-status-published { background: #dcfce7; color: #166534; }
.threecal-status-draft { background: #fef3c7; color: #92400e; }
.threecal-status-cancelled { background: #fee2e2; color: #991b1b; }

.threecal-event-row-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 4px;
}

.threecal-admin .threecal-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    color: var(--tca-muted);
    text-decoration: none;
}

.threecal-admin .threecal-icon-btn:hover {
    background: var(--tca-bg);
    color: var(--tca-g1);
}

.threecal-admin .threecal-icon-btn.is-danger:hover {
    background: #fef2f2;
    color: #dc2626;
}

.threecal-empty {
    padding: 48px 16px;
    border: 2px dashed var(--tca-border);
    border-radius: var(--tca-radius);
    color: var(--tca-muted);
    text-align: center;
}

.threecal-empty .threecal-icon {
    color: var(--tca-g2);
}

@media (max-width: 782px) {
    .threecal-event-row {
        flex-wrap: wrap;
    }

    .threecal-status {
        order: 3;
    }
}

/* Dates of a series */
.threecal-series-dates {
    margin-top: 24px;
}

.threecal-series-table {
    width: 100%;
    border-collapse: collapse;
}

.threecal-series-table td {
    padding: 9px 10px;
    border-bottom: 1px solid #eef0f4;
    vertical-align: middle;
}

.threecal-series-table tr:last-child td {
    border-bottom: 0;
}

.threecal-series-date {
    font-weight: 600;
    white-space: nowrap;
}

.threecal-series-time {
    margin-left: 8px;
    color: #64748b;
    font-weight: 400;
}

.threecal-series-table tr.is-cancelled .threecal-series-date {
    text-decoration: line-through;
    color: #94a3b8;
}

.threecal-series-table tr.is-past {
    opacity: 0.55;
}

.threecal-series-first {
    font-size: 12px;
    color: #64748b;
}

.threecal-series-actions {
    text-align: right;
    white-space: nowrap;
}

.threecal-series-actions a {
    margin-left: 14px;
    text-decoration: none;
    font-weight: 600;
}

.threecal-series-actions a.threecal-series-remove {
    color: #b91c1c;
}

@media (max-width: 782px) {
    .threecal-series-table td {
        display: block;
        padding: 4px 0;
        border: 0;
        text-align: left;
    }

    .threecal-series-table tr {
        display: block;
        padding: 8px 0;
        border-bottom: 1px solid #eef0f4;
    }

    .threecal-series-actions a {
        margin: 0 14px 0 0;
    }
}

/* Dates from posts (tab "Posts") */
.threecal-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.threecal-post-type-card.is-on {
    border-left: 4px solid #2563eb;
}

.threecal-post-type-card:not(.is-on) .form-table tr + tr {
    opacity: 0.6;
}

.threecal-source-custom {
    display: block;
    margin-top: 8px;
}

.threecal-source-custom[hidden] {
    display: none;
}

.threecal-post-type-card select {
    min-width: 16rem;
    max-width: 100%;
}

.threecal-sync-progress {
    margin-left: 10px;
    color: #1d4ed8;
    font-weight: 600;
}

.threecal-from-posts-note {
    margin: 0 0 16px;
}

.threecal-from-posts-note a {
    margin-left: 6px;
    font-weight: 600;
}

/* ==========================================================================
   CSV import and month-only dates (since 1.6.0)
   ========================================================================== */
.threecal-import-table-wrap {
    max-width: 100%;
    margin: 12px 0;
    overflow-x: auto;
}

.threecal-import-table td {
    vertical-align: top;
}

.threecal-import-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.threecal-import-badge.is-new {
    background: #dcfce7;
    color: #166534;
}

.threecal-import-badge.is-update {
    background: #dbeafe;
    color: #1e40af;
}

.threecal-import-badge.is-error {
    background: #fee2e2;
    color: #991b1b;
}

.threecal-import-form .button .threecal-icon {
    vertical-align: -3px;
}

.threecal-precision-field {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin: 0 0 16px;
    padding: 0;
    border: 0;
}

.threecal-precision-field legend {
    width: 100%;
    margin-bottom: 6px;
    font-weight: 600;
}

.threecal-month-field[hidden],
.threecal-day-fields[hidden],
.threecal-recurrence-fields[hidden] {
    display: none;
}

/* "Fill in from this website" (since 1.7.0) */
.threecal-url-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.threecal-url-row .large-text {
    flex: 1 1 auto;
}

.threecal-url-row .threecal-prefill-btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.threecal-prefill-result {
    margin-top: 8px;
    padding: 8px 10px;
    border-left: 3px solid #8c8f94;
    background: #f6f7f7;
    font-size: 13px;
}

.threecal-prefill-result.is-ok {
    border-left-color: #00a32a;
}

.threecal-prefill-result.is-error {
    border-left-color: #d63638;
}

@media (max-width: 782px) {
    .threecal-url-row {
        flex-wrap: wrap;
    }
}

/* Schema check (since 1.7.0) */
.threecal-schema-doktor .threecal-schema-ok {
    color: #00a32a;
    font-weight: 600;
}

.threecal-schema-doktor .threecal-schema-no {
    color: #996800;
}

/* Submitted events (since 1.7.0) */
.threecal-badge-submitted {
    display: inline-block;
    align-self: flex-start;
    width: auto;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 999px;
    background: #2271b1;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    vertical-align: middle;
}
