/**
 * Nitor Stellae - Executive Master Module Styles
 * Material Design | Pure Black | IBM Plex Mono
 */

/* ========================================
   HEADER
======================================== */
.nsem-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--nsem-border);
}

.nsem-title {
    font-family: var(--nsem-font);
    font-size: 32px;
    font-weight: 700;
    color: var(--nsem-text);
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.nsem-subtitle {
    font-size: 12px;
    font-weight: 400;
    color: var(--nsem-text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 6px;
}

.nsem-btn-icon {
    font-size: 18px;
    font-weight: 300;
    line-height: 1;
}

/* ========================================
   SEARCH BAR
======================================== */
.nsem-search-bar {
    margin-bottom: 24px;
}

.nsem-search-bar .nsem-input {
    max-width: 500px;
    padding-left: 20px;
    background: var(--nsem-surface);
}

/* ========================================
   DATA TABLE
======================================== */
.nsem-table-wrapper {
    background: var(--nsem-surface);
    border: 1px solid var(--nsem-border);
    border-radius: var(--nsem-radius-lg);
    overflow: hidden;
    overflow-x: auto;
}

.nsem-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--nsem-font);
    font-size: 14px; /* Table body baseline */
}

.nsem-table thead {
    background: var(--nsem-surface-2);
}

.nsem-table th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 12px; /* Table header baseline */
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--nsem-text-secondary);
    border-bottom: 1px solid var(--nsem-border);
    white-space: nowrap;
}

.nsem-table td {
    padding: 16px 20px;
    color: var(--nsem-text);
    border-bottom: 1px solid var(--nsem-border);
    vertical-align: middle;
}

.nsem-table tbody tr {
    transition: background var(--nsem-transition);
}

.nsem-table tbody tr:hover {
    background: var(--nsem-surface-2);
}

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

.nsem-th-id {
    width: 50px;
}

.nsem-td-id {
    color: var(--nsem-text-muted);
    font-weight: 500;
}

.nsem-td-name {
    font-weight: 600;
    color: var(--nsem-primary);
}

.nsem-td-phone {
    letter-spacing: 0.5px;
    font-variant-numeric: tabular-nums;
}

.nsem-td-notes {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--nsem-text-secondary);
    font-size: 14px;
}

.nsem-th-actions {
    width: 120px;
    text-align: center;
}

.nsem-td-actions {
    text-align: center;
    white-space: nowrap;
}

.nsem-row-empty td {
    text-align: center;
    padding: 60px 20px;
    color: var(--nsem-text-muted);
    font-size: 14px;
    font-style: italic;
}

/* ========================================
   ICON BUTTONS (Edit / Delete)
======================================== */
.nsem-btn-icon-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    font-size: 16px;
    border: 1px solid var(--nsem-border);
    border-radius: 8px;
    background: transparent;
    color: var(--nsem-text-secondary);
    cursor: pointer;
    transition: all var(--nsem-transition);
    margin: 0 4px;
}

.nsem-btn-edit:hover {
    color: var(--nsem-primary);
    border-color: var(--nsem-primary);
    background: var(--nsem-primary-glow);
}

.nsem-btn-delete:hover {
    color: var(--nsem-danger);
    border-color: var(--nsem-danger);
    background: rgba(255, 82, 82, 0.1);
}

/* ========================================
   MODAL
======================================== */
.nsem-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    animation: nsem-fade-in 0.2s ease;
}

.nsem-modal-overlay.nsem-active {
    display: flex;
}

.nsem-modal {
    width: 90%;
    max-width: 750px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--nsem-surface-2);
    border: 1px solid var(--nsem-border);
    border-radius: var(--nsem-radius-lg);
    box-shadow: var(--nsem-shadow-lg);
    animation: nsem-slide-up 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nsem-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px 16px;
    border-bottom: 1px solid var(--nsem-border);
}

.nsem-modal-title {
    font-family: var(--nsem-font);
    font-size: 20px;
    font-weight: 600;
    color: var(--nsem-text);
}

.nsem-modal-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--nsem-text-secondary);
    background: transparent;
    border: 1px solid var(--nsem-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--nsem-transition);
}

.nsem-modal-close:hover {
    color: var(--nsem-danger);
    border-color: var(--nsem-danger);
}

/* ========================================
   FORM
======================================== */
.nsem-form {
    padding: 28px;
}

.nsem-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.nsem-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nsem-form-group-full {
    margin-bottom: 24px;
}

.nsem-label {
    font-family: var(--nsem-font);
    font-size: 12px; /* Label baseline */
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--nsem-text-secondary);
}

.nsem-required {
    color: var(--nsem-danger);
}

.nsem-textarea {
    resize: vertical;
    min-height: 90px;
}

.nsem-form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--nsem-border);
}

/* ========================================
   TOAST NOTIFICATION
======================================== */
.nsem-toast {
    position: fixed;
    bottom: 32px;
    right: 32px;
    padding: 16px 24px;
    font-family: var(--nsem-font);
    font-size: 14px;
    font-weight: 500;
    color: #000000;
    background: var(--nsem-success);
    border-radius: var(--nsem-radius);
    box-shadow: var(--nsem-shadow);
    z-index: 999999;
    transform: translateY(120%);
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.nsem-toast.nsem-toast-show {
    transform: translateY(0);
    opacity: 1;
}

.nsem-toast.nsem-toast-error {
    background: var(--nsem-danger);
    color: #FFFFFF;
}

/* ========================================
   ANIMATIONS
======================================== */
@keyframes nsem-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes nsem-slide-up {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ========================================
   RESPONSIVE - TABLET
======================================== */
@media (max-width: 1024px) and (min-width: 641px) {
    .nsem-form-grid {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    .nsem-container {
        padding: 32px 24px;
    }

    .nsem-title {
        font-size: 26px;
    }
}

/* ========================================
   RESPONSIVE - MOBILE
======================================== */
@media (max-width: 640px) {
    .nsem-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .nsem-header-right {
        width: 100%;
    }

    .nsem-header-right .nsem-btn {
        width: 100%;
        justify-content: center;
    }

    .nsem-form-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .nsem-container {
        padding: 20px 16px;
    }

    .nsem-title {
        font-size: 24px;
    }

    .nsem-modal {
        width: 96%;
        margin: 12px;
    }

    .nsem-form {
        padding: 20px 16px;
    }

    .nsem-table {
        font-size: 13px;
    }

    .nsem-table th,
    .nsem-table td {
        padding: 12px 14px;
    }

    .nsem-search-bar .nsem-input {
        max-width: 100%;
    }

    .nsem-form-actions {
        flex-direction: column;
    }

    .nsem-form-actions .nsem-btn {
        width: 100%;
        justify-content: center;
    }
}
