/* Admin Styles */

.tefw-admin-box {
    margin-top: 20px;
    padding: 10px 20px 50px 20px;
    border: 1px solid #e3e7ee;
    border-radius: 10px;
    background-color: #fff;
    box-shadow: 0 6px 18px rgba(18, 38, 63, 0.06);
}
.tax-exemption-settings .nav-tab-wrapper {
    padding-top: 12px;
    border-bottom: 1px solid #e6e9ee;
    gap: 8px;
}
.tax-exemption-settings .nav-tab {
    margin-right: 10px;
    font-size: 15px;
    padding: 8px 14px;
    border-radius: 8px 8px 0 0;
    background: #f6f8fb;
    border-color: #e1e5ea;
}
.tax-exemption-settings .nav-tab.nav-tab-active {
    background-color: #ffffff;
    border-color: #e1e5ea #e1e5ea #ffffff;
    color: #1d2327;
    font-weight: bold;
    box-shadow: 0 -2px 0 #2271b1 inset;
}
.tax-exemption-settings .tab-panel {
    display: none;
    padding-top: 10px;
}
.tax-exemption-settings .tab-panel.active {
    display: block;
}

.tax-exemption-settings .form-table td {
    padding: 18px 20px;
}
.tax-exemption-settings #custom-fields .form-table td {
    padding: 0px 10px 0px 0px;
}
.tax-exemption-settings .tax-exemption-custom-fields-table-labels {
    font-weight: bold;
}

.tax-exemption-settings {
    padding: 24px;
    width: calc(100% - 500px);
    float: left;
    background: #ffffff;
    border: 1px solid #e3e7ee;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(18, 38, 63, 0.06);
}

.tax-exemption-settings #submit {
    font-size: 14px;
    padding: 5px 20px;
}

@media (max-width: 1182px) {
    .tax-exemption-settings {
        width: calc(100% - 10px); float: none;
    }
}
.tax-exemption-settings-sidebar {
    width: 380px; float: right; margin: 20px;
}
@media (max-width: 1182px) {
    .tax-exemption-settings-sidebar {
        width: calc(100% - 10px); float: none; margin: 0;
    }
}
.tax-exemption-settings-sidebar-box {
    padding: 14px 20px;
    background-color: #fff;
    border: 1px solid #e3e7ee;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(18, 38, 63, 0.06);
}
@media (max-width: 782px) {
    .tax-exemption-settings-sidebar-box {
        padding: 10px; background-color: #fff; border: 1px solid #ddd;
    }
}

.tax-exemption-certificate-enabled td, .tax-exemption-approval-enabled td, .tax-exemption-approval-message td {
    padding-left: 40px;
}

.tax-exemption-settings i {
    color: #6a7b88;
}

.tax-exemption-settings input[type="checkbox"] {
    margin-right: 5px;
    transform: scale(1.25);
}

span.tefw-pro-badge {
    background: green;
    color: #fff;
    position: absolute;
    margin-top: -11px;
    margin-left: -9px;
    border-radius: 20px;
    font-size: 8px;
    padding: 1px 5px;
}

a.tefw-upgrade-button {
    background-color: #0e753e !important;
    color: #fff !important;
    border-radius: 999px !important;
    padding: 6px 16px !important;
    box-shadow: 0 6px 14px rgba(14, 117, 62, 0.25);
}

/* Orders Table */

#tefw_exempt_orders_table {
    width: 100%;
    overflow-x: auto; /* Enables horizontal scrolling if table exceeds container width */
}

#tefw_exempt_orders_table table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

#tefw_exempt_orders_table th {
    background-color: #f1f1f1;
    color: #333;
    padding: 20px 5px;
    text-align: left;
}

#tefw_exempt_orders_table tr {
    border-bottom: 1px solid #ccc;
    text-align: center;
}

#tefw_exempt_orders_table tr:hover {
    background-color: #eaf0f1;
}

#tefw_exempt_orders_table table td {
    padding: 20px 10px !important;
    text-align: left;
    width: 100px;
}

/* Users Table */

#tefw_exempt_users_table {
    width: 100%;
    overflow-x: auto; /* Enables horizontal scrolling if table exceeds container width */
}

#tefw_exempt_users_table table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}
#tefw_exempt_users_table th {
    background-color: #f1f1f1;
    color: #333;
    border: 1px solid #ccc;
    padding: 20px 10px;
    text-align: left;
}
#tefw_exempt_users_table tr {
    border: 1px solid #ccc;
    text-align: center;
}
#tefw_exempt_users_table tr:hover {
    background-color: #eaf0f1;
}
#tefw_exempt_users_table td {
    border: 1px solid #ccc;
    padding: 20px 10px;
    text-align: left;
    width: 100px;
}
#tefw_exempt_users_table th.tefw-col-actions, #tefw_exempt_users_table td.tefw-col-actions {
    text-align: center !important;
}

#tefw-pagination {
    margin-top: 15px;
}
.tefw-page-btn {
    padding: 8px 16px;
    margin-right: 5px;
    cursor: pointer;
    background-color: #f1f1f1;
    border: 1px solid #ccc;
    transition: background-color 0.3s;
}
.tefw-page-btn:hover {
    background-color: #ddd;
}

td.tefw_exempt_status {
    overflow: hidden;
}

/* Add New Exempt Form */
.new-exempt-form-wrapper {
    border: 1px solid #e3e7ee;
    border-radius: 12px;
    padding: 0 20px 20px 20px;
    margin-top: 20px;
    margin-bottom: 20px;
    background-color: #fbfcfe;
    max-width: 750px;
}

.new-exempt-form {
    display: flex;
    flex-direction: column;
}

.tefw-form-field {
    margin-bottom: 16px;
}
.tefw-form-field.submit-field {
    margin-bottom: 0;
}
.tefw-form-field label {
    display: inline-block;
    font-weight: bold;
}
.tefw-form-field .woocommerce-form-row {
    margin-top: 0;
    margin-bottom: 0;
}

.tefw-submit-button {
    background-color: #2271b1;
    border: none;
    color: white;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    cursor: pointer;
    border-radius: 8px;
    box-shadow: 0 6px 14px rgba(34, 113, 177, 0.25);
}

.tefw-submit-button:hover {
    background-color: #1b5f96;
}

.tefw-form-field input[type="text"], .tax-exemption-settings input[type="text"], .tax-exemption-settings input[type="number"], .tax-exemption-settings input[type="email"], .tax-exemption-settings input[type="password"], .tax-exemption-settings select, .tax-exemption-settings textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
}
#tefw_search_field {
    width: auto;
    padding: 8px;
    border: 1px solid #d6dbe3;
    border-radius: 8px;
    box-sizing: border-box;
    background: #fff;
}
#tefw_search_field:focus,
.tefw-form-field input[type="text"]:focus,
.tax-exemption-settings input[type="text"]:focus,
.tax-exemption-settings input[type="number"]:focus,
.tax-exemption-settings input[type="email"]:focus,
.tax-exemption-settings input[type="password"]:focus,
.tax-exemption-settings select:focus,
.tax-exemption-settings textarea:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.12);
    outline: none;
}
a.button.tefw-edit-user {
    cursor: pointer;
    color: #007bff;
    font-weight: bold;
    padding: 7px 10px;
}

.tefw-highlight {
    background-color: rgb(214, 249, 214) !important;
    animation: fade 1s;
}

.tefw-email-settings {
    display: none;
    padding: 15px;
    background: #fff;
    border: 1px solid #e3e7ee;
    border-radius: 10px;
    margin-bottom: 15px;
}
.tefw-email-accordion h3 {
    cursor: pointer;
    padding: 20px;
    background: #f6f8fb;
    border: 1px solid #e3e7ee;
    border-radius: 10px;
    margin: 10px 0 0 0;
}

/* Email accordion arrow indicator */
.tefw-email-accordion h3 {
    position: relative;
    padding-right: 32px; /* room for arrow */
}
.tefw-email-accordion h3 .tefw-arrow {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%) rotate(0deg);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid #6b6b6b; /* triangle pointing down */
    transition: transform 0.2s ease;
    opacity: 0.9;
}
.tefw-email-accordion h3.tefw-open .tefw-arrow {
    transform: translateY(-50%) rotate(180deg); /* triangle points up when open */
}

/* Orders list column alignment */
.column-tax_exempt {
    text-align: center !important;
}

/* Hide default WP checkbox checkmark when restricted */
.tefw-hide-checked-icon input[type=checkbox]:checked::before {
    content: '';
}

/* Generic disabled UI wrapper (used to visually disable sections) */
.tefw-disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* Admin Header Bar */
.tefw-admin-header {
    margin-top: 20px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #ffffff 0%, #f7f9fc 100%);
    border: 1px solid #e3e7ee;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(18, 38, 63, 0.08);
}
.tefw-admin-header__inner {
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.tefw-admin-header__links {
    display: flex;
    align-items: center;
    margin-left: auto; /* push links to the right */
    gap: 8px 12px;
    font-size: 14px;
}
.tefw-admin-header__title {
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tefw-admin-header__title .dashicons {
    font-size: 24px;
    color: #2271b1;
}
.tefw-admin-header__byline {
    font-size: 12px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 7px;
    color: #5b6670;
}
.tefw-admin-header__brand {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    color: #1d2327;
}
.tefw-admin-header__brand:hover {
    color: #2271b1;
}
.tefw-admin-header__brand-logo {
    width: 18px;
    height: 18px;
}
.tefw-admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.tefw-admin-nav--secondary {
    margin-left: auto;
}
.tefw-admin-nav__link {
    text-decoration: none;
    background: #ffffff;
    color: #1d2327;
    border: 1px solid #d6dbe3;
    border-radius: 999px;
    padding: 6px 14px;
    line-height: 1.7;
    box-shadow: 0 2px 6px rgba(18, 38, 63, 0.06);
    transition: transform 0.1s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.tefw-admin-nav__link:hover {
    background: #ffffff;
    border-color: #2271b1;
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(18, 38, 63, 0.12);
}
.tefw-admin-nav__link.is-active {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
    box-shadow: 0 8px 16px rgba(34, 113, 177, 0.25);
}
@media (max-width: 600px) {
    .tefw-admin-header__inner { flex-direction: column; align-items: flex-start; }
    .tefw-admin-header__links { width: 100%; flex-wrap: wrap; }
    .tefw-admin-nav--secondary { margin-left: 0; }
}

/* Utility classes for removing inline CSS in admin UI */
.tefw-hidden { display: none !important; }
.tefw-full-width { width: 100% !important; }
.tefw-check-icon { color: #00a0d2; }
.tefw-custom-tax-exempt-message { font-size: 10px; color: #111; }