/* ============================================================
   MMDT — Swiss Minimalist Admin Panel Styles
   ============================================================ */

:root {
    --bg-page: #fbfbfb;
    --bg-surface: #ffffff;
    --bg-sidebar: #0e0e0e;
    --text-primary: #111111;
    --text-secondary: #555555;
    --text-meta: #888888;
    --text-on-dark: #f0f0f0;
    --text-meta-dark: #888888;
    --border: #e8e8e8;
    --border-dark: #222222;
    --border-active: #000000;
    --accent: #000000;
    --accent-badge: #f2f2f2;
    --accent-badge-text: #111111;
    --status-green: #10b981;
    --status-amber: #f59e0b;
    --status-red: #ef4444;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}

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

body {
    font-family: var(--font-sans);
    background: var(--bg-page);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Sidebar */
.admin-sidebar {
    width: 250px;
    background: var(--bg-sidebar);
    color: var(--text-on-dark);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-right: 1px solid var(--border-dark);
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-dark);
}

.sidebar-logo {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #ffffff;
    text-transform: uppercase;
}

.sidebar-sub {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-meta-dark);
    margin-top: 4px;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 6px;
    color: #999999;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.nav-item:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

.nav-item svg {
    flex-shrink: 0;
    opacity: 0.75;
}

.nav-item.active svg {
    opacity: 1;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-dark);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.preview-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.preview-link:hover {
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

/* Main Content */
.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-y: auto;
}

.admin-header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 20px 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 20;
}

.header-title-box h1 {
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.header-title-box p {
    font-size: 0.82rem;
    color: var(--text-meta);
    margin-top: 2px;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 0.84rem;
    font-weight: 500;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.btn:hover {
    border-color: #000;
}

.btn-primary {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
}

.btn-primary:hover {
    background: #222222;
    border-color: #222222;
}

.btn-danger {
    color: var(--status-red);
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: var(--status-red);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.78rem;
}

/* Page Containers */
.admin-content {
    padding: 32px 36px;
    width: 100%;
    box-sizing: border-box;
}

.admin-panel-section {
    display: none;
}

.admin-panel-section.active {
    display: block;
}

/* Sub tabs for Events */
.subtabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.subtab-btn {
    padding: 10px 16px;
    font-size: 0.88rem;
    font-weight: 500;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: color 0.15s ease;
}

.subtab-btn:hover {
    color: #000;
}

.subtab-btn.active {
    color: #000;
    font-weight: 600;
}

.subtab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: #000;
}

.subtab-count {
    display: inline-block;
    padding: 1px 6px;
    font-size: 0.72rem;
    border-radius: 10px;
    background: #eee;
    color: #555;
    margin-left: 6px;
}

/* Cards Grid */
.cards-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.item-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    display: grid;
    grid-template-columns: 140px 1fr auto;
    gap: 20px;
    align-items: start;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.item-card:hover {
    border-color: #bbb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.item-card-thumb {
    width: 140px;
    height: 100px;
    border-radius: 6px;
    background: #f0f0f0;
    object-fit: cover;
    border: 1px solid var(--border);
}

.item-card-nothumb {
    width: 140px;
    height: 100px;
    border-radius: 6px;
    background: #f7f7f7;
    border: 1px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-meta);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.item-card-details h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.item-card-meta {
    font-size: 0.8rem;
    color: var(--text-meta);
    margin-bottom: 8px;
}

.item-card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 12px;
}

.item-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 500;
    background: var(--accent-badge);
    color: var(--accent-badge-text);
}

.item-card-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
    min-width: 130px;
}

/* Forms & Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 24px;
}

.modal-overlay.active {
    display: flex;
}

.modal-dialog {
    background: var(--bg-surface);
    border-radius: 12px;
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    font-size: 1.15rem;
    font-weight: 600;
}

.modal-close-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--text-meta);
    cursor: pointer;
}

.modal-close-btn:hover {
    color: #000;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #fafafa;
    border-radius: 0 0 12px 12px;
}

/* Form inputs */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.88rem;
    font-family: inherit;
    background: #fff;
    color: #111;
    transition: border-color 0.15s ease;
}

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

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

.form-hint {
    font-size: 0.74rem;
    color: var(--text-meta);
}

/* Image dropzone */
.image-upload-box {
    border: 1px dashed var(--border);
    border-radius: 6px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fafafa;
}

.upload-preview-img {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    object-fit: cover;
    background: #eee;
    border: 1px solid var(--border);
}

/* Toast */
.toast-box {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: #111;
    color: #fff;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 0.84rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn 0.2s ease;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Full-Page Editor Views */
.editor-page-view {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 48px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
    animation: fadeInPage 0.2s ease-out;
}

@keyframes fadeInPage {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.editor-page-header {
    padding: 18px 28px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #fafafa;
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(8px);
}

.editor-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    flex: 1;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 500;
    padding: 7px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-back:hover {
    background: #f0f0f0;
    border-color: #000;
}

.editor-header-title {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.editor-header-title h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}

.editor-header-title p {
    font-size: 0.82rem;
    color: var(--text-meta);
    margin: 3px 0 0;
}

.editor-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.editor-page-body {
    padding: 28px 32px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    background: #ffffff;
}

.editor-page-footer {
    padding: 18px 32px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fafafa;
    gap: 16px;
}

.admin-page-link {
    color: var(--text-main);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: opacity 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.admin-page-link:hover {
    opacity: 0.65;
    color: #000;
}

/* Festival Editor & Repeaters */
.fest-subtabs-nav {
    display: flex;
    gap: 4px;
    padding: 10px 18px;
    background: #f8f9fa;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: thin;
    position: sticky;
    top: 67px;
    z-index: 25;
    backdrop-filter: blur(8px);
}

.fest-tab-nav-btn {
    padding: 8px 14px;
    font-size: 0.82rem;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--text-meta);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.fest-tab-nav-btn:hover {
    color: var(--text-main);
    background: rgba(0, 0, 0, 0.04);
}

.fest-tab-nav-btn.active {
    color: #000;
    font-weight: 600;
    background: #fff;
    border-color: var(--border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.fest-subtab-pane {
    display: none;
}

.fest-subtab-pane.active {
    display: block;
}

/* Project Editor Subtabs */
.proj-subtabs-nav {
    display: flex;
    gap: 4px;
    padding: 10px 18px;
    background: #f8f9fa;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: thin;
    position: sticky;
    top: 67px;
    z-index: 25;
    backdrop-filter: blur(8px);
}

.proj-tab-nav-btn {
    padding: 8px 14px;
    font-size: 0.82rem;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--text-meta);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.proj-tab-nav-btn:hover {
    color: var(--text-main);
    background: rgba(0, 0, 0, 0.04);
}

.proj-tab-nav-btn.active {
    color: #000;
    font-weight: 600;
    background: #fff;
    border-color: var(--border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.proj-subtab-pane {
    display: none;
}

.proj-subtab-pane.active {
    display: block;
}

.repeater-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.repeater-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 8px;
}

.repeater-card-header h5 {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 600;
}

.editor-section-header {
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.editor-section-header h4 {
    margin: 0 0 4px;
    font-size: 1rem;
    font-weight: 600;
}

.editor-section-header p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-meta);
}

/* Nested Teacher Classes */
.teacher-classes-wrapper {
    background: #fafafa;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 14px;
    margin-top: 8px;
}

.teacher-classes-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.teacher-class-card {
    background: #fff;
    border: 1px solid var(--border);
    border-left: 3px solid #111;
    border-radius: 6px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.teacher-class-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.teacher-class-card-header span {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
}

/* ============================================================
   Partners Admin View (Cards & Rows)
   ============================================================ */

.partners-view-toggle {
    display: inline-flex;
    background: #f1f5f9;
    padding: 3px;
    border-radius: 8px;
    border: 1px solid var(--border);
    gap: 2px;
}

.partners-view-btn {
    border: none;
    background: transparent;
    padding: 6px 12px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
    line-height: 1;
}

.partners-view-btn:hover {
    color: var(--text-primary);
}

.partners-view-btn.active {
    background: #ffffff;
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* CARDS VIEW */
.partners-grid-view {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important;
    gap: 16px !important;
}

.partner-admin-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.partner-admin-card:hover {
    border-color: #94a3b8;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.partner-admin-card__top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.partner-admin-card__order {
    display: flex;
    gap: 4px;
}

.partner-admin-card__order .btn-arrow,
.partner-admin-row__order .btn-arrow {
    width: 26px;
    height: 24px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    border: 1px solid var(--border);
    background: #f8fafc;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.12s ease;
}

.partner-admin-card__order .btn-arrow:hover,
.partner-admin-row__order .btn-arrow:hover {
    background: #e2e8f0;
    color: var(--text-primary);
}

.partner-admin-card__body h3 {
    margin: 8px 0 6px 0;
    font-size: 1.08rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.35;
}

.partner-admin-card__desc {
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.partner-admin-card__link {
    font-size: 0.78rem;
    color: var(--text-meta);
    word-break: break-all;
    background: #f8fafc;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #f1f5f9;
}

.partner-admin-card__link a {
    color: var(--accent);
    text-decoration: underline;
    font-weight: 500;
}

.partner-admin-card__actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid #f1f5f9;
}

.partner-admin-card__actions .btn {
    flex: 1;
    text-align: center;
    justify-content: center;
    padding: 7px 10px;
    font-size: 0.82rem;
}

/* ROWS VIEW */
.partners-rows-view {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
}

.partner-admin-row {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.partner-admin-row:hover {
    border-color: #94a3b8;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.partner-admin-row__left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

.partner-admin-row__order {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex-shrink: 0;
}

.partner-admin-row__num {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-meta);
    width: 26px;
    text-align: center;
    flex-shrink: 0;
}

.partner-admin-row__info {
    flex: 1;
    min-width: 0;
}

.partner-admin-row__header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.partner-admin-row__info h3 {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--text-primary);
}

.partner-admin-row__desc {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 600px;
}

.partner-admin-row__link {
    font-size: 0.78rem;
    color: var(--text-meta);
    margin-top: 3px;
}

.partner-admin-row__link a {
    color: var(--accent);
    text-decoration: underline;
}

.partner-admin-row__right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.partner-admin-row__right .btn {
    padding: 6px 12px;
    font-size: 0.82rem;
}

