/* =========================================================
   eClearance System — Custom Styles
   ========================================================= */

/* ----- Layout ----- */
body {
    background-color: #f0f2f5;
    overflow-x: hidden;
}

#wrapper {
    min-height: 100vh;
}

/* ----- Sidebar ----- */
#sidebar {
    width: 260px;
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    overflow-y: auto;
    transition: width 0.25s ease;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
}

#sidebar .sidebar-brand {
    display: flex;
    align-items: center;
    padding: 1.25rem 1rem;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-decoration: none;
}

#sidebar .nav-link {
    color: rgba(255,255,255,0.75);
    border-radius: 6px;
    margin-bottom: 2px;
    padding: 0.6rem 0.9rem;
    font-size: 0.875rem;
    transition: all 0.15s ease;
}

#sidebar .nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

#sidebar .nav-link.active {
    color: #fff;
    background: rgba(99,102,241,0.7);
}

#sidebar.collapsed {
    width: 64px;
}

#sidebar.collapsed .sidebar-brand span,
#sidebar.collapsed .nav-link span,
#sidebar.collapsed .sidebar-user-name,
#sidebar.collapsed .x-small {
    display: none;
}

/* ----- Page Content ----- */
#page-content {
    margin-left: 260px;
    min-height: 100vh;
    transition: margin-left 0.25s ease;
    display: flex;
    flex-direction: column;
}

#page-content .container-fluid {
    flex: 1;
}

body.sidebar-collapsed #sidebar {
    width: 64px;
}
body.sidebar-collapsed #page-content {
    margin-left: 64px;
}

/* ----- Cards ----- */
.card {
    border: none;
    border-radius: 10px;
}

.card-header {
    border-radius: 10px 10px 0 0 !important;
    border-bottom: 1px solid rgba(0,0,0,.07);
}

/* ----- DataTables ----- */
.dataTables_wrapper .dataTables_filter input {
    border-radius: 20px;
    padding-left: 12px;
}

table.dataTable thead th {
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ----- Clearance Stamps ----- */
.clearance-document {
    max-width: 900px;
    font-size: 0.9rem;
}

.signing-box {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px;
    min-height: 130px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.signing-box.signed {
    border-color: #198754;
    background: rgba(25,135,84,0.03);
}

.signing-box.unsigned {
    border-color: #dee2e6;
    background: #fafafa;
}

.signing-role {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    margin-bottom: 8px;
}

.stamp-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Stamp design */
.clearance-stamp {
    display: inline-block;
    padding: 8px 14px;
    border: 3px solid;
    border-radius: 4px;
    text-align: center;
    transform: rotate(-5deg);
    font-family: 'Courier New', 'Courier', monospace;
    line-height: 1.3;
    user-select: none;
}

.clearance-stamp.signed {
    border-color: #198754;
    color: #198754;
    background: rgba(25,135,84,0.06);
    box-shadow: 0 0 0 1px rgba(25,135,84,0.2);
}

.clearance-stamp.unsigned {
    border-color: #adb5bd;
    color: #adb5bd;
    border-style: dashed;
}

.stamp-signed-text {
    font-size: 1.1rem;
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.stamp-pending-text {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.stamp-divider {
    border-top: 2px solid currentColor;
    margin: 4px 0;
    opacity: 0.6;
}

.stamp-name {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stamp-onbehalf {
    font-size: 0.6rem;
    font-style: italic;
    opacity: 0.8;
}

.stamp-date {
    font-size: 0.65rem;
    margin-top: 2px;
    opacity: 0.85;
}

/* ----- Big cleared stamp ----- */
.big-cleared-stamp {
    font-size: 2rem;
    font-weight: 900;
    color: #198754;
    border: 5px solid #198754;
    border-radius: 8px;
    padding: 12px 20px;
    transform: rotate(-8deg);
    letter-spacing: 4px;
    font-family: 'Courier New', monospace;
    background: rgba(25,135,84,0.06);
    text-shadow: 1px 1px 0 rgba(25,135,84,0.2);
}

.status-badge-large {
    font-size: 1.1rem;
    font-weight: 700;
    border: 3px solid;
    border-radius: 8px;
    padding: 10px 16px;
    text-align: center;
    transform: rotate(-5deg);
    font-family: 'Courier New', monospace;
}

/* ----- Print styles ----- */
@media print {
    #sidebar, #sidebarToggle, .no-print, .btn, .navbar, .alert,
    .dataTables_filter, .dataTables_length, .dataTables_paginate,
    .dataTables_info, .dt-buttons {
        display: none !important;
    }

    #page-content {
        margin-left: 0 !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
    }

    .clearance-document {
        max-width: 100%;
    }

    body {
        background: white;
    }
}

/* ----- Responsive ----- */
@media (max-width: 768px) {
    #sidebar {
        position: fixed;
        left: -260px;
        z-index: 1050;
    }

    #sidebar.mobile-open {
        left: 0;
        box-shadow: 4px 0 20px rgba(0,0,0,0.3);
    }

    #page-content {
        margin-left: 0;
    }

    #overlay {
        display: none;
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1040;
    }

    #overlay.show {
        display: block;
    }
}

/* ----- Utilities ----- */
.x-small { font-size: 0.7rem; }
code { font-size: 0.8rem; color: #6f42c1; background: #f8f9fa; padding: 2px 5px; border-radius: 3px; }
