/* ============================================
   TTO Admin — CSS Custom Properties
   ============================================ */

:root {
    --tto-primary: #2563eb;
    --tto-primary-hover: #1d4ed8;
    --tto-sidebar-bg: #0f172a;
    --tto-sidebar-width: 240px;
    --tto-sidebar-active-bg: rgba(37, 99, 235, 0.15);
    --tto-content-padding: 24px;
    --tto-navbar-height: 56px;

    /* Bootstrap állapotszín felülírások */
    --bs-primary: var(--tto-primary);
    --bs-primary-rgb: 37, 99, 235;
    --bs-success: #16a34a;
    --bs-success-rgb: 22, 163, 74;
    --bs-warning: #d97706;
    --bs-warning-rgb: 217, 119, 6;
    --bs-danger: #dc2626;
    --bs-danger-rgb: 220, 38, 38;
    --bs-secondary: #64748b;
    --bs-secondary-rgb: 100, 116, 139;
}

/* ============================================
   Tipográfia
   ============================================ */

body {
    font-family: 'Inter Tight', sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
}

/* ============================================
   Navbar
   ============================================ */

.tto-navbar {
    background-color: var(--tto-sidebar-bg);
    height: var(--tto-navbar-height);
    z-index: 1030;
}

.tto-navbar-brand {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: #fff;
    font-size: 1.15rem;
}

.tto-navbar-brand:hover {
    color: #fff;
}

.tto-navbar-toggler {
    color: #fff;
    border: none;
    padding: 0.25rem 0.5rem;
}

.tto-navbar-toggler .navbar-toggler-icon {
    filter: invert(1);
}

.tto-navbar-user {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
}

.tto-navbar-settlement {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    font-family: 'Inter Tight', sans-serif;
}

/* Település-váltó dropdown */
.tto-settlement-switcher {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    font-family: 'Inter Tight', sans-serif;
    border: none;
    background: transparent;
    padding: 0.25rem 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tto-settlement-switcher:hover,
.tto-settlement-switcher:focus {
    color: #fff;
}

.tto-settlement-dropdown {
    min-width: 240px;
}

.tto-settlement-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
}

.tto-settlement-dropdown .dropdown-item.active {
    background-color: var(--tto-primary);
    color: #fff;
}

.tto-settlement-crest {
    border-radius: 2px;
    object-fit: contain;
    flex-shrink: 0;
}

.tto-settlement-add {
    color: var(--tto-primary);
    font-weight: 500;
}

/* ============================================
   Sidebar
   ============================================ */

.tto-sidebar {
    background-color: var(--tto-sidebar-bg) !important;
    width: var(--tto-sidebar-width);
    min-height: calc(100vh - var(--tto-navbar-height));
    flex-shrink: 0;
}

.tto-sidebar .offcanvas-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tto-sidebar .offcanvas-title {
    color: #fff;
}

.tto-sidebar-nav {
    padding: 1rem 0;
}

.tto-sidebar-group-title {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 1.25rem;
}

.tto-sidebar-link {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    border-left: 3px solid transparent;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.tto-sidebar-link:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.05);
}

.tto-sidebar-link.active {
    color: #fff;
    background-color: var(--tto-sidebar-active-bg);
    border-left-color: var(--tto-primary);
}

/* ============================================
   Tartalom terület
   ============================================ */

.tto-content {
    padding: var(--tto-content-padding);
    background-color: #fff;
    min-height: calc(100vh - var(--tto-navbar-height));
}

/* ============================================
   Reszponzív szabályok
   ============================================ */

@media (min-width: 992px) {
    .tto-sidebar {
        position: sticky;
        top: var(--tto-navbar-height);
        height: calc(100vh - var(--tto-navbar-height));
        overflow-y: auto;
    }
}

@media (max-width: 991.98px) {
    .tto-sidebar {
        width: var(--tto-sidebar-width);
    }

    .tto-content {
        width: 100%;
    }
}

/* ============================================
   Form validáció
   ============================================ */

.tto-required-star {
    color: var(--bs-danger);
    font-weight: 700;
}

/* ============================================
   Branding előnézet
   ============================================ */

.tto-branding-preview {
    max-height: 80px;
}

/* ============================================
   Dashboard kártyák
   ============================================ */

.tto-dashboard-card {
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s, transform 0.15s;
    border: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: 0.375rem;
    display: block;
}

.tto-dashboard-card:hover {
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    color: inherit;
}

.tto-dashboard-card--empty {
    background-color: #f8f9fa;
    opacity: 0.8;
}

.tto-dashboard-card-icon {
    font-size: 1.5rem;
    color: var(--tto-primary);
}

.tto-dashboard-card--empty .tto-dashboard-card-icon {
    color: var(--bs-secondary);
}

.tto-dashboard-card-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.tto-dashboard-card-count {
    font-size: 0.8rem;
}

/* ============================================
   Legutóbbi tevékenység lista
   ============================================ */

.tto-activity-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
}

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

.tto-activity-type {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--bs-secondary);
    min-width: 120px;
}

.tto-activity-name {
    flex: 1;
    font-size: 0.875rem;
}

.tto-activity-date {
    font-size: 0.8rem;
    white-space: nowrap;
}

/* ============================================
   Tartalomlista nézet
   ============================================ */

.tto-content-table .tto-row-actions {
    opacity: 0;
    transition: opacity 0.15s;
}

.tto-content-table tr:hover .tto-row-actions {
    opacity: 1;
}

/* Tableten mindig látható akciógombok */
@media (max-width: 991.98px) {
    .tto-content-table .tto-row-actions {
        opacity: 1;
    }
}

.tto-filter-tabs .nav-link {
    color: var(--bs-secondary);
    border: none;
    padding: 0.5rem 1rem;
}

.tto-filter-tabs .nav-link.active {
    color: var(--tto-primary);
    border-bottom: 2px solid var(--tto-primary);
    background: transparent;
}

.tto-filter-tabs .nav-link .badge {
    font-size: 0.7rem;
    margin-left: 0.25rem;
}

/* ============================================
   Szerkesztő oldal — meta panel
   ============================================ */

.tto-meta-panel .card {
    position: sticky;
    top: calc(var(--tto-navbar-height) + 24px);
}

/* ============================================
   Sortable — Átrendezés mód
   ============================================ */

.tto-reorder-active tbody tr[data-sort-id] {
    cursor: grab;
}

.tto-reorder-active tbody tr[data-sort-id]:active {
    cursor: grabbing;
}

tr.tto-dragging {
    opacity: 0.4;
    background-color: #e9ecef !important;
}

tr.tto-drop-above {
    border-top: 3px solid #0d6efd !important;
}

tr.tto-drop-below {
    border-bottom: 3px solid #0d6efd !important;
}

.tto-drag-handle {
    color: #6c757d;
    font-size: 1.2rem;
    user-select: none;
}

/* Tablet: drag handle rejtve, fel/le gombok láthatók */
@media (max-width: 991.98px) {
    .tto-reorder-active .tto-drag-handle {
        display: none !important;
    }
}

/* Laptop: fel/le gombok rejtve, drag handle látható */
@media (min-width: 992px) {
    .tto-reorder-active .tto-move-buttons {
        display: none !important;
    }
}

/* Sikeres mentés zöld flash */
@keyframes tto-flash-success {
    0% { background-color: inherit; }
    30% { background-color: rgba(22, 163, 74, 0.15); }
    100% { background-color: inherit; }
}

tr.tto-save-success {
    animation: tto-flash-success 0.6s ease-out;
}
