:root {
    --primary: #2559d6;
    --primary-hover: #1f48ad;
    --accent: #0f9f8f;
    --bg: #f5f7fb;
    --surface: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #dfe5ef;
    --border-strong: #c8d2e1;
    --danger: #dc2626;
    --sidebar-width: 306px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 16px 36px rgba(15, 23, 42, 0.10);
}

* {
    box-sizing: border-box;
    font-family: Inter, Arial, sans-serif;
}

body {
    margin: 0;
    color: var(--text-main);
    background: var(--bg);
}

.login-page {
    min-height: 100vh;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-panel {
    width: min(100%, 410px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 36px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.brand-block {
    margin-bottom: 28px;
    text-align: center;
}

.brand-block h1 {
    margin: 0;
    color: var(--primary);
    font-size: 25px;
}

.brand-block p,
.login-hint {
    color: var(--text-muted);
    font-size: 14px;
}

.login-panel label {
    display: block;
    margin: 16px 0 7px;
    font-weight: 600;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 15px;
    background: #fff;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.btn {
    border: 0;
    border-radius: 6px;
    padding: 9px 15px;
    cursor: pointer;
    font-weight: 600;
}

.btn-primary {
    width: 100%;
    margin-top: 22px;
    color: white;
    background: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-danger {
    color: white;
    background: var(--danger);
}

.alert {
    display: none;
    padding: 11px;
    border-radius: 6px;
    font-size: 14px;
}

.alert-error,
.error {
    color: #b91c1c;
}

.alert-error {
    border: 1px solid #fecaca;
    background: #fef2f2;
}

.dashboard-page {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: var(--bg);
}

.sidebar {
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-right: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    z-index: 2;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 18px 16px;
    border-bottom: 1px solid var(--border);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    font-weight: 800;
    font-size: 14px;
    box-shadow: 0 8px 18px rgba(37, 89, 214, 0.22);
}

.sidebar-header h2 {
    margin: 0;
    color: var(--text-main);
    font-size: 20px;
    line-height: 1.2;
}

.sidebar-header span {
    display: block;
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
}

.sidebar-search {
    padding: 14px 16px 8px;
}

.sidebar-search input {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
    background: #f8fafc;
    outline: none;
}

.sidebar-search input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 89, 214, 0.11);
}

.nav-list {
    flex: 1;
    list-style: none;
    overflow-y: auto;
    margin: 0;
    padding: 8px 10px 14px;
}

.nav-item {
    padding: 2px 0;
}

.nav-link,
.sub-menu-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    min-height: 38px;
    transition: color 0.15s ease, background 0.15s ease;
}

.nav-link {
    padding: 9px 10px;
    color: #334155;
    font-weight: 700;
    font-size: 14px;
}

.sub-menu {
    display: none;
    list-style: none;
    margin: 3px 0 7px 18px;
    padding: 0 0 0 12px;
    border-left: 1px solid #e7edf5;
}

.nav-item.open .sub-menu {
    display: block;
}

.sub-menu-link {
    padding: 7px 10px;
    font-size: 13px;
    font-weight: 600;
}

.nav-link:hover,
.sub-menu-link:hover,
.nav-link.active,
.sub-menu-link.active {
    color: var(--primary);
    background: #eef4ff;
}

.nav-icon {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    flex: 0 0 auto;
    border-radius: 7px;
    color: var(--primary);
    background: #eef4ff;
    font-size: 10px;
    font-weight: 800;
}

.sub-menu-link .nav-icon {
    width: 22px;
    height: 22px;
    font-size: 9px;
    color: var(--accent);
    background: #e8faf7;
}

.nav-text {
    min-width: 0;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-caret {
    width: 7px;
    height: 7px;
    border-right: 2px solid #94a3b8;
    border-bottom: 2px solid #94a3b8;
    transform: rotate(-45deg);
    transition: transform 0.15s ease;
}

.nav-item.open > a > .nav-caret {
    transform: rotate(45deg);
}

.menu-hidden {
    display: none;
}

.sidebar-footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin: 0 16px 16px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    background: #fbfcfe;
    font-size: 12px;
}

.sidebar-footer strong {
    color: var(--accent);
}

.main-wrapper {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 66px;
    padding: 12px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.page-context {
    display: grid;
    gap: 2px;
}

.page-context span {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.page-context strong {
    color: var(--text-main);
    font-size: 18px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #334155;
    font-weight: 700;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #16a34a;
    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.12);
}

.content {
    flex: 1;
    overflow-y: auto;
    padding: 22px;
}

.module-container {
    min-height: 100%;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.empty-state,
.loading {
    color: var(--text-muted);
    padding: 20px;
    text-align: center;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 18px;
}

.enterprise-page {
    padding: 28px;
}

.enterprise-header {
    margin-bottom: 18px;
}

.enterprise-header h1 {
    margin: 0 0 6px;
}

.enterprise-header p {
    margin: 0;
    color: var(--text-muted);
}

.enterprise-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
}

.enterprise-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
}

.table-responsive {
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.table th {
    color: var(--text-muted);
    background: #f8fafc;
    font-size: 13px;
    text-transform: uppercase;
}

@media (max-width: 980px) {
    :root {
        --sidebar-width: 276px;
    }

    .dashboard-page {
        display: block;
        height: auto;
        min-height: 100vh;
        overflow: auto;
    }

    .sidebar {
        width: 100%;
        max-height: 46vh;
    }

    .main-wrapper {
        min-height: 54vh;
    }

    .navbar {
        align-items: flex-start;
        gap: 12px;
        flex-direction: column;
    }

    .content {
        padding: 14px;
    }
}

/* Source UI parity: match D:\Himanshu Sethi\CMS_PMS\PMSC\public login.html/dashboard.html */
:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg: #f8fafc;
    --surface: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --error: #ef4444;
    --success: #10b981;
    --sidebar-width: 260px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text-main);
}

.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-container {
    background: var(--surface);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--border);
}

.logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.logo p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 5px;
}

.login-page .form-group {
    margin-bottom: 20px;
}

.login-page .form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-main);
}

.login-page .form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s ease;
    background-color: var(--bg);
    color: var(--text-main);
}

.login-page .form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background-color: var(--surface);
}

.login-page .btn {
    width: 100%;
    padding: 12px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.login-page .btn:hover {
    background-color: var(--primary-hover);
}

.login-page .btn:disabled {
    background-color: var(--text-muted);
    cursor: not-allowed;
}

.alert {
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
    display: none;
}

.alert-error {
    background-color: #fef2f2;
    color: var(--error);
    border: 1px solid #fecaca;
}

.alert-success {
    background-color: #ecfdf5;
    color: var(--success);
    border: 1px solid #a7f3d0;
}

.footer-text {
    text-align: center;
    margin-top: 25px;
    font-size: 13px;
    color: var(--text-muted);
}

.dashboard-page {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background-color: var(--bg);
}

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    box-shadow: none;
    z-index: auto;
}

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

.sidebar-header h2 {
    font-size: 1.25rem;
    color: var(--primary);
    font-weight: 700;
    letter-spacing: -0.5px;
}

.nav-list {
    list-style: none;
    overflow-y: auto;
    flex-grow: 1;
    padding: 10px 0;
    margin: 0;
}

.nav-item {
    padding: 10px 20px;
}

.nav-link {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s;
    min-height: 0;
    gap: 0;
}

.nav-link:hover {
    background-color: #f1f5f9;
    color: var(--primary);
}

.sub-menu {
    list-style: none;
    padding-left: 30px;
    margin-top: 5px;
    display: none;
    border-left: 0;
}

.nav-item.open > .sub-menu {
    display: block;
}

.sub-menu .nav-item {
    padding: 0;
}

.sub-menu-link {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s;
    min-height: 0;
}

.sub-menu-link:hover {
    color: var(--primary);
    background-color: #f1f5f9;
}

.nav-icon,
.nav-caret,
.sidebar-search,
.sidebar-footer,
.page-context,
.status-dot {
    display: none;
}

.main-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.navbar {
    background-color: var(--surface);
    padding: 15px 30px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    border-bottom: 1px solid var(--border);
    min-height: auto;
    box-shadow: none;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 500;
}

.btn-logout {
    padding: 8px 15px;
    background-color: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
}

.btn-logout:hover {
    background-color: #dc2626;
}

.content {
    padding: 30px;
    overflow-y: auto;
    flex-grow: 1;
}

.card {
    background: var(--surface);
    padding: 30px;
    border-radius: 10px;
    border: 1px solid var(--border);
    margin-bottom: 20px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

.card h3 {
    color: var(--text-main);
    margin-bottom: 10px;
}

.card p {
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 0.95rem;
}

.loading {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
    font-size: 0.9rem;
}

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

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: 0.2s;
}

.btn-primary {
    width: auto;
    margin-top: 0;
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background-color: var(--primary);
    color: white;
}

.table-responsive {
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.table th,
.table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
}

.table th {
    background-color: #f8fafc;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
}

.table td {
    font-size: 0.95rem;
}

.badge {
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-info {
    background-color: #dbeafe;
    color: #1e40af;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(15, 23, 42, 0.5);
}

.modal-content {
    background-color: var(--surface);
    margin: 5% auto;
    padding: 25px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}

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

.close {
    font-size: 24px;
    font-weight: bold;
    color: var(--text-muted);
    cursor: pointer;
}

.close:hover {
    color: var(--text-main);
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* Professional MVC shell overrides for the expanded migrated menu catalog. */
:root {
    --accent: #0f9f8f;
    --sidebar-width: 306px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.dashboard-page {
    background: #f5f7fb;
}

.sidebar {
    width: var(--sidebar-width);
    box-shadow: var(--shadow-sm);
    z-index: 2;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    font-weight: 800;
    font-size: 13px;
    box-shadow: 0 8px 18px rgba(37, 89, 214, 0.22);
}

.sidebar-header h2 {
    margin: 0;
    color: var(--text-main);
    font-size: 19px;
    line-height: 1.2;
    letter-spacing: 0;
}

.sidebar-header span {
    display: block;
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
}

.sidebar-search {
    display: block;
    padding: 14px 16px 8px;
}

.sidebar-search input {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
    background: #f8fafc;
    outline: none;
}

.sidebar-search input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 89, 214, 0.11);
}

.nav-list {
    padding: 8px 10px 14px;
}

.nav-item {
    padding: 2px 0;
}

.nav-link,
.sub-menu-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    transition: color 0.15s ease, background 0.15s ease;
}

.nav-link {
    min-height: 38px;
    padding: 9px 10px;
    color: #334155;
    font-size: 14px;
    font-weight: 700;
}

.sub-menu {
    margin: 3px 0 7px 18px;
    padding: 0 0 0 12px;
    border-left: 1px solid #e7edf5;
}

.sub-menu-link {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 13px;
    font-weight: 600;
}

.nav-link:hover,
.sub-menu-link:hover,
.nav-link.active,
.sub-menu-link.active {
    color: var(--primary);
    background: #eef4ff;
}

.nav-icon {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    flex: 0 0 auto;
    border-radius: 7px;
    color: var(--primary);
    background: #eef4ff;
    font-size: 10px;
    font-weight: 800;
}

.sub-menu-link .nav-icon {
    width: 22px;
    height: 22px;
    color: var(--accent);
    background: #e8faf7;
    font-size: 9px;
}

.nav-text {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-caret {
    display: block;
    width: 7px;
    height: 7px;
    border-right: 2px solid #94a3b8;
    border-bottom: 2px solid #94a3b8;
    transform: rotate(-45deg);
    transition: transform 0.15s ease;
}

.nav-item.open > a > .nav-caret {
    transform: rotate(45deg);
}

.menu-hidden {
    display: none;
}

.sidebar-footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin: 0 16px 16px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    background: #fbfcfe;
    font-size: 12px;
}

.sidebar-footer strong {
    color: var(--accent);
}

.navbar {
    justify-content: space-between;
    min-height: 66px;
    padding: 12px 24px;
    box-shadow: var(--shadow-sm);
}

.page-context {
    display: grid;
    gap: 2px;
}

.page-context span {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.page-context strong {
    color: var(--text-main);
    font-size: 18px;
}

.status-dot {
    display: block;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #16a34a;
    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.12);
}

.btn-logout {
    border-radius: 7px;
    font-weight: 700;
}

.content {
    padding: 22px;
}

.module-container {
    min-height: 100%;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

@media (max-width: 980px) {
    :root {
        --sidebar-width: 100%;
    }

    .dashboard-page {
        display: block;
        height: auto;
        min-height: 100vh;
        overflow: auto;
    }

    .sidebar {
        width: 100%;
        max-height: 48vh;
    }

    .navbar {
        align-items: flex-start;
        gap: 12px;
        flex-direction: column;
    }

    .content {
        padding: 14px;
    }
}
