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

body * {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="%23333" d="M3 3l7.07 16.97 2.51-7.39 7.39-2.51L3 3z"/></svg>') 3 3, auto !important;
}

:root {
    --bg: #f9fafb;
    --sidebar-bg: #ffffff;
    --active-bg: #eff6ff;
    --active-border: #2563eb;
    --text-main: #111827;
    --text-muted: #6b7280;
    --text-sidebar: #4b5563;
    --border: #e5e7eb;
    --sidebar-width: 280px;
}

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

body,
html {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    font-family: "Inter", system-ui, sans-serif;
    background: var(--bg);
    color: var(--text-main);
    font-size: 13px;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

/* Removed restrictive app-container overrides to allow dashboard grid to function */

/* ==========================================================================
   OFFICE STYLE 1:1
   ========================================================================== */
.no-decor {
    text-decoration: none !important;
    color: inherit !important;
}

.no-decor:hover {
    color: inherit !important;
    transform: translateY(-2px);
    transition: transform 0.2s;
}

/* Sidebar Styling matching the image */
.manager-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10020;
    /* Above quick-nav */
    padding-top: 24px;
}

.sidebar-logo-container {
    padding: 0 24px 16px;
    margin-bottom: 24px;
}

.np-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.np-logo-placeholder {
    width: 28px;
    height: 28px;
    background: #3f7432;
    border-radius: 4px;
}

.np-logo-text {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #111827;
    display: flex;
    flex-direction: column;
}

.logo-subtext {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}

.sidebar-profile {
    padding: 0 24px 32px;
    text-align: center;
}

.avatar-circle {
    width: 56px;
    height: 56px;
    background: #f3f4f6;
    color: #4b5563;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    margin: 0 auto 12px;
}

.profile-name {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
}

.profile-role {
    font-size: 10px;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    margin-top: 2px;
}

.sidebar-section-label {
    padding: 24px 24px 8px;
    font-size: 9px;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    color: var(--text-sidebar);
    text-decoration: none;
    font-weight: 500;
    font-size: 12px;
    border-left: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-item i {
    width: 16px;
    text-align: center;
    font-size: 14px;
    opacity: 0.8;
}

.nav-item:hover {
    background: #f9fafb;
    color: #111827;
}

.nav-item.active {
    background: var(--active-bg);
    color: var(--active-border);
    border-left-color: var(--active-border);
    font-weight: 600;
}

.sidebar-footer {
    margin-top: auto;
    padding: 24px;
    border-top: 1px solid #f3f4f6;
    background: #fcfdfe;
}

.footer-user-info {
    margin-bottom: 16px;
}

.footer-user-name {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
}

.footer-date {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 2px;
}

.footer-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}

.footer-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 4px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
    text-transform: uppercase;
}

.footer-btn.secondary {
    background: #f3f4f6;
    color: #4b5563;
}

.footer-btn.secondary:hover {
    background: #e5e7eb;
}

.footer-btn.danger {
    background: #fef2f2;
    color: #ef4444;
}

.footer-btn.danger:hover {
    background: #fee2e2;
}

.footer-back {
    text-align: center;
}

.back-link-small {
    font-size: 10px;
    color: #9ca3af;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: color 0.2s;
}

.back-link-small:hover {
    color: #111827;
}

/* MAIN CONTENT SCROLLABLE */
.main-wrapper {
    flex: 1;
    overflow-y: auto;
    height: 100vh;
    padding: 32px 48px;
}

.breadcrumb {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: #2563eb;
    margin-bottom: 24px;
    font-weight: 500;
}

.breadcrumb span {
    color: #9ca3af;
}

.page-header {
    margin-bottom: 40px;
    display: block !important;
}

/* Local page header is fine */
.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
}

.page-header p {
    font-size: 13px;
    color: var(--text-muted);
}

/* DASHBOARD CARDS */
.office-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 32px;
}

.office-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    margin-bottom: 32px;
}

.office-card-header {
    padding: 20px 32px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.office-card-header h2 {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
}

.office-card-body {
    padding: 32px;
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.modern-table thead tr {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.modern-table th {
    padding: 14px 20px;
    text-align: left;
    font-size: 11px;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
}

.modern-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
}

.modern-table tbody tr:hover {
    background: #f8fafc;
}

.modern-table td {
    padding: 10px 20px;
    color: #64748b;
    vertical-align: middle;
}

/* Buttons unified in forms.css */

/* MODALS */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
}

.modal-content-office {
    background: #ffffff;
    width: 100%;
    max-width: 500px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.dash-tab-content {
    display: none;
}

.dash-tab-content.active {
    display: block;
}

.qn-status-offline {
    background: #6b7280;
}

/* Adjustments for fixed top bar & layout stability */
.manager-dashboard {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    height: 100vh !important;
    display: flex !important;
    overflow-y: hidden !important;
    overflow-x: hidden !important;
    background: #f8fafc;
    z-index: 1000;
}

/* Ensure quick-nav is ABOVE the dashboard but maybe shifted? */
/* Actually, let's keep quick-nav at top: 0 but make sure it's above everything */
.quick-nav-bar {
    z-index: 10010 !important;
    left: 280px !important;
    /* Start after sidebar */
    right: 0 !important;
    /* Stretch to the end */
    width: auto !important;
    /* Let left/right define width */
}

.dashboard-wrapper,
.main-content {
    margin: 0 !important;
    padding: 0 !important;
}

.app-container .main-content {
    margin-top: 30px !important;
    height: calc(100vh - 30px) !important;
    overflow-y: auto !important;
}

.manager-content-area {
    flex: 1;
    height: 100vh;
    overflow-y: auto !important;
    padding: 40px;
    margin-left: 280px;
    /* Offset for fixed sidebar */
    padding-top: 84px;
    /* Offset for quick-nav bar (34px) + inner padding (50px) */
    background: #f8fafc;
}

/* Sidebar blur synchronization when modals/overlays are open or body is blurred */
body.blur .manager-sidebar,
body.blur .panel-sidebar,
body.blur-active .manager-sidebar,
body.blur-active .panel-sidebar,
body.modal-open .manager-sidebar,
body.modal-open .panel-sidebar,
body[style*="filter"] .manager-sidebar,
body[style*="filter"] .panel-sidebar,
body[style*="blur"] .manager-sidebar,
body[style*="blur"] .panel-sidebar,
body:has(.modal-overlay.active) .manager-sidebar,
body:has(.modal-overlay.active) .panel-sidebar,
body:has(.modal-overlay.is-open) .manager-sidebar,
body:has(.modal-overlay.is-open) .panel-sidebar,
body:has(.dialog-backdrop.active) .manager-sidebar,
body:has(.dialog-backdrop.active) .panel-sidebar,
body:has(.dialog-backdrop.is-open) .manager-sidebar,
body:has(.dialog-backdrop.is-open) .panel-sidebar,
body:has(.overlay.active) .manager-sidebar,
body:has(.overlay.active) .panel-sidebar,
body:has(.overlay.is-open) .manager-sidebar,
body:has(.overlay.is-open) .panel-sidebar,
body:has(.modal-overlay[style*="display: flex"]) .manager-sidebar,
body:has(.modal-overlay[style*="display: flex"]) .panel-sidebar,
body:has(.modal-overlay[style*="display: block"]) .manager-sidebar,
body:has(.modal-overlay[style*="display: block"]) .panel-sidebar,
body:has(.modal-overlay[style*="display:flex"]) .manager-sidebar,
body:has(.modal-overlay[style*="display:flex"]) .panel-sidebar,
body:has(.modal-overlay[style*="display:block"]) .manager-sidebar,
body:has(.modal-overlay[style*="display:block"]) .panel-sidebar,
body:has(.dialog-backdrop[style*="display: flex"]) .manager-sidebar,
body:has(.dialog-backdrop[style*="display: flex"]) .panel-sidebar,
body:has(.dialog-backdrop[style*="display: block"]) .manager-sidebar,
body:has(.dialog-backdrop[style*="display: block"]) .panel-sidebar,
body:has(.dialog-backdrop[style*="display:flex"]) .manager-sidebar,
body:has(.dialog-backdrop[style*="display:flex"]) .panel-sidebar,
body:has(.dialog-backdrop[style*="display:block"]) .manager-sidebar,
body:has(.dialog-backdrop[style*="display:block"]) .panel-sidebar,
body:has(.overlay[style*="display: flex"]) .manager-sidebar,
body:has(.overlay[style*="display: flex"]) .panel-sidebar,
body:has(.overlay[style*="display: block"]) .manager-sidebar,
body:has(.overlay[style*="display: block"]) .panel-sidebar,
body:has(.overlay[style*="display:flex"]) .manager-sidebar,
body:has(.overlay[style*="display:flex"]) .panel-sidebar,
body:has(.overlay[style*="display:block"]) .manager-sidebar,
body:has(.overlay[style*="display:block"]) .panel-sidebar {
    filter: blur(5px) !important;
    pointer-events: none !important;
    transition: filter 0.2s ease;
}