@import url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css");

:root {
    --bg: #ffffff;
    --fg: #0f172a;
    --muted: #64748b;
    --card: #ffffff;
    --border: #e2e8f0;
    --ring: #cbd5e1;
    --primary: #0f172a;
    --primary-hover: #020817;
    --primary-foreground: #f8fafc;
}

body {
    background: #ffffff;
    color: var(--fg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

.bg-light {
    background: #ffffff !important;
}

.navbar {
    background: #ffffff !important;
    backdrop-filter: none;
    border-bottom: 1px solid var(--border) !important;
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: -0.01em;
}

main {
    padding-bottom: 2rem;
}

.h4 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.card {
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 8px 24px rgba(15, 23, 42, 0.06);
}

.card .card-footer {
    border-top: 1px solid var(--border);
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
}

.list-group {
    gap: 0.4rem;
}

.list-group-item {
    border: 1px solid var(--border);
    border-radius: 6px !important;
    font-weight: 500;
    color: #334155;
}

.list-group-item:hover {
    background: #f4f4f5;
}

.list-group-item.active {
    background: #f1f5f9;
    color: #1e293b;
    border-color: #d1d5db;
}

.sidebar-tree {
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    min-height: calc(100vh - 6.8rem);
    height: calc(100vh - 6.8rem);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: sticky;
    top: 5.8rem;
}

.sidebar-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0.15rem 0.9rem;
    border-bottom: 0;
}

.sidebar-logo-dot {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: #0f172a;
}

.sidebar-logo-text {
    font-weight: 700;
    font-size: 0.98rem;
    line-height: 1.1;
}

.sidebar-main {
    flex: 1;
    overflow-y: auto;
    padding: 0.35rem 0 0.45rem;
}

.sidebar-bottom {
    border-top: 1px solid #eceff3;
    padding: 0.65rem 0 0.1rem;
    margin-top: auto;
}

.sidebar-section + .sidebar-section {
    margin-top: 1.1rem;
}

.sidebar-title {
    font-weight: 700;
    font-size: 0.76rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    padding-left: 0;
    color: #6b7280;
}

.sidebar-list {
    list-style: none;
    padding-left: 0.75rem;
    margin: 0;
    border-left: 1px solid #e5e7eb;
}

.sidebar-list li {
    position: relative;
    margin: 0.25rem 0;
    padding-left: 0.7rem;
}

.sidebar-list li::before {
    content: "";
    position: absolute;
    left: -0.9rem;
    top: 1rem;
    width: 0.65rem;
    border-top: 1px solid #e5e7eb;
}

.sidebar-link {
    display: block;
    color: #111827;
    text-decoration: none;
    padding: 0.45rem 0.65rem;
    border-radius: 0;
    font-weight: 400;
    transition: background-color .15s ease, color .15s ease;
}

.sidebar-link i {
    width: 1rem;
    margin-right: 0.55rem;
    color: #4b5563;
    text-align: center;
}

.sidebar-link:hover {
    background: #f3f4f6;
}

.sidebar-link.active {
    background: #efefef;
    color: #111827;
}

.form-control,
.form-select {
    border-radius: 6px;
    border: 1px solid var(--border);
    min-height: 40px;
    box-shadow: none;
}

.form-control:focus,
.form-select:focus {
    border-color: #94a3b8;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.25);
}

.btn {
    border-radius: 6px;
    font-weight: 400;
    padding: 0.45rem 0.9rem;
}
.btn-sm {
    padding: 0.25rem 0.7rem !important;
    font-size: 0.8125rem !important;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--primary-foreground);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
    color: var(--primary-foreground) !important;
}

.btn-outline-primary {
    color: var(--primary);
    border-color: #cbd5e1;
}

.btn-outline-primary:hover {
    background: #f1f5f9;
    color: var(--primary);
    border-color: #94a3b8;
}

.btn-outline-secondary {
    color: #334155;
    border-color: #cbd5e1;
}

.btn-red {
    background: #dc2626 !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
}

.btn-red:hover,
.btn-red:focus,
.btn-red:active {
    background: #b91c1c !important;
    border-color: #b91c1c !important;
    color: #ffffff !important;
}

.btn-green {
    background: #16a34a !important;
    border-color: #16a34a !important;
    color: #ffffff !important;
}

.btn-green:hover,
.btn-green:focus,
.btn-green:active {
    background: #15803d !important;
    border-color: #15803d !important;
    color: #ffffff !important;
}

.btn-blue {
    background: #2563eb !important;
    border-color: #2563eb !important;
    color: #ffffff !important;
}

.btn-blue:hover,
.btn-blue:focus,
.btn-blue:active {
    background: #1d4ed8 !important;
    border-color: #1d4ed8 !important;
    color: #ffffff !important;
}

.btn-yellow {
    background: #eab308 !important;
    border-color: #eab308 !important;
    color: #111827 !important;
}

.btn-yellow:hover,
.btn-yellow:focus,
.btn-yellow:active {
    background: #ca8a04 !important;
    border-color: #ca8a04 !important;
    color: #111827 !important;
}

.btn-purple {
    background: #a855f7 !important;
    border-color: #a855f7 !important;
    color: #ffffff !important;
}

.btn-purple:hover,
.btn-purple:focus,
.btn-purple:active {
    background: #9333ea !important;
    border-color: #9333ea !important;
    color: #ffffff !important;
}

.btn-pink {
    background: #ec4899 !important;
    border-color: #ec4899 !important;
    color: #ffffff !important;
}

.btn-pink:hover,
.btn-pink:focus,
.btn-pink:active {
    background: #db2777 !important;
    border-color: #db2777 !important;
    color: #ffffff !important;
}

.btn-orange {
    background: #f97316 !important;
    border-color: #f97316 !important;
    color: #ffffff !important;
}

.btn-orange:hover,
.btn-orange:focus,
.btn-orange:active {
    background: #ea580c !important;
    border-color: #ea580c !important;
    color: #ffffff !important;
}

.btn-cyan {
    background: #06b6d4 !important;
    border-color: #06b6d4 !important;
    color: #ffffff !important;
}

.btn-cyan:hover,
.btn-cyan:focus,
.btn-cyan:active {
    background: #0891b2 !important;
    border-color: #0891b2 !important;
    color: #ffffff !important;
}

.table {
    --bs-table-bg: transparent;
    --bs-table-color: #0f172a;
}

.table-wrap {
    border: 1px solid #d7dbe2;
    border-radius: 6px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}

.table-toolbar .toolbar-left,
.table-toolbar .toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.table-chip {
    display: inline-flex;
    align-items: center;
    border: 1px solid #d3d7de;
    border-radius: 10px;
    background: #f8fafc;
    padding: 0.42rem 0.78rem;
    font-size: 0.9rem;
    color: #111827;
}

.table .checkbox-col {
    width: 34px;
}

.table .fake-check {
    width: 18px;
    height: 18px;
    border: 1px solid #cfd5dd;
    border-radius: 6px;
    background: #f8fafc;
    display: inline-block;
}

.table thead th {
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    color: #4b5563;
    border-bottom: 1px solid #d5dae1;
    background: #f8f9fb;
    font-weight: 600;
    padding: 0.85rem 0.9rem;
}

.table td {
    vertical-align: middle;
    border-color: #d9dde4;
    background: #ffffff;
    padding: 0.7rem 0.9rem;
}

.table-responsive {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.row-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.6rem;
    border: 1px solid #cfd4dc;
    border-radius: 6px;
    font-size: 0.84rem;
    color: #374151;
    background: #f3f4f6;
}

.status-draft {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #3730a3;
}

.status-submitted {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}

.status-under_review {
    background: #ecfeff;
    border-color: #a5f3fc;
    color: #155e75;
}

.status-approved {
    background: #ecfdf3;
    border-color: #86efac;
    color: #166534;
}

.status-rejected {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #991b1b;
}

.status-cancelled {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #374151;
}

.row-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #cfd5dd;
    background: #f8fafc;
    color: #111827;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: #eef2f7;
}

.timeline-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
    z-index: 1040;
}

.timeline-drawer-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.timeline-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(460px, 92vw);
    background: #ffffff;
    border-left: 1px solid #e5e7eb;
    box-shadow: -8px 0 30px rgba(15, 23, 42, 0.08);
    transform: translateX(100%);
    transition: transform .2s ease;
    z-index: 1050;
    display: flex;
    flex-direction: column;
}

.timeline-drawer.open {
    transform: translateX(0);
}

.timeline-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1rem 0.9rem;
    border-bottom: 1px solid #eceff3;
}

.timeline-drawer-head h3 {
    font-size: 1rem;
    font-weight: 700;
}

.timeline-drawer-body {
    padding: 1rem;
    overflow-y: auto;
}

.timeline-list {
    list-style: none;
    margin: 0;
    padding: 0 0 0 0.2rem;
    position: relative;
}

.timeline-list::before {
    content: "";
    position: absolute;
    left: 0.32rem;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #dbe1e8;
}

.timeline-item {
    position: relative;
    display: flex;
    gap: 0.7rem;
    padding: 0 0 1rem;
}

.timeline-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    margin-top: 0.25rem;
    background: #0f172a;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1px #d1d5db;
    position: relative;
    z-index: 2;
}

.timeline-content {
    flex: 1;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.5rem 0.65rem;
}

.timeline-action {
    font-weight: 600;
    font-size: 0.9rem;
    color: #0f172a;
}

.timeline-time {
    font-size: 0.78rem;
    color: #64748b;
}

.attention-tooltip {
    position: relative;
    cursor: help;
}

.attention-tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%) translateY(4px);
    background: #111827;
    color: #ffffff;
    font-size: 0.74rem;
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease, transform .15s ease;
    box-shadow: 0 8px 24px rgba(2, 8, 23, 0.2);
    z-index: 100;
}

.attention-tooltip::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: calc(100% + 4px);
    transform: translateX(-50%);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #111827;
    opacity: 0;
    transition: opacity .15s ease;
}

.attention-tooltip:hover::before,
.attention-tooltip:hover::after,
.attention-tooltip:focus-visible::before,
.attention-tooltip:focus-visible::after {
    opacity: 1;
}

.attention-tooltip:hover::before,
.attention-tooltip:focus-visible::before {
    transform: translateX(-50%) translateY(0);
}

.alert {
    border-radius: 10px;
}

code {
    color: #0f172a;
    background: #f1f5f9;
    padding: 0.12rem 0.35rem;
    border-radius: 6px;
}

.login-page {
    min-height: 100vh;
}

.login-page .card {
    margin-top: 5vh;
}
