* {
    box-sizing: border-box;
}

:root {
    --primary-blue: #0f2a56;
    --primary-green: #1f4f8a;
    --accent-yellow: #f6c453;
    --sidebar-blue: #0a1e42;
    --surface-soft: #f8fafc;
    --surface-light: #ffffff;
    --text-main: #1e293b;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: #eef3fb;
    color: var(--text-main);
}

.app-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 160px 1fr;
}

.sidebar {
    background: var(--sidebar-blue);
    color: #fff;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    width: 100%;
    height: auto;
    z-index: 10;
    transform: none;
    transition: transform 0.25s ease;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.42);
    z-index: 20;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

body.home-page.sidebar-open .sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
}

.brand h1 {
    margin: 0;
    font-size: 18px;
}

.content-area {
    min-width: 0;
}

.topbar {
    padding: 4px 10px 0;
    display: grid;
    grid-template-columns: 56px 1fr minmax(118px, auto);
    align-items: center;
    gap: 4px;
}

.topbar-title {
    margin: 0;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: clamp(18px, 2.8vw, 42px);
    letter-spacing: 2px;
    line-height: 1.08;
    color: #0a1e42;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    padding: 0 8px;
}

.topbar-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    max-width: 100%;
}

.topbar-brand > span {
    display: inline-block;
    transform: scale(1.35);
    transform-origin: center center;
}

.topbar-brand-logo {
    width: 64px;
    height: 64px;
    margin-left: 0;
    object-fit: contain;
    border: none;
    border-radius: 0;
    padding: 0;
    transform: translateX(-155px) scale(1.6);
    transform-origin: center center;
}

.topbar-spacer {
    width: 56px;
    height: 1px;
    flex-shrink: 0;
}

.subtitle {
    margin: 6px 0 0;
    color: #dbeafe;
}

.user-pill {
    display: inline-flex;
    flex-direction: column;
    align-items: stretch;
    background: #d8e6ff;
    padding: 4px 6px;
    border-radius: 8px;
    min-width: 118px;
    flex-shrink: 0;
}

.menu-toggle {
    border: none;
    background: var(--primary-blue);
    color: #fff;
    border-radius: 10px;
    font-size: 24px;
    padding: 6px 12px;
    line-height: 1;
    min-width: auto;
    width: 56px;
    display: none;
    flex-shrink: 0;
}

body.home-page .app-layout {
    display: block;
}

body.home-page .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 160px;
    height: 100vh;
    z-index: 30;
    transform: translateX(-100%);
}

body.home-page.sidebar-open .sidebar {
    transform: translateX(0);
}

body.home-page .menu-toggle {
    display: inline-block;
}

body.home-page .topbar-brand {
    transform: none;
}

body.home-page .topbar-brand-logo {
    width: 68px;
    height: 68px;
    margin-left: 0;
    transform: translateX(-164px) scale(1.75);
    transform-origin: center center;
}

.user-pill small {
    text-transform: uppercase;
    color: #0f2a56;
    margin-top: 4px;
}

.user-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.profile-inline {
    text-decoration: none;
    background: #0f2a56;
    color: #fff;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    width: 100%;
    text-align: center;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.nav-links a {
    color: #ffffff;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
    font-weight: 600;
    transition: transform 0.2s ease, background 0.2s ease;
}

.nav-links a:hover {
    transform: translateX(1px);
    background: rgba(255, 255, 255, 0.28);
}

.container {
    max-width: 1100px;
    margin: 22px auto;
    background: #ffffff;
    padding: 22px;
    border-radius: 16px;
    box-shadow: 0 14px 36px rgba(21, 128, 61, 0.12), 0 8px 24px rgba(29, 78, 216, 0.1);
}

body.home-page .container {
    max-width: none;
    width: calc(100vw - 40px);
    margin: 10px 20px 20px;
    min-height: calc(100vh - 84px);
}


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

.card {
    background: #ffffff;
    border-radius: 12px;
    padding: 18px;
    border: 1px solid #d4def0;
}


h2 {
    margin-top: 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

th, td {
    padding: 10px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}


form {
    margin: 14px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

input, select, button {
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    min-width: 170px;
}

button {
    background: var(--primary-blue);
    color: #ffffff;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.btn-danger {
    background: #dc2626;
    color: #ffffff;
    border: none;
    padding: 6px 10px;
    border-radius: 8px;
    text-decoration: none;
}

.actions {
    display: flex;
    gap: 8px;
}

.message {
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 14px;
}

.message.success {
    background: #dcfce7;
    color: #166534;
}

.message.error {
    background: #fee2e2;
    color: #991b1b;
}

.login-box {
    max-width: 420px;
    margin: 70px auto;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0;
}

.table-wrap {
    overflow-x: auto;
}

.pagination {
    margin-top: 14px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination a {
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 8px;
    background: #e2e8f0;
    color: #1e293b;
}

.pagination a.active {
    background: var(--primary-blue);
    color: #fff;
}

.bar-row {
    display: grid;
    grid-template-columns: 80px 1fr 120px;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
}

.bar {
    height: 10px;
    border-radius: 999px;
    background: #cbd5e1;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--primary-green);
}

.dashboard-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.dashboard-badge {
    padding: 6px 10px;
    border-radius: 999px;
    background: #e2ebff;
    color: #0f2a56;
    font-weight: 700;
    font-size: 13px;
}

.metric-card {
    position: relative;
    overflow: hidden;
}

.metric-card::after {
    content: "";
    position: absolute;
    right: -25px;
    top: -25px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
}

.metric-label {
    font-size: 14px;
    color: #0f172a;
}

.metric-value {
    font-size: 28px;
    font-weight: 800;
    color: #0b3b84;
}

.dashboard-section {
    margin-top: 20px;
    padding: 16px;
    border-radius: 14px;
    background: var(--surface-soft);
    border: 1px solid #d4def0;
}

.home-hero {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 20px;
    background: var(--primary-blue);
    border-radius: 16px;
    padding: 24px;
    color: #fff;
}

.hero-visual {
    border-radius: 14px;
    min-height: 240px;
    background-image: url("/PIS/assets/images/home/hero-tech.jpg");
    background-size: cover;
    background-position: center;
    border: 2px solid rgba(255, 255, 255, 0.22);
}

.home-hero h2 {
    font-size: 34px;
    line-height: 1.2;
    margin: 0 0 12px;
}

.home-categories {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.cat-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #d4def0;
    padding: 14px;
    font-weight: 700;
}

.tech-gallery {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 12px;
}

.tech-tile {
    position: relative;
    min-height: 150px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #d4def0;
}

.tech-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tech-tile span {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 8px 10px;
    background: rgba(10, 30, 66, 0.75);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

.cat-card span {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #475569;
    margin-top: 4px;
}

.home-hero p {
    margin: 0 0 14px;
    color: #eff6ff;
}

.hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.hero-slider-zone {
    margin-top: 18px;
    position: relative;
    min-height: 360px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.35);
    background: radial-gradient(circle at center, rgba(34, 84, 148, 0.3) 0%, rgba(8, 20, 44, 0.75) 78%);
}

.hero-slider-zone::before,
.hero-slider-zone::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 18%;
    z-index: 2;
    pointer-events: none;
    filter: blur(10px);
}

.hero-slider-zone::before {
    left: -4%;
    background: linear-gradient(to right, rgba(8, 20, 44, 0.95), rgba(8, 20, 44, 0.38), transparent);
}

.hero-slider-zone::after {
    right: -4%;
    background: linear-gradient(to left, rgba(8, 20, 44, 0.95), rgba(8, 20, 44, 0.38), transparent);
}

.hero-slider-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transform: none;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.hero-slider-image.active {
    opacity: 1;
}

.hero-btn {
    display: inline-block;
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 700;
}

.hero-btn.primary {
    background: #fff;
    color: #0f2a56;
}

.hero-btn.secondary {
    background: #1f4f8a;
    color: #fff;
}

.search-card {
    background: #153667;
    border: 1px solid #2c5f99;
    border-radius: 14px;
    padding: 14px;
}

.search-card input {
    min-width: 100%;
    border: none;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.kpi-box {
    background: #fff;
    border: 1px solid #d4def0;
    border-radius: 12px;
    padding: 14px;
}

.kpi-box .value {
    font-size: 24px;
    font-weight: 800;
    color: #0f2a56;
}

.home-section {
    margin-top: 18px;
}

.showcase-grid {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 12px;
}

.showcase-card {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #d4def0;
    background: #fff;
}

.showcase-card img {
    width: 100%;
    height: 190px;
    object-fit: cover;
    display: block;
}

.showcase-card div {
    padding: 10px 12px;
    font-weight: 700;
}

.landing-footer {
    margin-top: 22px;
    background: #0a1e42;
    color: #e2e8f0;
    border-radius: 14px;
    padding: 20px;
}

.landing-footer-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr 1fr;
    gap: 16px;
}

.landing-footer h4 {
    margin: 0 0 10px;
    color: #f6c453;
}

.landing-footer p,
.landing-footer a {
    margin: 0 0 8px;
    color: #e2e8f0;
    text-decoration: none;
    font-size: 14px;
}

.landing-footer a:hover {
    text-decoration: underline;
}

.landing-footer-bottom {
    border-top: 1px solid rgba(226, 232, 240, 0.25);
    margin-top: 14px;
    padding-top: 10px;
    font-size: 13px;
    color: #cbd5e1;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

@media (max-width: 900px) {
    .app-layout {
        grid-template-columns: 1fr;
    }
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: min(82vw, 280px);
        height: 100vh;
        border-right: 1px solid rgba(255, 255, 255, 0.2);
        transform: translateX(-100%);
        z-index: 30;
    }
    body.sidebar-open .sidebar {
        transform: translateX(0);
    }
    .nav-links {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .home-hero {
        grid-template-columns: 1fr;
    }
    .tech-gallery {
        grid-template-columns: 1fr;
    }
    .showcase-grid {
        grid-template-columns: 1fr;
    }
    .landing-footer-grid {
        grid-template-columns: 1fr;
    }
    .topbar-title {
        letter-spacing: 1px;
    }
    .topbar-brand > span {
        transform: scale(1.16);
    }
    .topbar-brand-logo {
        width: 64px;
        height: 64px;
        margin-left: 0;
        transform: translateX(-116px) scale(1.35);
        transform-origin: center center;
    }
    body.home-page .topbar-brand-logo {
        width: 64px;
        height: 64px;
        margin-left: 0;
        transform: translateX(-124px) scale(1.4);
        transform-origin: center center;
    }
}
