@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

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

.bg-indigo-600 {
    background-color: var(--app-primary, #4f46e5) !important;
}

.hover\:bg-indigo-700:hover {
    background-color: var(--app-secondary, #3730a3) !important;
}

.text-indigo-400,
.text-indigo-500,
.text-indigo-600 {
    color: var(--app-primary, #4f46e5) !important;
}

.border-indigo-500,
.focus\:border-indigo-500:focus {
    border-color: var(--app-primary, #4f46e5) !important;
}

.focus\:ring-indigo-500:focus {
    --tw-ring-color: var(--app-primary, #4f46e5) !important;
}

html:not(.dark) .app-sidebar {
    background-color: var(--app-sidebar-bg, #ffffff) !important;
}

html.dark .app-sidebar {
    background-color: var(--app-sidebar-bg, #0b1220) !important;
}

html:not(.dark) .app-sidebar nav a:not(.bg-indigo-600) {
    color: #334155 !important;
}

html.dark .app-sidebar nav a:not(.bg-indigo-600) {
    color: rgba(241, 245, 249, 0.88) !important;
}

html:not(.dark) .app-sidebar nav a:not(.bg-indigo-600):hover {
    background-color: #eff6ff !important;
    color: #0f172a !important;
}

html.dark .app-sidebar nav a:not(.bg-indigo-600):hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

html:not(.dark) .app-sidebar nav a.bg-indigo-600,
html.dark .app-sidebar nav a.bg-indigo-600 {
    background-color: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

html:not(.dark) .app-sidebar nav .js-nav-group-toggle,
html:not(.dark) .app-sidebar nav > div.pt-4.pb-1 {
    color: #64748b !important;
}

html.dark .app-sidebar nav .js-nav-group-toggle,
html.dark .app-sidebar nav > div.pt-4.pb-1 {
    color: rgba(226, 232, 240, 0.72) !important;
}

html:not(.dark) .app-sidebar .sidebar-border {
    border-color: #e2e8f0 !important;
}

html.dark .app-sidebar .sidebar-border {
    border-color: rgba(148, 163, 184, 0.22) !important;
}

html:not(.dark) .app-topbar-custom {
    background-color: var(--app-topbar-bg, #ffffff) !important;
}

html.dark .app-topbar-custom {
    background-color: var(--app-topbar-bg, rgba(15, 23, 42, 0.92)) !important;
    border-color: rgba(51, 65, 85, 0.7) !important;
}

.app-topbar-custom {
    min-height: 4rem;
    align-items: center;
    overflow: visible;
    position: sticky;
    top: 0;
    z-index: 20;
    flex-wrap: nowrap !important;
}

.app-topbar-custom > * {
    align-self: center;
}

.app-topbar-custom .order-1,
.app-topbar-custom .order-2 {
    min-width: 0;
}

.app-topbar-custom input[type="search"],
.app-topbar-custom #globalSearchInput {
    width: 100%;
    max-width: 100%;
}

.app-topbar-custom .relative.group,
.app-topbar-custom #notificationDropdown {
    position: relative;
    z-index: 30;
}

#appShell {
    overflow-x: clip;
}

.sidebar-brand-logo {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: 36px;
    min-height: 24px;
    max-height: 36px;
    min-width: 24px;
    max-width: 64px;
    width: auto;
    object-fit: contain;
    object-position: center;
    flex-shrink: 0;
}

.sidebar-brand-text {
    display: block !important;
    overflow: hidden !important;
    text-overflow: ellipsis;
    white-space: normal;
    line-height: 1.15;
    font-size: 0.8rem;
    max-width: 100%;
    max-height: 2.3em;
    word-break: break-word;
    overflow-wrap: anywhere;
    color: inherit;
}

@supports (-webkit-line-clamp: 2) {
    .sidebar-brand-text {
        display: -webkit-box !important;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
}

/* Shared responsive helpers */
.mobile-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-action-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
}

@media (max-width: 767px) {
    .app-topbar-custom {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        min-height: 4rem;
        height: auto;
        padding-top: 0.25rem;
        padding-bottom: 0.25rem;
        flex-wrap: nowrap;
    }

    .app-topbar-custom .order-1 {
        min-width: 0;
        flex: 1 1 auto;
        width: calc(100% - 7.5rem);
    }

    .app-topbar-custom .order-2 {
        flex: 0 0 auto;
        margin-left: auto;
        align-items: center;
        gap: 0.25rem;
        display: inline-flex;
    }

    #globalSearchInput {
        min-height: 2.25rem;
        font-size: 0.875rem;
    }

    .app-topbar-custom .max-w-xl {
        max-width: 100%;
    }

    .js-smart-table {
        min-width: 760px;
    }

    .mobile-modal-panel {
        max-height: 92vh;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .mobile-modal-body {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-modal-footer {
        position: sticky;
        bottom: 0;
        z-index: 5;
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 0.75rem);
        background: inherit;
    }

    .mobile-action-wrap { width: 100%; }

    .sidebar-brand-logo {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        height: 32px;
        min-height: 22px;
        max-height: 32px;
        min-width: 22px;
        max-width: 48px;
        width: auto;
        object-fit: contain;
    }

    .sidebar-brand-text {
        font-size: 0.75rem;
        max-width: 88px;
    }

    /* Prevent modal footer buttons from being cut off on mobile */
    .modal-footer-sticky,
    .mobile-modal-footer {
        position: sticky;
        bottom: 0;
        background: inherit;
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 0.75rem);
    }
}

@media (min-width: 768px) {
    .mobile-action-wrap {
        flex-wrap: nowrap;
        justify-content: flex-end;
    }
}

.book-cover-fallback,
.book-cover-thumb {
    width: 3rem;
    height: 4rem;
    border-radius: 0.5rem;
    object-fit: cover;
    flex: 0 0 auto;
}

/* Print Styles */
.print-table {
    width: 100%;
    border-collapse: collapse;
}
.print-table, .print-table th, .print-table td {
    border: 1px solid #000;
}
.print-table th, .print-table td {
    padding: 6px 10px;
    text-align: left;
}
.text-center {
    text-align: center;
}

[x-cloak] { display: none !important; }
.is-hidden { display: none !important; }
.hidden { display: none !important; }
.block { display: block; }
.drop-zone-inline { border: 2px dashed #ccc; cursor: pointer; background-color: #f8f9fa; }
.cursor-pointer-inline { cursor: pointer; }
.image-preview-contain { max-height: 200px; object-fit: contain; }

/* hard safety limits for branding assets */
.drop-zone-active {
    border-color: #198754 !important;
    background-color: #e8f5e9 !important;
}

.verification-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100%;
    padding: 20px;
}

.verification-box {
    background: rgba(255, 255, 255, 0.6);
    padding: 40px;
    width: 100%;
    max-width: 500px;
    border-radius: 15px;
    text-align: center;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}

.verification-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.verification-title {
    font-size: 24px;
    font-weight: bold;
    color: #000;
    margin-bottom: 15px;
}

.verification-text {
    color: #555;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.verification-email {
    color: #000;
    font-weight: bold;
    font-size: 16px;
    margin: 15px 0;
    padding: 10px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
}

.verification-note {
    color: #666;
    font-size: 13px;
    line-height: 1.6;
    margin-top: 20px;
    padding: 15px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
}

.verification-alert {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    text-align: left;
}

.verification-alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid #10b981;
}

.verification-alert-error {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
    border: 1px solid #dc2626;
}

.verification-resend-form {
    margin-top: 25px;
}

.verification-secondary-button {
    background: #6b7280;
    margin-bottom: 15px;
}

.verification-login-link-wrap {
    margin-top: 20px;
    font-size: 14px;
}

.verification-login-link {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
}

.print-cell-center { text-align: center; }

.legacy-empty-card { text-align: center; padding: 50px; }
.legacy-navbar-brand { display: flex; align-items: center; text-decoration: none; }
.legacy-navbar-logo { height: 50px; margin-right: 10px; }
.legacy-navbar-title { font-size: 1.25rem; font-weight: bold; color: white; }
.legacy-navbar-actions { display: flex; align-items: center; }
.legacy-warning-button { color: #ffc107; font-weight: bold; }
