/* Velantia Skeleton - Base styles */
* {
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    margin: 0;
    display: flex;
    flex-direction: column;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: #f3f4f6;
    color: #111827;
}

body.app-layout {
    height: 100vh;
    overflow: hidden;
}

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.topbar {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: #003366;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.topbar .logo-img {
    height: 1.75rem;
    width: auto;
    object-fit: contain;
    vertical-align: middle;
}

.topbar .logo {
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
}

.topbar .menu a {
    margin-right: 1rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
}

.topbar .menu a:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    text-decoration: none;
}

.topbar .menu a.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    width: 100%;
}

.content-inner {
    max-width: 1100px;
    margin: 1.5rem auto;
    padding: 0 1rem 2rem;
}

.app-footer {
    flex-shrink: 0;
    padding: 0.35rem 1.5rem;
    background: #003366;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
    text-align: center;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card {
    background: white;
    padding: 1.25rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-bottom: 1rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.table th,
.table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.table thead {
    background-color: #f9fafb;
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover td {
    background-color: #f3f4f6;
}

.actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-icon,
.btn-icon-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    text-decoration: none;
}

.btn-icon {
    width: 2rem;
    height: 2rem;
    background: transparent;
    color: #4b5563;
}

.btn-icon:hover {
    background-color: #e5e7eb;
    color: #111827;
}

.btn-icon.btn-icon-danger:hover {
    background-color: #fee2e2;
    color: #dc2626;
}

.btn-icon-add {
    background: #003366;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 51, 102, 0.3);
}

.btn-icon-add:hover {
    background: #002244;
    color: white;
    box-shadow: 0 4px 8px rgba(0, 51, 102, 0.4);
}

.topbar-user {
    position: relative;
}

.user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: -0.02em;
}

.user-avatar:hover {
    opacity: 0.9;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 10rem;
    padding: 0.35rem 0;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #e5e7eb;
    z-index: 100;
}

.user-dropdown-header {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #111827;
    border-bottom: 1px solid #e5e7eb;
}

.user-dropdown a,
.user-dropdown button {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    border: none;
    background: none;
    text-align: left;
    font-size: 0.9rem;
    color: #374151;
    cursor: pointer;
    text-decoration: none;
}

.user-dropdown a:hover,
.user-dropdown button:hover {
    background-color: #f3f4f6;
}

.user-dropdown form {
    border-top: 1px solid #e5e7eb;
}

.btn-primary,
.btn-secondary,
.btn-danger,
.btn-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    border: none;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background-color: #003366;
    color: white;
}

.btn-primary:hover {
    background-color: #002244;
}

.btn-secondary {
    background-color: #e5e7eb;
    color: #111827;
}

.btn-secondary:hover {
    background-color: #d1d5db;
}

.btn-danger {
    background-color: #dc2626;
    color: white;
}

.btn-danger:hover {
    background-color: #b91c1c;
}

.btn-link {
    background: transparent;
    color: #4b5563;
}

.btn-link:hover {
    background-color: #f3f4f6;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

label {
    font-size: 0.85rem;
    color: #4b5563;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="password"],
select {
    padding: 0.45rem 0.6rem;
    border-radius: 0.5rem;
    border: 1px solid #d1d5db;
    font-size: 0.9rem;
}

input:focus,
select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.3);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

.field-error {
    color: #b91c1c;
    font-size: 0.8rem;
}

.form-hint {
    font-size: 0.8rem;
    color: #6b7280;
    margin: 0.25rem 0 0;
}

.error-msg {
    color: #b91c1c;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.alert {
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
}

.alert-danger {
    background-color: #fee2e2;
    color: #b91c1c;
}

.alert-success {
    background-color: #dcfce7;
    color: #166534;
}

.alert-warning {
    background-color: #fef3c7;
    color: #92400e;
    margin-bottom: 1rem;
}

.auth-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: radial-gradient(circle at top, #e0edff, #f3f4f6);
}

.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 1.5rem;
}

.auth-container input[type="text"],
.auth-container input[type="password"] {
    height: 2.5rem;
    box-sizing: border-box;
}

.auth-submit {
    margin-top: 1.25rem;
    text-align: center;
}
