:root {
    --brand-primary: #9f5c27;
    --brand-dark: #3e2a11;
    --brand-light: #fff;
    --brand-soft: #f6f1eb;
    --brand-border: #d8c7b6;
}

body {
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    padding-top: 74px;
}

.navbar,
.bg-dark {
    background-color: var(--brand-light) !important;
    border-bottom: 1px solid var(--brand-border);
    box-shadow: 0 4px 16px rgba(62, 42, 17, 0.12);
}

.navbar .navbar-brand,
.navbar .btn,
.navbar .dropdown-toggle {
    color: var(--brand-dark) !important;
}

.navbar .btn-outline-light {
    color: #3e2a11 !important;
    border-color: #9f5c27 !important;
    background-color: #fff !important;
}

.navbar .btn-outline-light:hover,
.navbar .btn-outline-light:focus {
    color: #fff !important;
    background-color: #9f5c27 !important;
    border-color: #9f5c27 !important;
}

.brand-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 10px;
    background-color: #fff;
    padding: 3px;
}

.brand-title {
    letter-spacing: 0.08em;
    font-weight: 700;
    color: var(--brand-dark);
}

.btn-primary {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
    border-radius: 10px;
    font-weight: 600;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--brand-dark);
    border-color: var(--brand-dark);
}

.btn-outline-primary {
    color: var(--brand-primary);
    border-color: var(--brand-primary);
    border-radius: 10px;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
    color: var(--brand-light);
}

.btn-outline-secondary {
    color: var(--brand-dark);
    border-color: var(--brand-border);
    border-radius: 10px;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    background-color: var(--brand-dark);
    border-color: var(--brand-dark);
    color: var(--brand-light);
}

.nav-link {
    color: var(--brand-dark);
    border-radius: 12px;
    padding: 0.62rem 0.85rem;
    transition: all 0.2s ease;
    font-weight: 500;
}

.nav-link:hover,
.nav-link:focus {
    color: var(--brand-primary);
    background-color: rgba(159, 92, 39, 0.08);
}

.nav-link.active {
    color: var(--brand-dark);
    background: rgba(159, 92, 39, 0.12);
    border: 1px solid var(--brand-border);
}

.nav-link i {
    font-size: 1rem;
    min-width: 1.1rem;
}

.card-header,
.table-dark,
thead th {
    background-color: var(--brand-dark);
    color: var(--brand-light);
}

.card {
    border: 1px solid var(--brand-border);
    border-radius: 16px;
    box-shadow: 0 8px 22px rgba(62, 42, 17, 0.08);
    background-color: var(--brand-light);
}

.card-header {
    border-top-left-radius: 16px !important;
    border-top-right-radius: 16px !important;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

a {
    color: var(--brand-primary);
}

a:hover,
a:focus {
    color: var(--brand-dark);
}

.badge.bg-danger,
.badge.text-bg-secondary {
    background-color: var(--brand-primary) !important;
    color: var(--brand-light) !important;
}

.table {
    border-radius: 12px;
    overflow: hidden;
}

.table > :not(caption) > * > * {
    border-bottom-color: #efe4d7;
    vertical-align: middle;
}

.sidebar-modern,
aside {
    background-color: var(--brand-light);
}

.app-shell-wrap {
    padding: 1.2rem;
}

.app-shell {
    background: var(--brand-light);
    border: 1px solid var(--brand-border);
    border-radius: 20px;
    overflow: visible;
    box-shadow: 0 16px 30px rgba(62, 42, 17, 0.14);
    min-height: calc(100vh - 104px);
}

.modern-sidebar {
    border-right: 1px solid var(--brand-border) !important;
    background: var(--brand-light) !important;
    position: fixed;
    top: 86px;
    left: 1.2rem;
    width: 260px;
    height: calc(100vh - 102px);
    overflow-y: auto;
    z-index: 1000;
}

main.col-md-10 {
    background: var(--brand-light);
    margin-left: 260px !important;
    width: calc(100% - 260px);
}

h2 {
    font-weight: 700;
    letter-spacing: -0.01em;
}

.text-muted {
    color: var(--brand-primary) !important;
}

.metric-card {
    border-color: var(--brand-border);
    box-shadow: 0 6px 14px rgba(62, 42, 17, 0.07);
}

.metric-card .card-body {
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
}

.metric-card h4 {
    font-weight: 700;
    font-size: 1.4rem;
}

.form-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--brand-primary);
}

.form-control,
.form-select {
    border: 1px solid var(--brand-border);
    border-radius: 10px;
    padding-top: 0.52rem;
    padding-bottom: 0.52rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 0.2rem rgba(159, 92, 39, 0.2);
}

.table thead th {
    background: #f4ede5;
    color: var(--brand-dark);
    border-bottom: 1px solid var(--brand-border);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sidebar-caption {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--brand-primary);
    font-weight: 700;
    margin-bottom: 0.7rem;
    padding: 0 0.35rem;
}

.contracts-actions .contract-action-btn {
    background-color: #fff !important;
    border: 1px solid #3e2a11 !important;
    color: #3e2a11 !important;
    border-radius: 10px;
    font-weight: 600;
}

.contracts-actions .contract-action-btn:hover,
.contracts-actions .contract-action-btn:focus {
    background-color: #3e2a11 !important;
    border-color: #3e2a11 !important;
    color: #fff !important;
}

.contracts-actions .contract-action-btn-outline {
    border: 1px solid #3e2a11 !important;
    color: #3e2a11 !important;
    background: #fff !important;
    border-radius: 10px;
    font-weight: 500;
}

.contracts-actions .contract-action-btn-outline:hover,
.contracts-actions .contract-action-btn-outline:focus {
    background-color: #3e2a11 !important;
    border-color: #3e2a11 !important;
    color: #fff !important;
}

.login-page {
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
    padding-top: 0;
    background: #3e2a11 !important;
}

@media (max-width: 991px) {
    .app-shell-wrap {
        padding: 0.65rem;
    }
    .app-shell {
        border-radius: 14px;
    }
    .modern-sidebar {
        position: static;
        left: auto;
        width: auto;
        top: auto;
        height: auto;
        overflow: visible;
    }
    main.col-md-10 {
        margin-left: 0 !important;
        width: auto;
    }
}

.login-card {
    border-radius: 18px;
}

.login-brand-panel {
    background: linear-gradient(150deg, var(--brand-dark) 0%, #604018 100%);
}

.login-logo {
    width: 180px;
    max-width: 100%;
    background-color: #fff;
    border-radius: 14px;
    padding: 10px;
}

.modern-form p {
    margin-bottom: 1rem;
}

.login-card .card-body {
    padding-top: 2rem !important;
}

.modern-form input {
    width: 100%;
    border: 1px solid var(--brand-border);
    border-radius: 10px;
    padding: 0.6rem 0.75rem;
    outline: none;
}

.modern-form input:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 0.2rem rgba(159, 92, 39, 0.2);
}

.roles-modal-grid ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
}

.roles-modal-grid li {
    background: var(--brand-light);
    border: 1px solid var(--brand-border);
    border-radius: 12px;
    padding: 0.75rem;
    transition: all 0.2s ease;
    position: relative;
}

.roles-modal-grid li:has(input:checked) {
    border-color: var(--brand-primary);
    background: rgba(159, 92, 39, 0.08);
    box-shadow: 0 8px 18px rgba(159, 92, 39, 0.12);
}

.roles-modal-grid input[type="checkbox"] {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    margin: 0;
}

.roles-modal-grid label {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    cursor: pointer;
    margin: 0;
}

.roles-modal-grid .role-icon {
    font-size: 1.1rem;
    color: var(--brand-primary);
}

.roles-modal-grid .role-title {
    font-weight: 700;
    color: #3d2f21;
}

.roles-modal-grid .role-help {
    color: var(--brand-primary);
    font-size: 0.76rem;
}

.modal-content {
    border-radius: 16px;
    border: 1px solid var(--brand-border);
}

.account-status-tile {
    border: 1px solid var(--brand-border);
    border-radius: 12px;
    background: var(--brand-light);
    padding: 0.8rem 1rem;
}

.roles-permission-table {
    border: 1px solid var(--brand-border);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

.roles-header {
    background: #f4ede5;
    color: var(--brand-dark);
    border-bottom: 1px solid var(--brand-border);
    font-size: 0.84rem;
    padding: 0.55rem 0.75rem;
}

.roles-body .roles-row {
    border-bottom: 1px solid #efe4d7;
    padding: 0.62rem 0.75rem;
}

.roles-body .roles-row:last-child {
    border-bottom: none;
}

.roles-col-feature {
    width: 58%;
}

.roles-col-check {
    width: 10%;
}

.roles-col-all {
    width: 12%;
}

.role-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9f5c27;
}

.role-check {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    accent-color: #9f5c27;
<<<<<<< HEAD
=======
    background-color: #fff;
    border: 2px solid #9f5c27;
    display: inline-block;
    vertical-align: middle;
    appearance: auto !important;
    -webkit-appearance: auto !important;
}

.role-check:checked {
    background-color: rgba(159, 92, 39, 0.15);
}

.roles-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.role-card-option {
    position: relative;
}

.role-card-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.role-card {
    display: block;
    padding: 1rem;
    border: 1px solid var(--brand-border);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(62, 42, 17, 0.06);
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    user-select: none;
    min-height: 92px;
}

.role-card:hover {
    border-color: var(--brand-primary);
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(62, 42, 17, 0.10);
}

.role-card-icon {
    font-size: 1.15rem;
    color: var(--brand-primary);
}

.role-card-desc {
    margin-top: 0.45rem;
    font-size: 0.86rem;
    color: #3d2f21;
}

/* When selected, emphasize the card */
.role-card-input:checked + .role-card {
    border-color: var(--brand-primary);
    box-shadow: 0 18px 44px rgba(159, 92, 39, 0.18);
    background: rgba(159, 92, 39, 0.06);
>>>>>>> 268284363fca3dea345f7e2d259d9c1c3ed126ec
}

.btn-role-all {
    background: #f4ede5;
    border: 1px solid #e6d9ca;
    color: #8c6135;
    border-radius: 8px;
    font-size: 0.75rem;
    padding: 0.2rem 0.45rem;
}

@media (max-width: 767px) {
    .roles-modal-grid ul {
        grid-template-columns: 1fr;
    }
<<<<<<< HEAD
=======
    .roles-card-grid {
        grid-template-columns: 1fr;
    }
>>>>>>> 268284363fca3dea345f7e2d259d9c1c3ed126ec
    .roles-col-feature {
        width: 45%;
    }
    .roles-col-check {
        width: 14%;
    }
    .roles-col-all {
        width: 13%;
    }
}

/* Brand lock: enforce palette across all pages */
body {
    background: #fff !important;
    color: #3e2a11 !important;
}

.navbar,
.bg-dark,
.card-header,
.table thead th {
    background: #3e2a11 !important;
    color: #fff !important;
}

.app-shell,
.card,
.modern-sidebar,
main.col-md-10,
aside {
    background: #fff !important;
    border-color: #9f5c27 !important;
}

.nav-link,
.brand-title,
.sidebar-caption,
.text-muted {
    color: #3e2a11 !important;
}

.nav-link:hover,
.nav-link:focus,
.nav-link.active {
    background: rgba(159, 92, 39, 0.12) !important;
    color: #3e2a11 !important;
}

.btn-primary,
.btn-success,
.btn-danger {
    background: #9f5c27 !important;
    border-color: #9f5c27 !important;
    color: #fff !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-success:hover,
.btn-success:focus,
.btn-danger:hover,
.btn-danger:focus {
    background: #3e2a11 !important;
    border-color: #3e2a11 !important;
    color: #fff !important;
}

.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-danger {
    color: #9f5c27 !important;
    border-color: #9f5c27 !important;
    background: #fff !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-danger:hover,
.btn-outline-danger:focus {
    color: #fff !important;
    background: #9f5c27 !important;
    border-color: #9f5c27 !important;
}

.badge,
.badge.bg-danger,
.badge.bg-success,
.badge.text-bg-secondary {
    background: #9f5c27 !important;
    color: #fff !important;
}

.form-control,
.form-select,
.modal-content,
.roles-permission-table,
.account-status-tile {
    border-color: #9f5c27 !important;
}

.form-control:focus,
.form-select:focus {
    border-color: #9f5c27 !important;
    box-shadow: 0 0 0 0.2rem rgba(159, 92, 39, 0.2) !important;
}

a {
    color: #9f5c27 !important;
}

a:hover,
a:focus {
    color: #3e2a11 !important;
}

.contract-form-wrap {
    max-width: 860px;
    margin: 0 auto;
    padding: 0.25rem 0 1.2rem;
}

.contract-form-card {
    border-radius: 18px !important;
    box-shadow: 0 16px 32px rgba(62, 42, 11, 0.14) !important;
}

.contract-form-card .card-body {
    padding: 1.25rem 1.4rem;
}

.collaboration-page-header {
    padding-top: 0.4rem;
    padding-bottom: 0.2rem;
}

.collaboration-page-grid .card {
    border-radius: 18px !important;
}

.collaboration-form-card .card-body {
    padding: 1.4rem 1.35rem !important;
}

.collaboration-form-card .modern-form p {
    margin-bottom: 1.15rem;
}

.collaboration-form-card .modern-form select,
.collaboration-form-card .modern-form input {
    width: 100%;
    min-height: 44px;
    border-radius: 12px;
    border: 1px solid #9f5c27 !important;
    background: #fff;
    padding: 0.6rem 0.75rem;
}

.collaboration-form-card .modern-form select:focus,
.collaboration-form-card .modern-form input:focus {
    border-color: #9f5c27 !important;
    box-shadow: 0 0 0 0.2rem rgba(159, 92, 39, 0.2) !important;
}

.collaboration-table-card .card-body {
    padding-top: 0.95rem !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

.collaboration-table-card table {
    margin-top: 0.4rem;
}
