﻿/* =========================================================
   PMO IAM - RESPONSIVE DESIGN SYSTEM
   ========================================================= */

:root {
    --pmo-blue: #172b68;
    --pmo-blue-dark: #101e4a;
    --pmo-blue-light: #eef3ff;
    --pmo-gold: #d7a900;
    --pmo-red: #a51c30;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
    --background: #f5f7fb;
    --white: #ffffff;
    --success: #198754;
    --danger: #dc3545;
    --warning: #d39e00;
    --sidebar-width: 260px;
    --header-height: 68px;
    --radius: 14px;
    --shadow: 0 8px 30px rgba(20, 35, 80, 0.08);
}

/* =========================================================
   RESET
   ========================================================= */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    background: var(--background);
    color: var(--text);
}

body {
    font-size: 14px;
}

a {
    color: var(--pmo-blue);
    text-decoration: none;
}

    a:hover {
        text-decoration: none;
    }

/* =========================================================
   APPLICATION LAYOUT
   ========================================================= */

.iam-layout {
    min-height: 100vh;
}

/* =========================================================
   TOP HEADER
   ========================================================= */

.iam-header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.mobile-menu-button {
    display: none;
    border: none;
    background: var(--pmo-blue);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-size: 20px;
    cursor: pointer;
}

.header-title {
    font-weight: 700;
    font-size: 18px;
    color: var(--pmo-blue);
}

.header-subtitle {
    color: var(--muted);
    font-size: 12px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-mini {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--pmo-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.user-info {
    line-height: 1.25;
}

.user-name {
    font-weight: 600;
}

.user-role {
    color: var(--muted);
    font-size: 11px;
}

/* =========================================================
   SIDEBAR
   ========================================================= */

.iam-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: linear-gradient( 180deg, var(--pmo-blue-dark), var(--pmo-blue) );
    color: white;
    z-index: 1100;
    overflow-y: auto;
}

.sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 8px 18px;
    border-bottom: 1px solid rgba(255,255,255,.12);
}

.sidebar-logo {
    width: 45px;
    height: 50px;
    object-fit: contain;
    background: white;
    border-radius: 8px;
    padding: 3px;
}

.sidebar-brand-text {
    margin-left: 10px;
}

.sidebar-brand-title {
    font-size: 16px;
    font-weight: 700;
}

.sidebar-brand-subtitle {
    font-size: 10px;
    opacity: .7;
}

.sidebar-section {
    padding: 18px 16px 7px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    opacity: .55;
}

.sidebar-nav {
    list-style: none;
    padding: 0 10px;
    margin: 0;
}

    .sidebar-nav li {
        margin-bottom: 3px;
    }

    .sidebar-nav a {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 11px 13px;
        border-radius: 9px;
        color: rgba(255,255,255,.82);
        transition: .2s;
    }

        .sidebar-nav a:hover,
        .sidebar-nav a.active {
            background: rgba(255,255,255,.13);
            color: white;
        }

.nav-icon {
    width: 22px;
    text-align: center;
    font-size: 16px;
}

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid rgba(255,255,255,.1);
    margin-top: 15px;
}

/* =========================================================
   MAIN AREA
   ========================================================= */

.iam-main {
    margin-left: var(--sidebar-width);
    padding-top: var(--header-height);
    min-height: 100vh;
}

.iam-content {
    padding: 28px;
    max-width: 1600px;
    margin: auto;
}

/* =========================================================
   PAGE HEADER
   ========================================================= */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.page-title {
    margin: 0;
    color: var(--pmo-blue);
    font-size: 25px;
    font-weight: 700;
}

.page-description {
    color: var(--muted);
    margin-top: 5px;
    font-size: 13px;
}

.page-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* =========================================================
   CARDS
   ========================================================= */

.card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 22px;
}

.card-header {
    padding: 17px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.card-title {
    margin: 0;
    color: var(--pmo-blue);
    font-size: 16px;
    font-weight: 700;
}

.card-body {
    padding: 20px;
}

/* =========================================================
   DASHBOARD CARDS
   ========================================================= */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 25px;
}

.stat-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--pmo-blue);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pmo-blue-light);
    color: var(--pmo-blue);
    font-size: 22px;
}

/* =========================================================
   FORMS
   ========================================================= */

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 22px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.form-group {
    margin-bottom: 4px;
}

    .form-group.full {
        grid-column: 1 / -1;
    }

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 7px;
}

.form-control,
select,
textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid #d1d5db;
    border-radius: 9px;
    background: white;
    padding: 9px 12px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    outline: none;
    transition: .2s;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

    .form-control:focus,
    select:focus,
    textarea:focus {
        border-color: var(--pmo-blue);
        box-shadow: 0 0 0 3px rgba(23,43,104,.10);
    }

.help-text {
    color: var(--muted);
    font-size: 11px;
    margin-top: 5px;
}

/* =========================================================
   BUTTONS
   ========================================================= */

.btn {
    border: none;
    min-height: 40px;
    padding: 8px 16px;
    border-radius: 9px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: .2s;
}

    .btn:hover {
        transform: translateY(-1px);
    }

.btn-primary {
    background: var(--pmo-blue);
    color: white;
}

    .btn-primary:hover {
        background: var(--pmo-blue-dark);
    }

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-light {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}

/* =========================================================
   GRIDVIEW / TABLE
   ========================================================= */

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

    .data-table th {
        background: #f3f5fa;
        color: var(--pmo-blue);
        text-align: left;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: .4px;
        padding: 12px;
        border-bottom: 1px solid var(--border);
    }

    .data-table td {
        padding: 11px 12px;
        border-bottom: 1px solid #edf0f4;
        vertical-align: middle;
    }

    .data-table tr:hover td {
        background: #fafbfe;
    }

    .data-table tr:last-child td {
        border-bottom: none;
    }

/* =========================================================
   BADGES
   ========================================================= */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-success {
    background: #e7f6ec;
    color: #137333;
}

.badge-danger {
    background: #fdebed;
    color: #b42318;
}

.badge-primary {
    background: #eaf0ff;
    color: var(--pmo-blue);
}

.badge-warning {
    background: #fff5d6;
    color: #856404;
}

/* =========================================================
   SEARCH BAR
   ========================================================= */

.search-panel {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: end;
}

.search-field {
    flex: 1;
    min-width: 220px;
}

/* =========================================================
   ALERTS
   ========================================================= */

.alert {
    padding: 12px 15px;
    border-radius: 9px;
    margin-bottom: 18px;
    font-size: 13px;
}

.alert-success {
    background: #eaf7ee;
    color: #176b35;
    border: 1px solid #ccebd6;
}

.alert-danger {
    background: #fcebec;
    color: #9f1d2d;
    border: 1px solid #f4cbd0;
}

.alert-warning {
    background: #fff8df;
    color: #755d00;
    border: 1px solid #f3e4a3;
}

/* =========================================================
   LOGIN PAGE
   ========================================================= */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 25px;
    background: linear-gradient( 135deg, #edf2ff 0%, #f8fafc 50%, #eef3ff 100% );
}

.login-shell {
    width: 100%;
    max-width: 1000px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: white;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 70px rgba(20,35,80,.15);
}

.login-brand {
    background: linear-gradient( 150deg, var(--pmo-blue-dark), var(--pmo-blue) );
    color: white;
    padding: 50px 45px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.login-logo {
    width: 145px;
    height: 190px;
    object-fit: contain;
    background: white;
    border-radius: 18px;
    padding: 8px;
    margin: 0 auto 25px;
}

.login-brand h1 {
    margin: 0;
    font-size: 28px;
}

.login-brand p {
    opacity: .8;
    line-height: 1.6;
}

.login-security {
    margin-top: 20px;
    padding: 13px;
    border-radius: 10px;
    background: rgba(255,255,255,.09);
    font-size: 12px;
}

.login-form {
    padding: 50px 45px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

    .login-form h2 {
        color: var(--pmo-blue);
        margin: 0 0 7px;
        font-size: 26px;
    }

.login-form-description {
    color: var(--muted);
    margin-bottom: 28px;
}

.login-field {
    margin-bottom: 17px;
}

    .login-field label {
        display: block;
        font-weight: 600;
        font-size: 12px;
        margin-bottom: 7px;
    }

.login-input {
    width: 100%;
    height: 46px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 0 13px;
    font-size: 14px;
}

    .login-input:focus {
        outline: none;
        border-color: var(--pmo-blue);
        box-shadow: 0 0 0 3px rgba(23,43,104,.10);
    }

.login-button {
    width: 100%;
    height: 46px;
    border: none;
    border-radius: 10px;
    background: var(--pmo-blue);
    color: white;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

    .login-button:hover {
        background: var(--pmo-blue-dark);
    }

.login-links {
    text-align: center;
    margin-top: 18px;
}

    .login-links a {
        font-size: 12px;
        font-weight: 600;
    }

.login-message {
    display: block;
    margin-top: 16px;
    padding: 10px;
    border-radius: 8px;
    font-size: 12px;
}

.mfa-box {
    background: #f7f9ff;
    border: 1px solid #dce4ff;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 18px;
}

.mfa-info {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 15px;
}

.mfa-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* =========================================================
   FOOTER
   ========================================================= */

.iam-footer {
    text-align: center;
    color: var(--muted);
    font-size: 11px;
    padding: 20px;
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 1100px) {

    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 850px) {

    :root {
        --sidebar-width: 0px;
    }

    .iam-sidebar {
        width: 270px;
        transform: translateX(-100%);
        transition: transform .25s;
        box-shadow: 10px 0 30px rgba(0,0,0,.15);
    }

    body.sidebar-open
    .iam-sidebar {
        transform: translateX(0);
    }

    .iam-header {
        left: 0;
    }

    .mobile-menu-button {
        display: block;
    }

    .iam-main {
        margin-left: 0;
    }

    .iam-content {
        padding: 20px 15px;
    }

    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .form-grid,
    .form-grid-3 {
        grid-template-columns: 1fr;
    }

    .form-group.full {
        grid-column: auto;
    }

    .login-shell {
        grid-template-columns: 1fr;
        max-width: 500px;
    }

    .login-brand {
        padding: 30px 25px;
    }

    .login-logo {
        width: 100px;
        height: 135px;
        margin-bottom: 15px;
    }

    .login-brand h1 {
        font-size: 22px;
    }

    .login-security {
        display: none;
    }

    .login-form {
        padding: 32px 25px;
    }
}

@media (max-width: 600px) {

    .header-subtitle {
        display: none;
    }

    .user-info {
        display: none;
    }

    .header-right {
        gap: 5px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .card-body {
        padding: 15px;
    }

    .card-header {
        padding: 14px 15px;
    }

    .page-title {
        font-size: 21px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-value {
        font-size: 24px;
    }

    .mfa-actions {
        grid-template-columns: 1fr;
    }
}
