@import url('/dashboard/assets/css/components/buttons.css');
@import url('/dashboard/assets/css/components/alerts.css');
@import url('/dashboard/assets/css/components/brands.css');
@import url('/dashboard/assets/css/components/template-editor.css');
@import url('/dashboard/assets/css/components/tabs.css');
@import url('/dashboard/assets/css/layout/modals.css');
@import url('/dashboard/assets/css/layout/navigation.css');
@import url('/dashboard/assets/css/pages/events-core.css');
@import url('/dashboard/assets/css/pages/dashboard-index-widgets.css');
@import url('/dashboard/assets/css/pages/event-detail.css');
@import url('/dashboard/assets/css/pages/login.css');
@import url('/dashboard/assets/css/pages/migration.css');
@import url('/dashboard/assets/css/pages/photobooths.css');
@import url('/dashboard/assets/css/pages/users-security.css');
@import url('/dashboard/assets/css/pages/user-settings.css');
@import url('/dashboard/assets/css/utilities/shared.css');

/* ===== Base / Global ===== */
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #0f0f0f;
    color: #e0e0e0;
}

.confirm-container {
    max-width: 560px;
    margin: 80px auto;
    padding: 24px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    text-align: center;
}

.confirm-status {
    font-size: 18px;
    margin-bottom: 16px;
}

.confirm-status.success {
    color: var(--color-success);
}

.confirm-status.error {
    color: var(--color-danger);
}

.confirm-actions {
    margin-top: 24px;
}

.confirm-actions a {
    text-decoration: none;
}

/* ===== Management Page ===== */
.management-page * {
    box-sizing: border-box;
}

.management-page {
    background: #0f0f0f;
    color: #e0e0e0;
    min-height: 100vh;
}

.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 32px;
    margin-bottom: 8px;
}

.page-header p {
    color: #888;
    font-size: 14px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 24px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    transition: all 0.2s;
}

.card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-color-light);
}

.card h3 {
    font-size: 18px;
    margin-bottom: 12px;
}

.card p {
    color: #888;
    font-size: 14px;
    margin-bottom: 16px;
}

.card-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
}

thead {
    background: #252525;
}

th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: #fff;
    font-size: 14px;
}

td {
    padding: 16px;
    border-top: 1px solid #2a2a2a;
}

tr:hover {
    background: #252525;
}

.tenant-assignments {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tenant-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #252525;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    text-transform: uppercase;
    border: 1px solid #333;
}

.role-badge {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.remove-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 0 4px;
    font-size: 14px;
}

.remove-btn:hover {
    color: #f44336;
}

.management-page .file-audit-summary {
    margin-bottom: 20px;
    line-height: 1.6;
}

.management-page .file-audit-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.management-page .file-audit-check-col {
    width: 42px;
    text-align: center;
}

.management-page .file-audit-actions .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.management-page .file-audit-section {
    overflow-x: auto;
}

.management-page .file-audit-table {
    table-layout: fixed;
    min-width: 860px;
}

.management-page .file-audit-table th,
.management-page .file-audit-table td {
    vertical-align: top;
}

.management-page .file-audit-path {
    display: block;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    font-size: 12px;
    line-height: 1.4;
    color: #d7d7d7;
}

/* ===== Session Page ===== */
.header {
    margin-bottom: 30px;
}

.header h1 {
    color: #fff;
    font-size: 28px;
    margin-bottom: 8px;
}

.header p {
    color: #888;
    font-size: 16px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.stat-card {
    background: #1a1a1a;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #333;
}

.stat-card label {
    display: block;
    color: #888;
    font-size: 13px;
    margin-bottom: 8px;
}

.stat-card value {
    color: #fff;
    font-size: 24px;
    font-weight: 600;
}

.section {
    background: #1a1a1a;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid #333;
    margin-bottom: 24px;
}

.section h2 {
    color: #fff;
    font-size: 18px;
    margin-bottom: 20px;
}

.settings-section {
    background: #1a1a1a;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid #2a2a2a;
    margin-bottom: 24px;
}

.settings-section h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: none;
    margin-bottom: 16px;
    font-size: 18px;
    color: #fff;
}

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

.stats-grid .section {
    margin-bottom: 0;
}

.stats-grid .section h3 {
    color: #888;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-grid .section .value {
    color: var(--color-primary);
    font-size: 32px;
    font-weight: 700;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.section:has(table) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #4a4a4a #1b1b1b;
}

.section:has(table)::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

.section:has(table)::-webkit-scrollbar-track {
    background: #1b1b1b;
    border-radius: 8px;
}

.section:has(table)::-webkit-scrollbar-thumb {
    background: #4a4a4a;
    border-radius: 8px;
}

.section:has(table)::-webkit-scrollbar-thumb:hover {
    background: #5a5a5a;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.gallery-item {
    position: relative;
    background: #252525;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #333;
    transition: transform 0.3s, border-color 0.3s;
}

.gallery-item:hover {
    transform: translateY(-4px);
    border-color: var(--color-primary);
}

.gallery-item img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
}

.gallery-item-info {
    padding: 12px;
}

.gallery-item-info .filename {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-item-info .meta {
    color: #888;
    font-size: 12px;
}

.file-list {
    list-style: none;
}

.file-item {
    padding: 12px;
    background: #252525;
    border-radius: 6px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-item .name {
    color: #fff;
    font-weight: 600;
}

.file-item .type {
    color: #888;
    font-size: 12px;
    background: #333;
    padding: 4px 8px;
    border-radius: 4px;
}

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    background: none;
    border: none;
}

.sub-card {
    position: relative;
    display: flex;
    flex-direction: column;
}

.sub-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.sub-card-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.sub-card-footer {
    margin-top: auto;
    padding-top: 12px;
    font-size: 12px;
    color: #888;
    font-style: italic;
}

.sub-value {
    font-size: 24px;
    font-weight: 700;
    margin: 8px 0 12px;
}

.sub-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #cfcfcf;
    margin-top: 8px;
}

.sub-row .sub-strong {
    font-weight: 600;
    color: #e6e6e6;
}

.sub-actions {
    margin-top: 12px;
}

.storage-progress-bar {
    background: #252525;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}

.plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.plan-card {
    position: relative;
    display: block;
    cursor: pointer;
}

.plan-card input {
    position: absolute;
    opacity: 0;
}

.plan-card-body {
    border: 1px solid #2b2b2b;
    border-radius: 10px;
    padding: 16px;
    background: #151515;
    transition: border 0.2s, box-shadow 0.2s;
    height: 100%;
}

.plan-card input:checked + .plan-card-body {
    border-color: #4f8cff;
    box-shadow: 0 0 0 2px rgba(79, 140, 255, 0.25);
}

.plan-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}

.plan-price {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
}

.plan-interval {
    font-size: 12px;
    opacity: 0.7;
    margin-left: 6px;
}

.plan-desc {
    font-size: 13px;
    opacity: 0.8;
    margin-bottom: 10px;
}

.plan-features {
    margin: 0;
    padding-left: 18px;
    font-size: 13px;
    opacity: 0.85;
}

/* ===== Events/Login Additions ===== */
.events-list-actions {
    margin-top: 16px;
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: flex-end;
}
.event-lock-icon {
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
    color: #f59e0b;
}

@media (hover: none) and (pointer: coarse) {
    * {
        -webkit-tap-highlight-color: rgba(152, 27, 30, 0.2);
    }

    .btn, button, a {
        min-height: 44px;
        min-width: 44px;
    }

    .btn-sm {
        min-height: 36px;
        min-width: 36px;
    }

    * {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }

    .nav-link:hover,
    .btn:hover,
    .dropdown-item:hover {
        transform: none;
    }

    .btn:active {
        transform: scale(0.98);
    }

    .nav-link:active {
        background: #252525 !important;
    }
}

@media (max-width: 1024px) {
    .container {
        max-width: 100%;
        padding: 20px 16px;
    }

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

@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    .container {
        padding: 16px 12px;
    }

    .page-header h1 {
        font-size: 24px;
    }

    .page-header p {
        font-size: 14px;
    }

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

    .section,
    .settings-section {
        padding: 16px;
        margin-bottom: 16px;
        border-radius: 8px;
    }

    .section h2,
    .settings-section h2 {
        font-size: 18px;
        margin-bottom: 16px;
    }

    .form-group {
        margin-bottom: 16px;
    }

    .form-group label {
        font-size: 13px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px 12px;
        font-size: 14px;
    }

    .form-row {
        gap: 16px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 13px;
        width: 100%;
    }

    .btn-sm {
        padding: 6px 12px;
        font-size: 11px;
        width: auto;
    }

    .button-group {
        flex-direction: column;
        gap: 8px;
    }

    .button-group .btn {
        width: 100%;
    }

    .actions {
        flex-direction: column;
        gap: 8px;
    }

    .actions .btn {
        width: 100%;
    }

    .badge,
    .status-badge {
        font-size: 11px;
        padding: 4px 8px;
    }

    .info-box {
        font-size: 13px;
        padding: 12px;
    }

    .alert {
        padding: 10px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 12px 8px;
    }

    .page-header h1 {
        font-size: 20px;
    }

    .stats-grid .section .value {
        font-size: 24px;
    }

    .section,
    .settings-section {
        padding: 12px;
    }

    th,
    td {
        padding: 8px 6px;
        font-size: 12px;
    }

    .btn {
        padding: 8px 16px;
        font-size: 12px;
    }
}

@media (max-width: 768px) and (orientation: landscape) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .button-group {
        flex-direction: row;
    }

    .actions {
        flex-direction: row;
        flex-wrap: wrap;
    }
}
