/* Core shared stylesheet for DIMs pages */

/* ===== RESET ===== */
*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --sidebar-bg: #1a2340;
    --sidebar-hover: #242f52;
    --sidebar-active-blue: #3b5bdb;
    --sidebar-active-purple: #6610f2;
    --sidebar-active-green: #198754;
    --text-muted: #6c7a9c;
    --text-dim: #4a5578;
    --accent-blue: #4c6ef5;
    --accent-purple: #845ef7;
    --accent-green: #198754;
    --sidebar-width: 260px;
    --surface: #fff;
    --surface-alt: #f5f7ff;
    --border: #eef0f8;
    --bg: #f0f2f8;
    --shadow: 0 2px 14px rgba(0, 0, 0, 0.05);
    --radius: 10px;
}

body {
    font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
    background: var(--bg);
    color: #1a2340;
    margin: 0;
    overflow-x: hidden;
}

button, input, select, textarea {
    font: inherit;
}

img, svg {
    max-width: 100%;
    display: block;
}

/* ===== LAYOUT ===== */
#content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: 0;
    background: var(--bg);
}

@media (max-width: 768px) {
    #content {
        margin-left: 0;
    }
}

.page-wrapper {
    padding: 28px 32px 60px 28px;
}

.breadcrumb-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 10px;
}

.page-heading {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-heading-accent {
    width: 4px;
    height: 28px;
    background: linear-gradient(180deg, #3b5bdb, #4c6ef5);
    border-radius: 2px;
}

.page-heading h2 {
    font-weight: 800;
    font-size: 1.35rem;
    margin: 0;
}

.page-badge {
    background: #eef1fc;
    color: #3b5bdb;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
}

.breadcrumb-nav {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    gap: 6px;
}

.breadcrumb-nav a {
    color: var(--text-muted);
    text-decoration: none;
}

.breadcrumb-nav .active {
    color: #3b5bdb;
    font-weight: 600;
}

.hris-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 18px;
    border-radius: 11px;
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 22px;
}

.hris-alert.success {
    background: #d4edda;
    color: #155724;
}

.hris-alert.danger {
    background: #f8d7da;
    color: #721c24;
}

.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.form-card-header {
    background: linear-gradient(135deg, #3b5bdb, #4c6ef5);
    color: #fff;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-card-body {
    padding: 28px 28px 32px;
}

.field-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: #9aa3b8;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 7px;
}

.hris-input,
.hris-select {
    width: 100%;
    border: 1.5px solid #e5e9f5;
    border-radius: 9px;
    padding: 10px 14px;
    font-size: 13.5px;
    background: #fafbff;
    outline: none;
}

.hris-input:focus,
.hris-select:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(76, 110, 245, 0.1);
}

.table-responsive {
    border: 1.5px solid #e5e9f5;
    border-radius: 10px;
    overflow: hidden;
}

.table thead th {
    background: var(--surface-alt);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
    padding: 13px 14px;
}

.grand-total-wrap {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 16px 24px;
    background: var(--surface-alt);
    border-top: 1.5px solid #e5e9f5;
    font-weight: 700;
}

.grand-total-value {
    font-size: 18px;
    color: #3b5bdb;
    margin-left: 12px;
}

.btn-add-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #e7f3ff;
    color: #3b5bdb;
    border: 1.5px dashed #4c6ef5;
    border-radius: 9px;
    padding: 11px 18px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
}

.btn-save {
    background: #3b5bdb;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 9px;
    font-weight: 600;
    cursor: pointer;
}

.btn-cancel {
    background: #f1f3f5;
    color: #495057;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 9px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}

.section-divider {
    border: none;
    border-top: 1px solid #eef0f8;
    margin: 20px 0;
}

/* ===== SIDEBAR ===== */
#sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    transition: margin-left 0.3s ease;
    overflow: hidden;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 22px 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    flex-shrink: 0;
    text-decoration: none;
}

.sidebar-brand-icon {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, #3b5bdb, #4c6ef5);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-brand-icon i {
    color: #fff;
    font-size: 15px;
}

.sidebar-brand-text {
    line-height: 1.2;
}

.sidebar-brand-title {
    font-weight: 800;
    font-size: 13.5px;
    color: #fff;
    letter-spacing: 0.3px;
    display: block;
}

.sidebar-brand-sub {
    font-size: 9.5px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 14px 10px;
    padding: 10px 13px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    flex-shrink: 0;
}

.sidebar-user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #3b5bdb, #4c6ef5);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-user-avatar i {
    color: #fff;
    font-size: 14px;
}

.sidebar-user-info {
    overflow: hidden;
}

.sidebar-user-name {
    font-weight: 700;
    font-size: 12.5px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.sidebar-user-role {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.3px;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.12) transparent;
}

.sidebar-menu::-webkit-scrollbar {
    width: 4px;
}

.sidebar-menu::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.12);
    border-radius: 4px;
}

.nav-category {
    font-size: 9.5px;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 14px 20px 5px 20px;
}

.sidebar-menu .nav-link,
.nav-link-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    margin: 1px 10px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: background 0.18s, color 0.18s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-link-logout {
    font-weight: 600;
    color: #f87171;
}

.sidebar-menu .nav-link .nav-icon,
.nav-link-logout .nav-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    flex-shrink: 0;
    font-size: 12px;
    transition: background 0.18s;
}

.sidebar-menu .nav-link:hover,
.nav-link-logout:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.sidebar-menu .nav-link:hover .nav-icon,
.nav-link-logout:hover .nav-icon {
    background: rgba(255,255,255,0.1);
}

.sidebar-menu .nav-link.active-blue {
    background: rgba(59, 91, 219, 0.18);
    color: #a5b4fc;
}

.sidebar-menu .nav-link.active-blue .nav-icon {
    background: var(--sidebar-active-blue);
    color: #fff;
}

.sidebar-menu .nav-link.active-purple {
    background: rgba(102, 16, 242, 0.18);
    color: #c4b5fd;
}

.sidebar-menu .nav-link.active-purple .nav-icon {
    background: var(--sidebar-active-purple);
    color: #fff;
}

.sidebar-menu .nav-link.active-green {
    background: rgba(25, 135, 84, 0.18);
    color: #6ee7b7;
}

.sidebar-menu .nav-link.active-green .nav-icon {
    background: var(--sidebar-active-green);
    color: #fff;
}

.sidebar-divider {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.06);
    margin: 8px 16px;
}

@media (max-width: 768px) {
    #sidebar { margin-left: -260px; }
    #sidebar.open { margin-left: 0; }
}
