/* Monthly Invoice Gateway for WooCommerce - Admin Styles */

/* Color variables (WordPress admin standard) */
:root {
    --mig-primary: #2271b1;
    --mig-primary-hover: #135e96;
    --mig-primary-rgb: 34, 113, 177;
    --mig-success: #00a32a;
    --mig-warning: #dba617;
    --mig-text: #1d2327;
    --mig-text-light: #50575e;
    --mig-border: #c3c4c7;
    --mig-border-light: #dcdcde;
    --mig-bg: #f0f0f1;
}

/* Conditional field display on settings page */
.mig-hide-manual-user-management,
.mig-hide-thankyou-message-content {
    display: none !important;
}

/* Page header */
.mig-header {
    background: #fff;
    color: var(--mig-text);
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid var(--mig-border-light);
    border-left: 4px solid var(--mig-primary);
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.mig-header h1 {
    margin: 0;
    padding: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--mig-text);
}

.mig-header .subtitle {
    color: var(--mig-text-light);
    margin: 5px 0 0 0;
    font-size: 13px;
    padding: 0;
}

/* Header messages */
.mig-message {
    margin: 15px 0 0 0;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
}

.mig-message-success {
    background-color: #edfaef;
    color: #00450b;
    border: 1px solid var(--mig-success);
}

.mig-message p {
    margin: 0;
    font-size: 13px;
}

/* Header status badge */
.status-badge-header {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 3px;
    vertical-align: middle;
    position: relative;
    top: -1px;
    margin-left: 8px;
}

.status-badge-header.status-confirmed {
    background-color: #edfaef;
    color: #00450b;
    border: 1px solid var(--mig-success);
}

.status-badge-header.status-pending {
    background-color: #fcf0c5;
    color: #6e4e00;
    border: 1px solid var(--mig-warning);
}

/* Month navigation */
.month-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    padding: 16px 20px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--mig-border-light);
}

.nav-item {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav-item.nav-prev {
    justify-content: flex-start;
}

.nav-item.nav-next {
    justify-content: flex-end;
}

.nav-button-prev .nav-text {
    align-items: flex-start;
    text-align: left;
}

.nav-button-next .nav-text {
    align-items: flex-end;
    text-align: right;
}

.nav-button-prev {
    padding-left: 10px;
    padding-right: 14px;
}

.nav-button-next {
    padding-left: 14px;
    padding-right: 10px;
}

.nav-button {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid var(--mig-border);
    border-radius: 4px;
    text-decoration: none;
    color: var(--mig-primary);
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    min-width: auto;
}

.nav-button:hover:not(.disabled) {
    background: var(--mig-primary);
    border-color: var(--mig-primary);
    color: #fff;
    text-decoration: none;
}

.nav-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    color: var(--mig-text-light);
    background: var(--mig-bg);
}

.nav-icon {
    font-size: 16px;
    font-weight: bold;
    margin: 0 6px;
}

.nav-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
}

.nav-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    opacity: 0.7;
}

.nav-date {
    font-size: 14px;
    font-weight: 500;
    margin-top: 2px;
}

/* Current month display */
.current-month-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 20px;
    background: var(--mig-primary);
    color: #fff;
    border-radius: 4px;
    min-width: 140px;
}

.current-month-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    opacity: 0.85;
    margin-bottom: 3px;
    letter-spacing: 0.5px;
}

.current-month-date {
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}

/* Table styles */
.mig-table-container {
    background: #fff;
    border: 1px solid var(--mig-border-light);
    border-radius: 4px;
    overflow: hidden;
    margin: 20px 0;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.wp-list-table.mig-table {
    border: none;
    box-shadow: none;
}

.wp-list-table.mig-table thead th {
    background: var(--mig-bg);
    border-bottom: 1px solid var(--mig-border);
    color: var(--mig-text);
    font-weight: 600;
    padding: 12px 10px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.wp-list-table.mig-table thead th:hover {
    background: #e5e5e5;
}

.wp-list-table.mig-table thead th.sortable::after {
    content: "\2195";
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.4;
    font-size: 12px;
}

.wp-list-table.mig-table thead th.sorted-asc::after {
    content: "\2191";
    opacity: 1;
    color: var(--mig-primary);
}

.wp-list-table.mig-table thead th.sorted-desc::after {
    content: "\2193";
    opacity: 1;
    color: var(--mig-primary);
}

.wp-list-table.mig-table tbody tr {
    transition: background-color 0.15s ease;
    border-bottom: 1px solid var(--mig-border-light);
}

.wp-list-table.mig-table tbody tr:hover {
    background-color: #f6f7f7;
}

.wp-list-table.mig-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.wp-list-table.mig-table tbody tr:nth-child(even):hover {
    background-color: #f6f7f7;
}

.wp-list-table.mig-table td {
    padding: 12px 10px;
    border-left: none;
    vertical-align: middle;
}

/* Summary box */
.summary-box {
    background: #fff;
    border: 1px solid var(--mig-border-light);
    border-radius: 4px;
    padding: 15px;
    margin-top: 20px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
    border-left: 4px solid var(--mig-primary);
}

.summary-box h3 {
    margin-top: 0;
    color: var(--mig-text);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.summary-box p {
    margin: 8px 0;
    font-size: 14px;
    color: var(--mig-text-light);
}

.summary-box p:last-child {
    margin-bottom: 0;
}

.summary-box strong {
    color: var(--mig-text);
}

/* Order details */
.order-details {
    background: var(--mig-bg);
    border: 1px solid var(--mig-border-light);
    border-radius: 4px;
    padding: 12px;
    margin-top: 8px;
    font-size: 13px;
}

.order-details a {
    display: inline-block;
    margin-right: 6px;
    margin-bottom: 4px;
    text-decoration: none;
    background: var(--mig-primary);
    color: #fff;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    transition: background-color 0.2s ease;
}

.order-details a:hover {
    background: var(--mig-primary-hover);
    text-decoration: none;
    color: #fff;
}

.wp-list-table th,
.wp-list-table td {
    vertical-align: middle;
}

.wp-list-table .button-small {
    padding: 4px 10px;
    font-size: 12px;
    line-height: 1.5;
    border-radius: 3px;
}

/* Empty state */
.mig-empty-state {
    text-align: center;
    padding: 50px 20px;
    background: #fff;
    border: 1px solid var(--mig-border-light);
    border-radius: 4px;
    margin: 20px 0;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.mig-empty-state .dashicons {
    font-size: 48px;
    color: var(--mig-border);
    margin-bottom: 12px;
}

.mig-empty-state h3 {
    color: var(--mig-text-light);
    margin-bottom: 8px;
}

.mig-empty-state p {
    color: #8c8f94;
    font-size: 13px;
}

/* Status badge */
.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    min-width: 60px;
}

.status-confirmed {
    background-color: #edfaef;
    color: #00450b;
}

.status-pending {
    background-color: #fcf0c5;
    color: #6e4e00;
}

/* Staff role badges */
.mig-role-badges {
    display: inline-block;
    margin-top: 4px;
}

.mig-role-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    margin-right: 4px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.mig-role-badge:last-child {
    margin-right: 0;
}

.mig-role-badge-administrator {
    background-color: #f0f6fc;
    color: #135e96;
    border: 1px solid var(--mig-primary);
}

.mig-role-badge-shop_manager {
    background-color: #f6f0fc;
    color: #5b2c87;
    border: 1px solid #9b59b6;
}

/* Search / Filter */
.mig-filters {
    background: #fff;
    border: 1px solid var(--mig-border-light);
    border-radius: 4px;
    padding: 16px 20px;
    margin: 20px 0;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.filter-form .filter-row {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-item {
    display: flex;
    flex-direction: column;
    min-width: 200px;
}

.filter-item label {
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--mig-text);
    font-size: 13px;
}

.filter-item input[type="text"],
.filter-item select {
    padding: 6px 10px;
    border: 1px solid var(--mig-border);
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.filter-item input[type="text"]:focus,
.filter-item select:focus {
    border-color: var(--mig-primary);
    outline: none;
    box-shadow: 0 0 0 1px var(--mig-primary);
}

.filter-item input[type="text"] {
    width: 300px;
}

.filter-item select {
    width: 200px;
}

.filter-buttons {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    min-width: auto;
    flex-direction: row;
}

.filter-buttons .button {
    margin: 0;
}

/* Table notes */
.mig-table-note {
    margin: 10px 0 0 0;
    padding: 0;
    color: var(--mig-text-light);
    font-style: italic;
}

.mig-table-note small {
    font-size: 12px;
}

/* Responsive */
@media (max-width: 782px) {
    .month-navigation {
        flex-wrap: wrap;
    }

    .filter-form .filter-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .filter-item {
        min-width: auto;
    }

    .filter-item input[type="text"] {
        width: 100%;
    }

    .filter-item select {
        width: 100%;
    }

    .filter-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-buttons .button {
        margin-bottom: 4px;
    }

    .wp-list-table {
        font-size: 12px;
    }

    .wp-list-table th,
    .wp-list-table td {
        padding: 8px 4px;
    }

    .status-badge {
        font-size: 11px;
        padding: 2px 6px;
        min-width: 50px;
    }
}
