/*
|--------------------------------------------------------------------------
| Application Base
|--------------------------------------------------------------------------
*/

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    background: #f5f6f8;

    color: #212529;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    font-size: 14px;
}


/*
|--------------------------------------------------------------------------
| Application Wrapper
|--------------------------------------------------------------------------
*/

.app-wrapper {
    display: flex;

    min-height: 100vh;

    width: 100%;
}


/*
|--------------------------------------------------------------------------
| Sidebar
|--------------------------------------------------------------------------
*/

.app-sidebar {
    width: 250px;

    min-height: 100vh;

    background: #212529;

    color: #ffffff;

    position: fixed;

    top: 0;
    left: 0;
    bottom: 0;

    z-index: 1000;

    overflow-y: auto;

    transition:
        width 0.2s ease,
        transform 0.2s ease;
}


/*
|--------------------------------------------------------------------------
| Sidebar Brand
|--------------------------------------------------------------------------
*/

.sidebar-brand {
    height: 65px;

    display: flex;

    align-items: center;

    padding: 0 20px;

    border-bottom:
        1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand-link {
    color: #ffffff;

    text-decoration: none;

    font-size: 18px;

    font-weight: 600;
}


/*
|--------------------------------------------------------------------------
| Sidebar Navigation
|--------------------------------------------------------------------------
*/

.sidebar-navigation {
    padding: 15px 10px;
}


/*
|--------------------------------------------------------------------------
| Sidebar Section
|--------------------------------------------------------------------------
*/

.sidebar-section-title {
    padding: 15px 10px 7px;

    color: #adb5bd;

    font-size: 11px;

    font-weight: 600;

    text-transform: uppercase;

    letter-spacing: 0.6px;
}


/*
|--------------------------------------------------------------------------
| Sidebar Menu Item
|--------------------------------------------------------------------------
*/

.sidebar-menu-item {
    display: flex;

    align-items: center;

    gap: 10px;

    width: 100%;

    padding: 10px 12px;

    margin-bottom: 3px;

    border-radius: 5px;

    color: #dee2e6;

    text-decoration: none;

    transition:
        background-color 0.15s ease,
        color 0.15s ease;
}

.sidebar-menu-item:hover {
    background: rgba(255, 255, 255, 0.08);

    color: #ffffff;
}

.sidebar-menu-item.active {
    background: #198754;

    color: #ffffff;
}


/*
|--------------------------------------------------------------------------
| Menu Icon
|--------------------------------------------------------------------------
*/

.menu-icon {
    width: 22px;

    min-width: 22px;

    text-align: center;

    font-size: 15px;
}

.menu-text {
    line-height: 1.4;
}


/*
|--------------------------------------------------------------------------
| Main Area
|--------------------------------------------------------------------------
*/

.app-main {
    width: calc(100% - 250px);

    min-height: 100vh;

    margin-left: 250px;

    display: flex;

    flex-direction: column;
}


/*
|--------------------------------------------------------------------------
| Application Header
|--------------------------------------------------------------------------
*/

.app-header {
    height: 65px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding: 0 25px;

    background: #ffffff;

    border-bottom:
        1px solid #dee2e6;

    position: sticky;

    top: 0;

    z-index: 900;
}


/*
|--------------------------------------------------------------------------
| Header Left
|--------------------------------------------------------------------------
*/

.app-header-left {
    display: flex;

    align-items: center;

    gap: 15px;
}


/*
|--------------------------------------------------------------------------
| Header Title
|--------------------------------------------------------------------------
*/

.app-header-title {
    font-size: 18px;

    font-weight: 600;
}


/*
|--------------------------------------------------------------------------
| Sidebar Toggle
|--------------------------------------------------------------------------
*/

.sidebar-toggle {
    display: none;

    width: 38px;

    height: 38px;

    padding: 0;

    border: 1px solid #dee2e6;

    border-radius: 5px;

    background: #ffffff;

    color: #212529;

    cursor: pointer;

    font-size: 18px;
}

.sidebar-toggle:hover {
    background: #f8f9fa;
}


/*
|--------------------------------------------------------------------------
| Page Content
|--------------------------------------------------------------------------
*/

.app-content {
    flex: 1;

    width: 100%;

    padding: 30px;
}


/*
|--------------------------------------------------------------------------
| Page Header
|--------------------------------------------------------------------------
*/

.page-header {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

    margin-bottom: 25px;
}

.page-header h1,
.page-header h2,
.page-header h3 {
    margin-top: 0;
}

.page-header h2 {
    margin-bottom: 5px;

    font-size: 24px;

    font-weight: 600;
}


/*
|--------------------------------------------------------------------------
| Text Helpers
|--------------------------------------------------------------------------
*/

.text-muted {
    color: #6c757d;
}


/*
|--------------------------------------------------------------------------
| Empty State
|--------------------------------------------------------------------------
*/

.empty-state {
    padding: 50px 20px;

    text-align: center;

    color: #6c757d;

    background: #ffffff;

    border:
        1px dashed #ced4da;

    border-radius: 8px;
}

.empty-state p {
    margin-bottom: 20px;
}


/*
|--------------------------------------------------------------------------
| Cards
|--------------------------------------------------------------------------
*/

.card {
    border:
        1px solid #dee2e6;

    border-radius: 8px;

    background: #ffffff;

    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.04);
}

.card-body {
    padding: 20px;
}


/*
|--------------------------------------------------------------------------
| Tables
|--------------------------------------------------------------------------
*/

.table-responsive {
    width: 100%;

    overflow-x: auto;
}

.table {
    width: 100%;

    margin-bottom: 0;

    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 14px;

    vertical-align: middle;

    border-bottom:
        1px solid #dee2e6;
}

.table th {
    background: #f8f9fa;

    font-weight: 600;

    white-space: nowrap;
}

.table tbody tr:hover {
    background: #f8f9fa;
}


/*
|--------------------------------------------------------------------------
| Buttons
|--------------------------------------------------------------------------
*/

.btn {
    display: inline-block;

    padding: 9px 16px;

    border: 1px solid transparent;

    border-radius: 5px;

    font-size: 14px;

    line-height: 1.5;

    text-decoration: none;

    cursor: pointer;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease;
}

.btn-success {
    background: #198754;

    border-color: #198754;

    color: #ffffff;
}

.btn-success:hover {
    background: #157347;

    border-color: #146c43;

    color: #ffffff;
}

.btn-primary {
    background: #0d6efd;

    border-color: #0d6efd;

    color: #ffffff;
}

.btn-primary:hover {
    background: #0b5ed7;

    border-color: #0a58ca;

    color: #ffffff;
}

.btn-warning {
    background: #ffc107;

    border-color: #ffc107;

    color: #212529;
}

.btn-warning:hover {
    background: #ffca2c;

    border-color: #ffc720;

    color: #212529;
}

.btn-secondary {
    background: #6c757d;

    border-color: #6c757d;

    color: #ffffff;
}

.btn-secondary:hover {
    background: #5c636a;

    border-color: #565e64;

    color: #ffffff;
}


/*
|--------------------------------------------------------------------------
| Small Buttons
|--------------------------------------------------------------------------
*/

.btn-sm {
    padding: 6px 10px;

    font-size: 13px;
}


/*
|--------------------------------------------------------------------------
| Button Group
|--------------------------------------------------------------------------
*/

.btn-group {
    display: inline-flex;

    align-items: center;

    gap: 5px;
}


/*
|--------------------------------------------------------------------------
| Footer
|--------------------------------------------------------------------------
*/

.app-footer {
    background: #ffffff;

    border-top:
        1px solid #dee2e6;

    padding: 15px 25px;
}

.app-footer-content {
    color: #6c757d;

    font-size: 13px;

    text-align: center;
}


/*
|--------------------------------------------------------------------------
| Signature Grid
|--------------------------------------------------------------------------
*/

.signature-grid {
    display: grid;

    grid-template-columns:
        repeat(auto-fill,
            minmax(280px, 1fr));

    gap: 20px;
}


/*
|--------------------------------------------------------------------------
| Signature Card
|--------------------------------------------------------------------------
*/

.signature-card {
    overflow: hidden;

    background: #ffffff;

    border:
        1px solid #dee2e6;

    border-radius: 8px;
}


/*
|--------------------------------------------------------------------------
| Signature Preview
|--------------------------------------------------------------------------
*/

.signature-preview {
    height: 180px;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 20px;

    background:
        repeating-conic-gradient(#f8f9fa 0% 25%,
            #ffffff 0% 50%) 50% / 20px 20px;

    border-bottom:
        1px solid #dee2e6;
}

.signature-preview img {
    max-width: 100%;

    max-height: 140px;

    object-fit: contain;
}


/*
|--------------------------------------------------------------------------
| Signature Information
|--------------------------------------------------------------------------
*/

.signature-info {
    padding: 15px;
}

.signature-name {
    margin: 0 0 8px;

    font-size: 17px;

    font-weight: 600;
}

.signature-file {
    margin: 0;

    color: #6c757d;

    font-size: 13px;

    word-break: break-word;
}

/*
|--------------------------------------------------------------------------
| Form Validation
|--------------------------------------------------------------------------
*/

.required {
    color: #dc3545;
}

.form-control.is-invalid {
    border-color: #dc3545;
}

.form-control.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.15);
}

.invalid-feedback {
    display: block;
    margin-top: 6px;
    color: #dc3545;
    font-size: 13px;
}

.editor-error {
    margin-top: 8px;
}


/*
|--------------------------------------------------------------------------
| Alert
|--------------------------------------------------------------------------
*/

.alert {
    padding: 12px 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    font-size: 14px;
}

.alert-danger {
    color: #842029;
    background: #f8d7da;
    border: 1px solid #f5c2c7;
}


/*
|--------------------------------------------------------------------------
| Responsive
|--------------------------------------------------------------------------
*/

@media (max-width: 991px) {

    .app-sidebar {
        transform: translateX(-100%);
    }

    .app-sidebar.show {
        transform: translateX(0);
    }

    .app-main {
        width: 100%;

        margin-left: 0;
    }

    .sidebar-toggle {
        display: inline-flex;

        align-items: center;

        justify-content: center;
    }

    .app-content {
        padding: 20px;
    }

}


@media (max-width: 768px) {

    .page-header {
        flex-direction: column;

        align-items: flex-start;
    }

    .signature-grid {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 576px) {

    .app-header {
        padding: 0 15px;
    }

    .app-content {
        padding: 15px;
    }

    .page-header h2 {
        font-size: 21px;
    }

    .btn-group {
        flex-wrap: wrap;
    }

}