:root {
    --pmg-black: #0a0a0a;
    --pmg-dark: #111111;
    --pmg-panel: #151515;
    --pmg-panel-2: #1d1d1d;
    --pmg-orange: #ff7a00;
    --pmg-orange-hover: #ff922e;
    --pmg-white: #ffffff;
    --pmg-muted: #a7a7a7;
    --pmg-border: rgba(255, 255, 255, .09);
    --pmg-danger: #ff4d4f;
    --pmg-success: #26d07c;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

.pmg-body {
    background: radial-gradient(circle at 15% 0%, rgba(255, 122, 0, .16), transparent 30%), var(--pmg-black);
    color: var(--pmg-white);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

a {
    color: var(--pmg-orange);
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.pmg-login-body {
    display: grid;
    place-items: center;
    padding: 28px;
}

.pmg-login-wrap {
    width: min(1020px, 100%);
    min-height: min(680px, calc(100vh - 56px));
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 24px;
    align-items: stretch;
    animation: pmgFadeUp .5s ease both;
}

.pmg-login-brand,
.pmg-login-card,
.pmg-panel,
.pmg-stat,
.pmg-list-item {
    background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .02));
    border: 1px solid var(--pmg-border);
    box-shadow: 0 24px 80px rgba(0, 0, 0, .36);
}

.pmg-login-brand {
    border-radius: 8px;
    padding: clamp(32px, 7vw, 72px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.pmg-login-brand:after {
    content: "";
    position: absolute;
    inset: auto -80px -120px auto;
    width: 320px;
    height: 320px;
    border: 1px solid rgba(255, 122, 0, .25);
    transform: rotate(28deg);
}

.pmg-brand-mark {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #101010;
    background: var(--pmg-orange);
    font-weight: 800;
}

.pmg-brand-logo,
.pmg-card-logo {
    max-width: 150px;
    max-height: 56px;
    object-fit: contain;
}

.pmg-card-logo {
    margin-bottom: 12px;
}

.pmg-login-brand h1 {
    margin: 30px 0 0;
    font-size: clamp(42px, 6vw, 76px);
    line-height: .95;
    letter-spacing: 0;
}

.pmg-login-brand p {
    color: var(--pmg-orange);
    margin: 8px 0 36px;
    font-weight: 700;
}

.pmg-login-brand strong {
    font-size: 24px;
    margin-bottom: 10px;
}

.pmg-login-brand span,
.pmg-muted,
.pmg-empty,
.pmg-login-card small {
    color: var(--pmg-muted);
}

.pmg-login-card {
    border-radius: 8px;
    padding: 34px;
    align-self: center;
}

.pmg-card-heading {
    margin-bottom: 26px;
}

.pmg-card-heading span {
    display: block;
    font-size: 28px;
    font-weight: 800;
}

.pmg-card-heading small {
    color: var(--pmg-orange);
    font-weight: 700;
}

.pmg-login-form,
.pmg-form,
.pmg-employee-form,
.pmg-generator {
    display: grid;
    gap: 16px;
}

label {
    display: grid;
    gap: 8px;
    color: #eeeeee;
    font-size: 14px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    color: var(--pmg-white);
    background: #0f0f0f;
    border: 1px solid var(--pmg-border);
    border-radius: 8px;
    min-height: 46px;
    padding: 11px 13px;
    outline: 0;
    transition: border .18s ease, box-shadow .18s ease, background .18s ease;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(255, 122, 0, .8);
    box-shadow: 0 0 0 4px rgba(255, 122, 0, .12);
}

.pmg-password-input {
    position: relative;
    display: block;
}

.pmg-password-input input {
    padding-right: 76px;
}

.pmg-icon-btn {
    position: absolute;
    right: 7px;
    top: 7px;
    min-height: 32px;
    border: 0;
    border-radius: 8px;
    background: var(--pmg-panel-2);
    color: var(--pmg-orange);
    cursor: pointer;
}

.pmg-check {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.pmg-check input {
    width: 18px;
    min-height: 18px;
    accent-color: var(--pmg-orange);
}

.pmg-primary-btn,
.pmg-secondary-btn,
.pmg-actions a,
.pmg-filter-bar button,
.pmg-form-actions button,
.pmg-list-item button,
.pmg-detail-grid button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 800;
    transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}

.pmg-primary-btn,
.pmg-actions a:first-child,
.pmg-filter-bar button {
    background: var(--pmg-orange);
    color: #111;
    box-shadow: 0 12px 30px rgba(255, 122, 0, .18);
}

.pmg-primary-btn:hover,
.pmg-actions a:first-child:hover,
.pmg-filter-bar button:hover {
    background: var(--pmg-orange-hover);
    transform: translateY(-1px);
}

.pmg-secondary-btn,
.pmg-actions a,
.pmg-list-item button,
.pmg-detail-grid button {
    background: var(--pmg-panel-2);
    color: var(--pmg-white);
}

.pmg-link {
    justify-self: center;
    font-weight: 700;
}

.pmg-alert {
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 18px;
    background: rgba(255, 122, 0, .1);
    border: 1px solid rgba(255, 122, 0, .24);
}

.pmg-alert-error {
    background: rgba(255, 77, 79, .1);
    border-color: rgba(255, 77, 79, .35);
}

.pmg-alert-success {
    background: rgba(38, 208, 124, .1);
    border-color: rgba(38, 208, 124, .35);
}

.pmg-app {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
}

.pmg-sidebar {
    position: sticky;
    top: 0;
    min-height: 100vh;
    background: rgba(10, 10, 10, .96);
    border-right: 1px solid var(--pmg-border);
    padding: 22px;
}

.pmg-sidebar-brand {
    display: grid;
    gap: 5px;
    margin-bottom: 28px;
}

.pmg-sidebar-brand strong {
    margin-top: 10px;
    font-size: 19px;
}

.pmg-sidebar-brand small,
.pmg-topbar span {
    color: var(--pmg-muted);
}

.pmg-sidebar nav {
    display: grid;
    gap: 7px;
}

.pmg-sidebar nav a,
.pmg-logout-form button {
    width: 100%;
    border: 0;
    border-radius: 8px;
    padding: 12px;
    color: var(--pmg-muted);
    background: transparent;
    text-align: left;
    font-weight: 800;
    cursor: pointer;
}

.pmg-sidebar nav a.active,
.pmg-sidebar nav a:hover,
.pmg-logout-form button:hover {
    background: rgba(255, 122, 0, .12);
    color: var(--pmg-orange);
}

.pmg-logout-form {
    margin-top: 20px;
}

.pmg-main {
    min-width: 0;
    padding: 24px;
}

.pmg-topbar,
.pmg-hero,
.pmg-panel-head,
.pmg-list-item,
.pmg-filter-bar,
.pmg-inline-form,
.pmg-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.pmg-topbar {
    margin-bottom: 18px;
}

.pmg-menu-toggle {
    display: none;
    border: 1px solid var(--pmg-border);
    background: var(--pmg-panel);
    color: var(--pmg-white);
    border-radius: 8px;
    padding: 10px 12px;
}

.pmg-hero {
    padding: 28px;
    background: linear-gradient(135deg, rgba(255, 122, 0, .14), rgba(255, 255, 255, .025));
    border: 1px solid var(--pmg-border);
    border-radius: 8px;
    margin-bottom: 18px;
}

.pmg-hero p {
    color: var(--pmg-orange);
    font-weight: 800;
    margin: 0 0 8px;
}

.pmg-hero h1 {
    margin: 0;
    font-size: clamp(28px, 4vw, 46px);
    letter-spacing: 0;
}

.pmg-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.pmg-stat {
    border-radius: 8px;
    padding: 20px;
}

.pmg-stat strong {
    display: block;
    font-size: 32px;
}

.pmg-stat span {
    color: var(--pmg-muted);
}

.pmg-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.pmg-panel {
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 18px;
}

.pmg-panel h1,
.pmg-panel h2,
.pmg-list-item h3 {
    margin: 0;
}

.pmg-two-col {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr);
    gap: 18px;
}

.pmg-list {
    display: grid;
    gap: 10px;
}

.pmg-list-item {
    border-radius: 8px;
    padding: 14px;
    box-shadow: none;
}

.pmg-list-item > div:nth-child(2) {
    flex: 1;
    min-width: 180px;
}

.pmg-list-item p {
    margin: 4px 0 0;
    color: var(--pmg-muted);
}

.pmg-site-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(255, 122, 0, .14);
    color: var(--pmg-orange);
    font-weight: 900;
}

.pmg-chip {
    padding: 7px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .06);
    color: var(--pmg-muted);
    font-size: 12px;
    font-weight: 800;
}

.pmg-shared {
    color: var(--pmg-muted);
    max-width: 220px;
}

.pmg-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pmg-filter-bar {
    margin: 16px 0;
    align-items: stretch;
}

.pmg-filter-bar input {
    flex: 1;
}

.pmg-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.pmg-detail-grid > div {
    background: rgba(255, 255, 255, .035);
    border: 1px solid var(--pmg-border);
    border-radius: 8px;
    padding: 16px;
    display: grid;
    gap: 8px;
}

.pmg-delete-form {
    margin-top: 18px;
}

.pmg-delete-form button {
    min-height: 44px;
    border: 1px solid rgba(255, 77, 79, .45);
    border-radius: 8px;
    padding: 10px 16px;
    color: #fff;
    background: rgba(255, 77, 79, .12);
    cursor: pointer;
    font-weight: 800;
}

.pmg-detail-grid span {
    color: var(--pmg-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.pmg-notes {
    grid-column: 1 / -1;
}

.pmg-fieldset {
    border: 1px solid var(--pmg-border);
    border-radius: 8px;
    padding: 14px;
}

.pmg-strength {
    height: 8px;
    background: #262626;
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.pmg-strength span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--pmg-danger);
    transition: width .2s ease, background .2s ease;
}

.pmg-strength em {
    position: absolute;
    right: 0;
    top: 12px;
    color: var(--pmg-muted);
    font-size: 12px;
    font-style: normal;
}

.pmg-generated-value {
    min-height: 58px;
    display: flex;
    align-items: center;
    padding: 14px;
    word-break: break-all;
    background: #0f0f0f;
    border: 1px solid var(--pmg-border);
    border-radius: 8px;
    color: var(--pmg-orange);
    font-weight: 800;
}

.pmg-activity {
    display: grid;
    gap: 12px;
}

.pmg-activity div {
    display: grid;
    gap: 4px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--pmg-border);
}

.pmg-activity span {
    color: var(--pmg-muted);
}

.pmg-toast {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 50;
    max-width: 320px;
    padding: 12px 14px;
    border-radius: 8px;
    background: var(--pmg-orange);
    color: #111;
    font-weight: 800;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}

.pmg-toast.show {
    opacity: 1;
    transform: translateY(0);
}

@keyframes pmgFadeUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 920px) {
    .pmg-login-wrap,
    .pmg-app,
    .pmg-two-col,
    .pmg-detail-grid {
        grid-template-columns: 1fr;
    }

    .pmg-login-brand {
        display: none;
    }

    .pmg-sidebar {
        position: fixed;
        z-index: 30;
        inset: 0 auto 0 0;
        width: 280px;
        transform: translateX(-100%);
        transition: transform .2s ease;
    }

    .pmg-sidebar.open {
        transform: translateX(0);
    }

    .pmg-menu-toggle {
        display: inline-flex;
    }

    .pmg-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .pmg-login-body,
    .pmg-main {
        padding: 16px;
    }

    .pmg-login-card,
    .pmg-panel,
    .pmg-hero {
        padding: 18px;
    }

    .pmg-stat-grid {
        grid-template-columns: 1fr;
    }

    .pmg-hero,
    .pmg-panel-head,
    .pmg-list-item,
    .pmg-filter-bar,
    .pmg-inline-form,
    .pmg-form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .pmg-row-actions {
        width: 100%;
    }

    .pmg-row-actions a,
    .pmg-list-item button {
        flex: 1;
        text-align: center;
    }
}
