/* --- Variables & Reset --- */
:root {
    --primary-color: #e57421;
    --primary-hover: #cf661a;
    --sidebar-bg: #2d323e;
    --header-bg: #2d323e;
    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --text-main: #333333;
    --text-muted: #666666;
    --border-color: #e0e0e0;
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.05);

    --font-heading: 'Ubuntu', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    height: 100vh;
    overflow: hidden;
    /* App-like feel */
}

.hidden {
    display: none !important;
}

/* --- LOGIN SCREEN --- */
#login-screen {
    height: 100vh;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: url('imagens/background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
}

.bg-geometry {
    display: none;
}

.login-wrapper {
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 400px;
    padding: 40px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    /* Light shadow */
}

.login-brand {
    margin-bottom: 30px;
}

.sagui-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-img-login {
    max-width: 200px;
    height: auto;
}

.logo-text h1 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 32px;
    color: #333;
    line-height: 1;
}

.logo-text span {
    font-size: 10px;
    color: #666;
    line-height: 1.1;
    display: block;
}

.login-card {
    background: transparent;
    /* Seamless on white */
    width: 100%;
}

.login-inst {
    text-align: center;
    color: #888;
    font-size: 13px;
    margin-bottom: 20px;
}

.input-group {
    margin-bottom: 15px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper input {
    width: 100%;
    background: #f1f3f5;
    border: 1px solid transparent;
    border-radius: 4px;
    /* Squarish rounded */
    padding: 12px 12px 12px 40px;
    font-size: 14px;
    color: #333;
    transition: all 0.2s;
}

.input-wrapper input:focus {
    background: white;
    border-color: #ddd;
    outline: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #333;
    /* Dark icon */
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
}

.forgot-wrapper {
    text-align: right;
    margin-bottom: 20px;
}

.forgot-link {
    color: #888;
    font-size: 12px;
    text-decoration: none;
}

.btn {
    border: none;
    cursor: pointer;
    border-radius: 20px;
    /* Pill shape */
    font-weight: 600;
    font-size: 14px;
    padding: 10px 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    background: #e0e0e0;
    z-index: 1;
}

.divider span {
    background: white;
    padding: 0 10px;
    font-size: 11px;
    color: #999;
    z-index: 2;
    text-transform: uppercase;
}

.btn-google {
    background: #db4437;
    color: white;
    margin-bottom: 10px;
}

.btn-gov {
    background: #1351b4;
    color: white;
}

.foreigner-divider {
    text-align: center;
    margin: 20px 0 10px;
    border-top: 1px dotted #ccc;
    padding-top: 10px;
}

.foreigner-divider span {
    font-size: 10px;
    color: #666;
    font-weight: 700;
}

.btn-secondary {
    background: #999;
    color: white;
}

.error-message {
    color: #dc2626;
    font-size: 13px;
    text-align: center;
    margin-bottom: 15px;
}

/* --- DASHBOARD LAYOUT --- */
.layout {
    display: flex;
    height: 100vh;
    width: 100vw;
    flex-direction: column;
    /* Stack header and content */
}

/* Sidebar removed */

/* Main Wrapper */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
}

/* Top Header */
.top-header {
    height: 80px;
    /* Slightly taller for bigger logo */
    background: var(--header-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.logo-img-header {
    height: 68px;
    /* Further increased size */
    width: auto;
    filter: brightness(0) invert(1);
    /* White logo */
    object-fit: contain;
}

.header-breadcrumb {
    color: #eee;
    font-size: 16px;
    font-weight: 500;
    padding-left: 24px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.icon-btn {
    background: transparent;
    border: none;
    color: #ccc;
    font-size: 22px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: color 0.2s;
}

.icon-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.user-profile-menu {
    display: flex;
    align-items: center;
    gap: 16px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding-left: 20px;
}

.profile-click-area {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.profile-click-area:hover {
    background: rgba(255, 255, 255, 0.05);
}

.greeting {
    color: #ccc;
    font-size: 14px;
}

.avatar-circle img {
    width: 36px;
    height: 36px;
    /* Slightly larger avatar */
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: block;
    object-fit: cover;
}

/* Logout Button */
.logout-icon {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.logout-icon:hover {
    background: #db4437;
    color: white;
    transform: translateY(-2px);
}

/* Notification Button & Tooltip */
.notification-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.custom-tooltip {
    position: absolute;
    top: 100%;
    right: 50%;
    transform: translateX(50%) translateY(10px);
    background: #333;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    pointer-events: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.custom-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent #333 transparent;
}

.notification-wrapper:hover .custom-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(50%) translateY(5px);
}


/* Content Area */
.content-area {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-color);
    padding: 30px;
}

.page-title {
    font-size: 20px;
    color: #333;
    margin-bottom: 24px;
    font-weight: 500;
}

/* CARDS LIST (Autoatendimento) */
.cards-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.action-card {
    background: white;
    padding: 24px;
    border-radius: 8px;
    /* Clean crisp internal cards */
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid transparent;
    text-decoration: none;
    /* Ensure links don't have underline */
    color: inherit;
    /* Inherit text color */
}

.action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    border-color: rgba(229, 116, 33, 0.2);
}

.action-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    /* Circle background */
    background: rgba(229, 116, 33, 0.1);
    /* Light orange bg */
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 24px;
    flex-shrink: 0;
}

.action-info h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 4px;
    font-weight: 600;
}

.action-info p {
    font-size: 13px;
    color: #888;
    line-height: 1.4;
}

/* DETAILS PAGE */
.alert-banner {
    background: white;
    padding: 16px;
    border-radius: 6px;
    display: flex;
    align-items: flex-start;
    /* Align top for multi-line */
    gap: 12px;
    margin-bottom: 24px;
    border-left: 4px solid #3b82f6;
    box-shadow: var(--shadow-soft);
}

.alert-warning {
    border-left-color: #f59e0b;
    background-color: #fffbeb;
}

.alert-warning .alert-icon {
    color: #f59e0b;
}

.btn-alert-action {
    margin-top: 12px;
    background-color: #f59e0b;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-alert-action:hover {
    background-color: #d97706;
}

/* --- MODAL --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.close-modal-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
}

.close-modal-btn:hover {
    color: #333;
}

.modal-body {
    padding: 24px;
}

.modal-desc {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 8px;
    color: #444;
}

.form-group input[type="file"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fafafa;
}

.modal-footer {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-cancel {
    padding: 10px 20px;
    background: #f0f2f5;
    border: none;
    border-radius: 6px;
    color: #555;
    cursor: pointer;
    font-weight: 500;
}

.btn-cancel:hover {
    background: #e4e6eb;
}

.btn-submit {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
}

.btn-submit:hover {
    background: var(--primary-hover);
}


.alert-icon {
    color: #3b82f6;
    font-size: 20px;
}

.alert-text {
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}

.alert-text strong {
    color: #333;
}

.alert-text ul {
    margin-top: 4px;
    padding-left: 20px;
}

.details-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 24px;
    align-items: start;
    /* Don't stretch height */
}

/* Left Column - Profile Box */
.profile-box {
    background: white;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: var(--shadow-soft);
}

.profile-photo img {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 16px;
}

.profile-box h2 {
    font-size: 16px;
    color: #333;
    margin-bottom: 16px;
}

.profile-meta {
    margin-bottom: 24px;
}

.meta-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    color: #666;
    margin-bottom: 6px;
}

.profile-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu-item {
    background: none;
    border: none;
    padding: 10px;
    border-radius: 20px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.menu-item:hover {
    background: #f5f5f5;
}

.menu-item.active {
    background: #fdf0e6;
    color: var(--primary-color);
    font-weight: 600;
}


/* Right Column - Info */
.info-card {
    background: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: var(--shadow-soft);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 24px;
    color: #333;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.field-item {
    display: flex;
    flex-direction: column;
}

.field-item.full-width {
    grid-column: 1 / -1;
}

.field-item label {
    font-size: 12px;
    font-weight: 600;
    color: #444;
    margin-bottom: 4px;
}

.field-value {
    font-size: 14px;
    color: #666;
    font-style: italic;
    border-bottom: 1px solid #eee;
    padding-bottom: 4px;
}


/* Responsive */
/* Responsive */
@media (max-width: 900px) {
    .details-layout {
        grid-template-columns: 1fr;
    }

    .profile-box {
        margin-bottom: 24px;
    }
}

@media (max-width: 768px) {

    /* Login Screen */
    .login-wrapper {
        padding: 30px 20px;
        width: 90%;
        max-width: 350px;
    }

    .login-brand {
        margin-bottom: 20px;
    }

    .logo-img-login {
        max-width: 150px;
    }

    /* Layout */
    .content-area {
        padding: 20px 16px;
    }

    /* Header */
    /* Header */
    .top-header {
        flex-direction: row;
        /* Keep in one line */
        gap: 12px;
        align-items: center;
        padding: 12px 16px;
        height: auto;
        justify-content: space-between;
    }

    .header-left {
        width: auto;
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .header-breadcrumb {
        display: none;
        /* Hide on mobile to save space */
    }

    .header-actions {
        width: auto;
        justify-content: flex-end;
        margin-top: 0;
        gap: 12px;
    }

    .logo-img-header {
        height: 32px;
        /* Slightly smaller logo on mobile */
    }

    /* Modals */
    .modal-content {
        width: 95%;
        margin: 10px;
    }

    .modal-header {
        padding: 12px 16px;
    }

    .modal-body {
        padding: 16px;
    }
}

@media (max-width: 600px) {
    .layout {
        flex-direction: column;
    }

    .sidebar {
        display: none;
        /* In real app use hamburger */
    }

    .main-wrapper {
        width: 100vw;
    }

    /* Cards */
    .cards-list {
        grid-template-columns: 1fr;
    }

    .action-card {
        padding: 16px;
    }

    .action-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    /* Typography */
    .page-title {
        font-size: 18px;
        margin-bottom: 16px;
    }

    /* Profile Header - Compact */
    .user-profile-menu {
        padding-left: 10px;
        gap: 10px;
    }

    .greeting {
        font-size: 13px;
        display: none;
        /* Hide greeting text on very small screens if needed, or keep */
    }

    /* Ensure greeting is visible but maybe stacked or smaller? keeping it visible for now */
    .greeting {
        display: inline;
    }

    .header-breadcrumb {
        font-size: 14px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 200px;
    }
}

.logo-img-sidebar {
    width: 180px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    filter: brightness(0) invert(1);
    /* Make logo white */
    display: block;
    margin: 0 auto;
}