:root {
    --primary-color: #2c5364;
    --secondary-color: #203a43;
    --accent-color: #0f2027;
    --text-color: #333;
    --bg-color: #f4f6f8;
    --white: #ffffff;
    --error-bg: #ffe5e5;
    --error-text: #b30000;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, sans-serif;
    background: linear-gradient(135deg, var(--accent-color), var(--secondary-color), var(--primary-color));
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
}

/* Login Page */
body.login-page {
    align-items: center;
    justify-content: center;
}

.login-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 35px;
    border-radius: 14px;
    width: 340px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, .25);
    animation: fadeIn 0.6s ease;
}

.login-container h2 {
    text-align: center;
    margin-bottom: 5px;
    color: var(--primary-color);
}

.confidencial {
    text-align: center;
    font-size: 12px;
    letter-spacing: 2px;
    color: var(--error-text);
    margin-bottom: 25px;
    font-weight: bold;
}

input {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 15px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 14px;
}

button {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

button:hover {
    background: var(--secondary-color);
}

.alert {
    padding: 10px;
    border-radius: 6px;
    text-align: center;
    margin-bottom: 15px;
    font-size: 14px;
}

.alert-error {
    background: var(--error-bg);
    color: var(--error-text);
}

/* Dashboard */
.topo {
    color: var(--white);
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topo a {
    color: var(--white);
    text-decoration: none;
    font-weight: bold;
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    transition: background 0.3s;
}

.topo a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.container {
    max-width: 1100px;
    width: 100%;
    margin: auto;
    padding: 20px;
    flex-grow: 1;
}

.card {
    background: var(--white);
    border-radius: 14px;
    padding: 25px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, .25);
}

.lista {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.item {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.item:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, .15);
}

.item a {
    text-decoration: none;
    color: var(--text-color);
    display: block;
}

.icon {
    font-size: 42px;
    margin-bottom: 10px;
}

.nome {
    font-size: 14px;
    word-break: break-all;
    line-height: 1.4;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Actions Bar */
.actions-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    align-items: center;
}

.right-actions {
    display: flex;
    gap: 10px;
}

.btn-action {
    background: var(--white);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    transition: 0.3s;
    display: inline-block;
    width: auto;
}

.btn-action:hover {
    background: var(--primary-color);
    color: var(--white);
}

.current-path {
    background: #f4f6f8;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-family: monospace;
    font-size: 14px;
    color: #555;
    border: 1px solid #ddd;
}

.empty-msg {
    grid-column: 1 / -1;
    text-align: center;
    color: #777;
    font-style: italic;
    padding: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--white);
    padding: 25px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.3s ease;
}

.modal-content h3 {
    margin-top: 0;
    color: var(--primary-color);
    text-align: center;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-cancel {
    background: #ccc;
    color: #333;
}

.btn-cancel:hover {
    background: #bbb;
}

/* Toasts */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    min-width: 250px;
    opacity: 0;
    transform: translateX(50px);
    transition: 0.3s ease;
    border-left: 5px solid #2c5364;
    overflow: hidden;
    position: relative;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    border-left-color: #28a745;
}

.toast-error {
    border-left-color: #dc3545;
}

.toast-content {
    margin-bottom: 5px;
    font-size: 14px;
    color: #333;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    width: 100%;
    animation: progress 4s linear forwards;
}

@keyframes progress {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

/* Updated Delete Button */
.btn-delete {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #fff;
    color: #dc3545;
    border: 1px solid #dc3545;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: scale(0.8);
    transition: 0.3s;
    z-index: 10;
}

.item-wrapper:hover .btn-delete {
    opacity: 1;
    transform: scale(1);
    top: 5px;
    right: 5px;
}

.btn-delete:hover {
    background: #dc3545;
    color: #fff;
    transform: scale(1.1) !important;
}


.item-wrapper {
    position: relative;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-danger:hover {
    background: #c82333;
}