/* VR Equitypartner Brand Styles */

:root {
    --vrep-navy: #222833;
    --vrep-orange: #EC6608;
    --vrep-orange-hover: #d45b07;
    --vrep-orange-light: #FFBC7D;
    --vrep-blue: #0066B3;
    --vrep-blue-dark: #4054B2;
    --vrep-gray-dark: #54595F;
    --vrep-gray-text: #7A7A7A;
    --vrep-gray-light: #F2F2F2;
    --vrep-gray-border: #dfdedd;
    --vrep-white: #FFFFFF;
    --vrep-black: #000000;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--vrep-gray-light);
    color: #323130;
}

/* Header */
.app-header {
    background-color: var(--vrep-navy);
    color: white;
    padding: 0 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content h1 {
    margin: 0;
    color: white;
}

/* Logo */
.header-logo {
    height: 32px;
    width: auto;
    display: block;
}

.header-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
    background: white;
    padding: 6px 14px;
    border-radius: 4px;
}

.main-nav {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.nav-link {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 3px;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-link.active {
    background-color: var(--vrep-orange);
    color: white;
}

/* Main Content */
.app-main {
    min-height: calc(100vh - 120px);
    padding: 20px;
}

/* Cards */
.card {
    background: white;
    border-radius: 2px;
    box-shadow: 0 1.6px 3.6px rgba(0,0,0,0.13), 0 0.3px 0.9px rgba(0,0,0,0.11);
    margin-bottom: 20px;
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid #edebe9;
}

.card-body {
    padding: 20px;
}

/* Buttons */
.ms-Button {
    padding: 8px 16px;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 400;
    transition: background-color 0.2s;
}

.ms-Button--primary {
    background-color: var(--vrep-orange);
    color: white;
}

.ms-Button--primary:hover {
    background-color: var(--vrep-orange-hover);
}

.ms-Button--primary:disabled {
    background-color: #c8c6c4;
    cursor: not-allowed;
}

.ms-Button--default {
    background-color: white;
    color: #323130;
    border: 1px solid #8a8886;
}

.ms-Button--default:hover {
    background-color: #f3f2f1;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.ms-Label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #323130;
}

.ms-TextField-field {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #8a8886;
    border-radius: 2px;
    font-size: 14px;
    box-sizing: border-box;
}

.ms-TextField-field:focus {
    outline: none;
    border-color: var(--vrep-orange);
    box-shadow: 0 0 0 1px var(--vrep-orange);
}

.ms-Dropdown {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #8a8886;
    border-radius: 2px;
    font-size: 14px;
    background-color: white;
    box-sizing: border-box;
}

.ms-Checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ms-Checkbox-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Upload Area */
.upload-area {
    border: 2px dashed #8a8886;
    border-radius: 4px;
    padding: 40px;
    text-align: center;
    background-color: #faf9f8;
    transition: border-color 0.2s;
}

.upload-area:hover {
    border-color: var(--vrep-orange);
}

.upload-placeholder {
    pointer-events: none;
}

.upload-status {
    margin-top: 15px;
    padding: 10px;
    border-radius: 2px;
}

.upload-status.success {
    background-color: #dff6dd;
    color: #107c10;
}

.upload-status.error {
    background-color: #fde7e9;
    color: #a80000;
}

/* Status Bar */
.app-footer {
    background-color: #f3f2f1;
    border-top: 1px solid #edebe9;
    padding: 10px 20px;
    position: fixed;
    bottom: 0;
    width: 100%;
    box-sizing: border-box;
}

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-text {
    font-size: 12px;
    color: #605e5c;
}

/* Home Page */
.home-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Utility Classes */
.ms-fontSize-12 { font-size: 12px; }
.ms-fontSize-14 { font-size: 14px; }
.ms-fontSize-16 { font-size: 16px; }
.ms-fontSize-18 { font-size: 18px; }
.ms-fontSize-20 { font-size: 20px; }
.ms-fontSize-24 { font-size: 24px; }
.ms-fontSize-28 { font-size: 28px; }

.ms-fontWeight-semibold { font-weight: 600; }
.ms-fontWeight-bold { font-weight: 700; }

.ms-fontColor-neutralSecondary { color: #605e5c; }

/* Grid System */
.ms-Grid {
    box-sizing: border-box;
    *zoom: 1;
}

.ms-Grid::before,
.ms-Grid::after {
    content: " ";
    display: table;
}

.ms-Grid::after {
    clear: both;
}

.ms-Grid-row {
    box-sizing: border-box;
    *zoom: 1;
}

.ms-Grid-row::before,
.ms-Grid-row::after {
    content: " ";
    display: table;
}

.ms-Grid-row::after {
    clear: both;
}

.ms-Grid-col {
    float: left;
    box-sizing: border-box;
    padding: 0 10px;
}

.ms-sm12 { width: 100%; }
.ms-md6 { width: 50%; }
.ms-md4 { width: 33.333333%; }
.ms-lg4 { width: 33.333333%; }

@media (max-width: 768px) {
    .ms-md6, .ms-md4, .ms-lg4 {
        width: 100%;
    }
}

/* Handsontable Custom Styles */
.handsontable {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.handsontable th {
    background-color: #f3f2f1;
    font-weight: 600;
}

.handsontable .ht_clone_top th {
    background-color: var(--vrep-navy);
    color: white;
}

/* Editor Page Styles */
.editor-container {
    width: 100%;
}

.editor-container h2 {
    margin-bottom: 20px;
}

#data-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

#data-summary p {
    margin: 0;
    padding: 8px 0;
    border-bottom: 1px solid #edebe9;
}

#data-summary p:last-child {
    border-bottom: none;
}

#data-summary strong {
    color: #323130;
    font-weight: 600;
    display: inline-block;
    min-width: 120px;
}

/* Records Table Styles */
.records-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.records-table thead {
    background-color: #f3f2f1;
}

.records-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #323130;
    border-bottom: 2px solid #edebe9;
    white-space: nowrap;
}

.records-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #edebe9;
    color: #323130;
    vertical-align: middle;
}

.records-table tbody tr:hover {
    background-color: #faf9f8;
}

.records-table tbody tr:last-child td {
    border-bottom: none;
}

.records-table .action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
}

.records-table .action-buttons .ms-Button {
    padding: 6px 12px;
    font-size: 13px;
    min-width: 60px;
}

/* Table column widths */
.records-table th:nth-child(1),
.records-table td:nth-child(1) {
    width: 15%;
    min-width: 120px;
}

.records-table th:nth-child(2),
.records-table td:nth-child(2) {
    width: 15%;
    min-width: 120px;
}

.records-table th:nth-child(3),
.records-table td:nth-child(3) {
    width: 15%;
    min-width: 120px;
}

.records-table th:nth-child(4),
.records-table td:nth-child(4) {
    width: 25%;
    min-width: 180px;
}

.records-table th:nth-child(5),
.records-table td:nth-child(5) {
    width: 30%;
    min-width: 200px;
}

/* ── Month-Year Picker ─────────────────────────────── */

/*
 * Hide native month-picker chrome (spinner, arrows, clear button)
 * in browsers that support type="month" before our JS swaps to type="text".
 */
input[type="month"]::-webkit-inner-spin-button,
input[type="month"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-clear-button {
    display: none !important;
    -webkit-appearance: none !important;
}
input[type="month"] {
    -webkit-appearance: none;
    -moz-appearance: textfield;
    appearance: none;
}

/* Enhanced input styling */
.mp-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='%23605e5c'%3E%3Cpath d='M4.5 1a.5.5 0 0 1 .5.5V2h6v-.5a.5.5 0 0 1 1 0V2h1.5A1.5 1.5 0 0 1 15 3.5v10a1.5 1.5 0 0 1-1.5 1.5h-11A1.5 1.5 0 0 1 1 13.5v-10A1.5 1.5 0 0 1 2.5 2H4v-.5a.5.5 0 0 1 .5-.5zM14 5H2v8.5a.5.5 0 0 0 .5.5h11a.5.5 0 0 0 .5-.5V5zm-1.5-2h-9a.5.5 0 0 0-.5.5V4h10v-.5a.5.5 0 0 0-.5-.5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px 16px;
    padding-right: 34px !important;
    /* Disable native text-selection caret on iOS Safari */
    caret-color: transparent;
}

.mp-input:focus,
.mp-input:hover {
    border-color: var(--vrep-orange) !important;
    outline: none;
}

/* Dropdown container */
.mp-dropdown {
    position: absolute;
    z-index: 10000;
    background: var(--vrep-white);
    border: 1px solid var(--vrep-gray-border);
    border-radius: 4px;
    -webkit-box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.10);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.10);
    padding: 12px;
    display: none;
    min-width: 260px;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    /* Prevent iOS Safari tap highlight */
    -webkit-tap-highlight-color: transparent;
}

.mp-dropdown.mp-open {
    display: block;
    -webkit-animation: mp-fadeIn 0.15s ease-out;
    animation: mp-fadeIn 0.15s ease-out;
}

@-webkit-keyframes mp-fadeIn {
    from { opacity: 0; -webkit-transform: translateY(-4px); transform: translateY(-4px); }
    to   { opacity: 1; -webkit-transform: translateY(0);    transform: translateY(0); }
}
@keyframes mp-fadeIn {
    from { opacity: 0; -webkit-transform: translateY(-4px); transform: translateY(-4px); }
    to   { opacity: 1; -webkit-transform: translateY(0);    transform: translateY(0); }
}

/* Header with year navigation */
.mp-header {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 0 2px;
}

.mp-year {
    font-size: 16px;
    font-weight: 600;
    color: var(--vrep-navy);
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    min-width: 60px;
    text-align: center;
}

.mp-nav {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    font-size: 22px;
    font-weight: 600;
    color: var(--vrep-gray-dark);
    -webkit-transition: all 0.15s;
    transition: all 0.15s;
    line-height: 1;
    padding: 0;
    /* Prevent iOS tap highlight */
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
}

.mp-nav:hover {
    background: var(--vrep-gray-light);
    color: var(--vrep-navy);
}

.mp-nav:active {
    background: #e1dfdd;
}

/* Month grid – 4 columns × 3 rows */
.mp-grid {
    display: -ms-grid;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    -ms-grid-columns: 1fr 1fr 1fr 1fr;
    gap: 6px;
}

.mp-month {
    padding: 8px 4px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #323130;
    text-align: center;
    -webkit-transition: all 0.12s;
    transition: all 0.12s;
    line-height: 1.3;
    /* Prevent iOS tap highlight */
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
}

.mp-month:hover {
    background: #fff4ec;
    border-color: var(--vrep-orange-light);
    color: var(--vrep-orange);
}

.mp-month:active {
    background: #ffe0c2;
}

.mp-month.mp-selected {
    background: var(--vrep-orange);
    color: var(--vrep-white);
    border-color: var(--vrep-orange);
    font-weight: 600;
}

.mp-month.mp-selected:hover {
    background: var(--vrep-orange-hover);
    border-color: var(--vrep-orange-hover);
    color: var(--vrep-white);
}
