/**
 * SymoTech Angkutan - Clean, Sharp & Squared Design (Left Sidebar Layout)
 */

:root {
    --bs-font-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Enforce 100% sharp squared corners across all UI components */
*,
*::before,
*::after,
.card,
.card-header,
.card-body,
.card-footer,
.btn,
.form-control,
.form-select,
.input-group,
.input-group-text,
.table,
.table-responsive,
.badge,
.alert,
.modal,
.modal-content,
.modal-header,
.modal-footer,
.dropdown-menu,
.nav-link,
.navbar,
.pagination,
.page-item,
.page-link,
#sidebar,
#top-header,
.sidebar-link {
    border-radius: 0 !important;
}

body {
    background-color: #f4f6f8;
    color: #1f2937;
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0;
    padding: 0;
}

/* App Layout Structure */
#app-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Left Sidebar */
#sidebar {
    width: 240px;
    min-width: 240px;
    background-color: #0f172a;
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #1e293b;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.2s ease-in-out;
}

.sidebar-brand {
    padding: 1rem 1.25rem;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    color: #ffffff;
    border-bottom: 1px solid #1e293b;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
}

.sidebar-brand:hover {
    color: #ffffff;
}

.sidebar-user {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid #1e293b;
    background-color: rgba(255, 255, 255, 0.02);
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.sidebar-user-name {
    font-weight: 600;
    font-size: 0.835rem;
    color: #f1f5f9;
}

.sidebar-user-role {
    font-size: 0.72rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    list-style: none;
    padding: 0.65rem 0;
    margin: 0;
    flex-grow: 1;
}

.sidebar-item {
    margin-bottom: 0.15rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1.25rem;
    color: #94a3b8;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    border-left: 3px solid transparent;
    transition: all 0.15s ease-in-out;
}

.sidebar-link:hover {
    color: #ffffff;
    background-color: #1e293b;
    border-left-color: #64748b;
}

.sidebar-link.active {
    color: #ffffff;
    background-color: #1e293b;
    border-left-color: #2563eb;
    font-weight: 600;
}

.sidebar-footer {
    padding: 0.85rem 1.25rem;
    border-top: 1px solid #1e293b;
}

.btn-sidebar-logout {
    background-color: #dc2626 !important;
    border: 1px solid #b91c1c !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px;
}

.btn-sidebar-logout:hover {
    background-color: #b91c1c !important;
    border-color: #991b1b !important;
    color: #ffffff !important;
}

/* Main Content Area */
#main-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background-color: #f4f6f8;
}

#top-header {
    background-color: #ffffff;
    border-bottom: 1px solid #d1d5db;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.page-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

#content-area {
    padding: 1.25rem 1.5rem;
    flex-grow: 1;
}

/* Cards */
.card {
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    box-shadow: none;
    margin-bottom: 1.25rem;
}

.card-header {
    background-color: #f8fafc;
    border-bottom: 1px solid #d1d5db;
    font-weight: 600;
    font-size: 0.9rem;
    color: #0f172a;
    padding: 0.65rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: 1rem;
}

/* Tables */
.table {
    margin-bottom: 0;
    border-collapse: collapse;
}

.table th {
    background-color: #f1f5f9;
    color: #334155;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border: 1px solid #cbd5e1;
    padding: 0.55rem 0.65rem;
    vertical-align: middle;
}

.table td {
    border: 1px solid #e2e8f0;
    padding: 0.5rem 0.65rem;
    vertical-align: middle;
    font-size: 0.835rem;
}

.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

/* Forms */
.form-label {
    font-weight: 600;
    font-size: 0.8rem;
    color: #374151;
    margin-bottom: 0.25rem;
}

.form-control, .form-select {
    border: 1px solid #9ca3af;
    background-color: #ffffff;
    font-size: 0.85rem;
    padding: 0.35rem 0.6rem;
    color: #111827;
}

.form-control:focus, .form-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb;
    outline: none;
}

.form-control[readonly] {
    background-color: #f3f4f6;
    color: #1f2937;
    font-weight: 600;
}

/* Buttons */
.btn {
    font-size: 0.835rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.btn-primary {
    background-color: #2563eb;
    border-color: #1d4ed8;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #1d4ed8;
    border-color: #1e40af;
}

.btn-danger {
    background-color: #dc2626;
    border-color: #b91c1c;
    color: #ffffff;
}

.btn-danger:hover {
    background-color: #b91c1c;
    border-color: #991b1b;
}

.btn-sm {
    padding: 0.2rem 0.5rem;
    font-size: 0.78rem;
}

/* Badges */
.badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25em 0.5em;
    border: 1px solid #cbd5e1;
}

/* Numeric & Monospace */
.font-num {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Icon utilities */
.icon-svg {
    display: inline-block;
    vertical-align: middle;
    width: 14px;
    height: 14px;
}

/* Footer */
footer {
    background-color: #ffffff;
    border-top: 1px solid #d1d5db;
    color: #64748b;
    font-size: 0.8rem;
    padding: 0.75rem 1.5rem;
    text-align: center;
}

/* Mobile Sidebar Behavior */
@media (max-width: 991.98px) {
    #sidebar {
        position: fixed;
        left: -240px;
        top: 0;
        bottom: 0;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.3);
    }
    #sidebar.show {
        left: 0;
    }
    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    .sidebar-backdrop.show {
        display: block;
    }
    #content-area {
        padding: 1rem;
    }
    #top-header {
        padding: 0.65rem 1rem;
    }
}
