﻿/* =============================================
   C_Styles.css  –  RE1 Application Shared Styles
   ============================================= */

/* ---------- Google Font ---------- */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&family=DM+Mono:wght@400;500&display=swap');

/* ---------- Reset / Base ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #f7f7f8;
    --surface: #ffffff;
    --surface-2: #f1f1f3;
    --border: #d8d8dc;
    --border-focus: #888896;
    --text-primary: #1a1a2e;
    --text-secondary: #5a5a72;
    --text-label: #7a7a90;
    --accent: #3a3a5c;
    --accent-light: #5a5a8c;
    --danger: #c0392b;
    --danger-hover: #96281b;
    --success: #27ae60;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,.10);
    --shadow-lg: 0 8px 32px rgba(0,0,0,.13);
    --font-body: 'DM Sans', sans-serif;
    --font-mono: 'DM Mono', monospace;
    --transition: .18s ease;
}

html, body {
    background: var(--bg);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.55;
    min-height:auto;
    min-height: 100vh;
    /*
    */
}

/* ---------- Page Wrapper ---------- */
.page-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px 12px 0px;
    min-height:auto;
    /*
    min-height: 100vh;
    */
}

/* ---------- Main Card ---------- */
.main-card {
    width: 100%;
    max-width: 1400px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    /*box-shadow: var(--shadow-lg);*/
    overflow: hidden;
}

/* ---------- Card Header ---------- */
.card-header {
    background: var(--accent);
    color: #fff;
    padding: 10px; /*20px 28px 16px;*/
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
}

    .card-header h1 {
        display:inline-block;
        font-size: 1.75rem;
        font-weight: 600;
        letter-spacing: -.5px;
    }

    .card-header .subtitle {
        font-size: .85rem;
        opacity: .65;
        font-weight: 300;
    }

/* ---------- Card Body ---------- */
.card-body {
    padding: 20px 28px 28px;
}

/* ---------- Section Divider ---------- */
.section-title {
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-label);
    margin: 18px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

/* ---------- Form Grid ---------- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px 14px;
    margin-bottom: 14px;
}

    .form-grid .col-wide {
        grid-column: span 2;
    }

    .form-grid .col-narrow {
        max-width: 140px;
    }

/* ---------- Field Group ---------- */
.field-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

    .field-group label {
        font-size: .72rem;
        font-weight: 500;
        color: var(--text-label);
        letter-spacing: .02em;
    }

    /* ---------- Inputs ---------- */
    .field-group input[type="text"],
    .field-group input[type="number"],
    .field-group textarea,
    .field-group select {
        background: var(--surface-2);
        border: 1.5px solid var(--border);
        border-radius: var(--radius-sm);
        color: var(--text-primary);
        font-family: var(--font-body);
        font-size: .88rem;
        padding: 6px 10px;
        transition: border-color var(--transition), box-shadow var(--transition);
        width: 100%;
        outline: none;
    }

        .field-group input[type="text"]:focus,
        .field-group input[type="number"]:focus,
        .field-group textarea:focus,
        .field-group select:focus {
            border-color: var(--border-focus);
            box-shadow: 0 0 0 3px rgba(90,90,140,.12);
            background: var(--surface);
        }
/* hide number spinners */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* RTL Arabic inputs */
input.rtl, textarea.rtl {
    direction: rtl;
    text-align: right;
}
/* LTR explicit */
input.ltr, textarea.ltr {
    direction: ltr;
    text-align: left;
}

/* Narrow INT inputs */
.input-int {
    max-width: 120px !important;
}

/* Max textarea (VARCHAR(max) / NVARCHAR(max)) */
textarea.max-col {
    resize: none;
    height: 72px; /* ~3 rows */
    overflow-y: scroll;
}
    /* Dimmed scrollbar when no overflow */
    textarea.max-col:not(.overflowing)::-webkit-scrollbar-thumb {
        background: #ddd;
    }

    textarea.max-col::-webkit-scrollbar {
        width: 6px;
    }

    textarea.max-col::-webkit-scrollbar-track {
        background: #f0f0f0;
        border-radius: 4px;
    }

    textarea.max-col::-webkit-scrollbar-thumb {
        background: #bbb;
        border-radius: 4px;
    }

/* Checkbox / toggle row */
.check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

    .check-row input[type="checkbox"] {
        width: 16px;
        height: 16px;
        accent-color: var(--accent);
        cursor: pointer;
    }

    .check-row label {
        font-size: .85rem;
        color: var(--text-secondary);
        cursor: pointer;
    }

/* ---------- Button Bar ---------- */
.btn-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

/* Base button */
.btn {
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font-body);
    font-size: .83rem;
    font-weight: 500;
    letter-spacing: .02em;
    padding: 7px 18px;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    white-space: nowrap;
}

    .btn:active {
        transform: translateY(1px);
    }

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

    .btn-primary:hover {
        background: var(--accent-light);
    }

.btn-secondary {
    background: var(--surface-2);
    color: var(--text-primary);
    border: 1.5px solid var(--border);
}

    .btn-secondary:hover {
        background: #e4e4ea;
    }

.btn-danger {
    background: var(--danger);
    color: #fff;
}

    .btn-danger:hover {
        background: var(--danger-hover);
    }

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn:disabled {
    opacity: .42;
    cursor: not-allowed;
}

/* Dirty-state indicator */
.dirty-badge {
    display: inline-block;
    font-size: .7rem;
    background: #f39c12;
    color: #fff;
    padding: 1px 8px;
    border-radius: 20px;
    margin-left: 8px;
    vertical-align: middle;
    animation: pulse .8s infinite alternate;
}

@keyframes pulse {
    from {
        opacity: .6;
    }

    to {
        opacity: 1;
    }
}

/* ---------- Grid / List Section ---------- */
.grid-section {
    margin-top: 24px;
}

.grid-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

table.re1-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: .80rem;
}

    table.re1-grid thead tr {
        background: var(--accent);
        color: #fff;
    }

    table.re1-grid thead th {
        padding: 8px 10px;
        text-align: left;
        font-weight: 500;
        letter-spacing: .03em;
        cursor: pointer;
        user-select: none;
        white-space: nowrap;
    }

        table.re1-grid thead th:hover {
            background: var(--accent-light);
        }

        table.re1-grid thead th .sort-arrow {
            margin-left: 4px;
            opacity: .55;
            font-size: .75em;
        }

        table.re1-grid thead th.sorted .sort-arrow {
            opacity: 1;
        }

    table.re1-grid tbody tr {
        border-bottom: 1px solid var(--border);
        transition: background var(--transition);
    }

        table.re1-grid tbody tr:last-child {
            border-bottom: none;
        }

        table.re1-grid tbody tr:hover {
            background: #f4f4f8;
        }

        table.re1-grid tbody tr.selected {
            background: #eaeaf4;
        }

    table.re1-grid td {
        padding: 6px 10px;
        color: var(--text-secondary);
        vertical-align: middle;
    }

        table.re1-grid td.td-actions {
            white-space: nowrap;
            text-align: right;
        }

        table.re1-grid td .btn {
            padding: 3px 10px;
            font-size: .75rem;
        }

/* Active badge */
.badge-active {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 600;
    background: #d4f0e0;
    color: #1e7a45;
}

.badge-inactive {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 600;
    background: #fce8e6;
    color: #a93226;
}

/* ---------- Status / Messages ---------- */
.msg-bar {
    border-radius: var(--radius-sm);
    font-size: .83rem;
    margin-top: 10px;
    padding: 8px 14px;
}

    .msg-bar.success {
        background: #d4f0e0;
        color: #1e7a45;
        border-left: 3px solid #27ae60;
    }

    .msg-bar.error {
        background: #fce8e6;
        color: #a93226;
        border-left: 3px solid #c0392b;
    }

    .msg-bar.info {
        background: #e8eaf8;
        color: #3a3a7c;
        border-left: 3px solid #5a5aac;
    }

/* ---------- Modal / Dialog ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20,20,40,.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn .15s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-box {
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-width: 420px;
    padding: 28px 28px 20px;
    width: 90%;
    animation: slideUp .18s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(16px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-box h3 {
    font-size: 1.05rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.modal-box p {
    font-size: .88rem;
    color: var(--text-secondary);
    margin-bottom: 18px;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .card-body {
        padding: 14px 14px 20px;
    }

    .card-header h1 {
        font-size: 1.35rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

        .form-grid .col-wide {
            grid-column: span 1;
        }

        .form-grid .col-exwide {
                    grid-column: span 2;
            }

    table.re1-grid {
        font-size: .72rem;
    }

        table.re1-grid td, table.re1-grid th {
            padding: 5px 6px;
        }

    .input-int {
        max-width: 100% !important;
    }
}
.headerIntegLogo{
    margin:0;
    margin-bottom:0px;
    width:350px;
    max-width:350px;
}