:root {
    --primary: #6200EE;
    --primary-light: #7C4DFF;
    --secondary: #03DAC6;
    --background: #0F0F12;
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --sidebar-width: 260px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    height: -webkit-fill-available;
    width: 100vw;
}

/* Background Animation */
.bg-gradient {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 70% 30%, #2D0066 0%, transparent 40%),
                radial-gradient(circle at 30% 70%, #003366 0%, transparent 40%),
                radial-gradient(circle at 50% 50%, #1a1a2e 0%, #0f0f12 100%);
    z-index: -2;
    animation: rotate 30s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
    z-index: -1;
}

/* Glass Container */
.glass-container {
    display: flex;
    height: 100vh;
    height: -webkit-fill-available;
    height: 100dvh;
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 2rem 0;
    z-index: 10;
    overflow: hidden;
}

.nav-links {
    list-style: none;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
}

.logo {
    padding: 0 2rem 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
}

.logo-text {
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #fff 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-subtext {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 4px;
}

.logo-img {
    max-width: 100%;
    max-height: 72px;
    object-fit: contain;
    border-radius: 4px;
}

.logo.has-logo {
    flex-wrap: wrap;
    gap: 0;
    justify-content: center;
}

.logo.has-logo .logo-text,
.logo.has-logo .logo-subtext {
    font-size: 1.5rem;
    letter-spacing: 1px;
}

.nav-bottom {
    list-style: none;
}

.nav-links li, .nav-bottom li {
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
    position: relative;
    border-left: 4px solid transparent;
}

.nav-links li:hover, .nav-bottom li:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-links li.active {
    color: var(--text-primary);
    background: rgba(98, 0, 238, 0.1);
    border-left-color: var(--primary);
}

.nav-links li svg, .nav-bottom li svg,
.nav-links li i, .nav-bottom li i { color: #4CAF50; width: 20px; }

.nav-bottom {
    margin-top: auto;
}

.nav-bottom li {
    padding: 0.6rem 2rem;
    gap: 0.8rem;
    font-size: 0.85rem;
}

.nav-bottom li svg,
.nav-bottom li i {
    width: 16px;
    height: 16px;
}

/* Main Content */
.content-area {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
    padding: 2.5rem;
    position: relative;
}

/* Typography */
h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

/* Components */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.menu-grid .card {
    padding: 0.6rem;
    margin-bottom: 0;
    border-radius: 1rem;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--glass-shadow);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Buttons */
.btn {
    padding: 0.8rem 1.5rem;
    border-radius: 1rem;
    border: none;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.config-container .btn { padding: 0.55rem 1.5rem; }

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-light);
    box-shadow: 0 0 20px rgba(98, 0, 238, 0.4);
}

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

.home-header {
    margin-bottom: 4rem;
    display: flex;
    align-items: center;
    gap: 16px;
}

.home-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.home-logo img {
    max-height: 85px;
    max-width: 240px;
    object-fit: contain;
    border-radius: 4px;
    display: block;
}

.home-title-group {
    display: flex;
    flex-direction: column;
}

.home-title-group h1 {
    margin: 0;
}

.home-title-group .home-subtitle {
    margin: 4px 0 0;
    font-size: 1rem;
    color: var(--text-secondary);
}

.home-title-group .home-user-info {
    margin: 4px 0 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.home-title-group .home-user-info strong {
    color: var(--text-primary);
}

.home-header h1 {
    font-size: 1.89rem;
    font-weight: 900;
    letter-spacing: -1px;
}

.home-header h1 span {
    font-weight: 300;
    color: var(--text-secondary);
}

.home-logo img {
    max-height: 50px;
    max-width: 140px;
    object-fit: contain;
    border-radius: 4px;
    display: block;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(273px, 1fr));
    gap: 0.63rem;
}

.menu-grid .card {
    padding: 0.63rem;
    margin-bottom: 0;
    border-radius: 1rem;
}

.menu-card {
    display: flex;
    align-items: center;
    gap: 0.63rem;
    cursor: pointer;
    position: relative;
}

.menu-card-icon {
    width: 49px;
    height: 49px;
    background: rgba(76, 175, 80, 0.15);
    border-radius: 0.73rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #81c784;
    flex-shrink: 0;
}

.menu-card-icon i { width: 25px; height: 25px; }

.badge-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #e53935;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    z-index: 2;
}
.badge-count:empty { display: none; }
.badge-count:not(.has-count) { background: #757575; }

.badge-alert {
    position: absolute;
    top: -6px;
    right: -6px;
    z-index: 2;
    animation: pulse-alert 2s infinite;
}
@keyframes pulse-alert {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.menu-card-text h3 { font-size: 1rem; margin: 0; }
.menu-card-text p  { font-size: 0.84rem; margin: 0; color: var(--text-secondary); }

.home-footer { margin-top: 0.63rem; }
.config-quick-card {
    display: flex;
    align-items: center;
    gap: 0.63rem;
    cursor: pointer;
    padding: 0.6rem;
    border-radius: 1rem;
    margin-bottom: 0;
}
.config-quick-card i {
    width: 25px;
    height: 25px;
    flex-shrink: 0;
    color: var(--text-secondary);
}
.config-quick-card span {
    font-size: 1rem;
    font-weight: 700;
}

/* Config Screen */
.config-container {
    padding-bottom: 2rem;
}
.config-form {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    max-width: 800px;
}

.config-form .card {
    margin-bottom: 0;
    padding: 0.8rem;
}

.config-form .config-section h2 {
    margin-bottom: 0.35rem;
}

.form-actions {
    padding-top: 0.15rem;
}

.config-section h2 {
    font-size: 1rem;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-light);
}

.form-group {
    flex: 1 1 140px;
    min-width: 130px;
    margin-bottom: 0.25rem;
}

.form-group label {
    display: block;
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.form-group input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 0.5rem;
    padding: 0.4rem 0.6rem;
    color: white;
    font-family: inherit;
    transition: var(--transition);
    box-sizing: border-box;
    height: 28px;
}

.form-group select {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 0.5rem;
    padding: 0.4rem 0.6rem;
    color: white;
    font-family: inherit;
    transition: var(--transition);
    box-sizing: border-box;
    height: 28px;
    cursor: pointer;
}

.form-group select option { background: #1a1a2e; color: #fff; }

.form-group-supplier {
    flex: 3;
    min-width: 250px;
}

.form-group-docnum {
    flex: 0.4;
    min-width: 80px;
}

.form-group input:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.protocol-group { width: 100px; }
.ip-group { flex: 1; }

.form-select {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 0.5rem;
    padding: 0.5rem 0.7rem;
    color: white;
    font-family: inherit;
    transition: var(--transition);
    appearance: none;
    cursor: pointer;
    box-sizing: border-box;
    height: 28px;
}

.form-actions-secondary {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0.3rem 0;
}

.form-actions {
    padding-top: 0.3rem;
    padding-bottom: 1rem;
}

.form-actions {
    padding-top: 0.5rem;
}

.config-form .form-actions { max-width: 50%; margin: 0 auto; display: flex; }

.error-msg-container {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
    border-radius: 0.6rem;
    padding: 0.8rem;
    margin-bottom: 0.8rem;
    color: #ff8a80;
    font-size: 0.82rem;
}

.error-msg-container a {
    color: white;
    text-decoration: underline;
    font-weight: 700;
}

.test-error-msg p {
    margin-bottom: 0.3rem;
}

.loader-small {
    width: 20px;
    height: 20px;
    border: 2px solid #FFF;
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    animation: rotation 1s linear infinite;
    margin-right: 10px;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.checkbox-item input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 2rem;
    border-radius: 1rem;
    background: var(--primary);
    color: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 100;
    transition: var(--transition);
    transform: translateY(100px);
    opacity: 0;
}

.toast.visible {
    transform: translateY(0);
    opacity: 1;
}

/* Authorizations */
.screen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.auth-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-card {
    padding: 2rem;
}

.auth-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.auth-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.auth-code {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary-light);
}

.auth-type {
    font-size: 1.4rem;
    font-weight: 700;
}

.auth-status {
    padding: 0.4rem 1rem;
    border-radius: 2rem;
    font-size: 0.7rem;
    font-weight: 800;
}

.auth-status.pending {
    background: rgba(255, 193, 7, 0.1);
    color: #FFC107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.auth-remarks {
    font-style: italic;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.auth-meta {
    display: flex;
    gap: 2rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auth-meta i { width: 16px; height: 16px; }

.auth-actions {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.action-group {
    display: flex;
    gap: 1rem;
}

.btn-approve {
    background: #4CAF50;
    color: white;
}

.btn-reject {
    background: #F44336;
    color: white;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.btn-warning {
    background: #FF9800;
    color: white;
}

.btn-warning:hover {
    background: #f57c00;
    box-shadow: 0 0 15px rgba(255, 152, 0, 0.4);
}

.btn-approve:hover { background: #45a049; box-shadow: 0 0 15px rgba(76, 175, 80, 0.4); }
.btn-reject:hover { background: #d32f2f; box-shadow: 0 0 15px rgba(244, 67, 54, 0.4); }

.grid-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.2rem;
}

.search-bar {
    margin-bottom: 1rem;
}

.search-bar .form-input {
    width: 100%;
    max-width: 400px;
    padding: 0.5rem 0.7rem;
    border-radius: 0.5rem;
    border: 1px solid var(--glass-border);
    background: rgba(30,30,50,0.9);
    color: var(--text-primary);
    font-size: 0.85rem;
}

.bp-tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.bp-tabs .btn { flex: 1; text-align: center; }
.bp-filters {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.bp-search-input {
    flex: 1;
    min-width: 180px;
    padding: 0.45rem 0.7rem;
    border-radius: 0.5rem;
    border: 1px solid var(--glass-border);
    background: rgba(30,30,50,0.9);
    color: var(--text-primary);
    font-size: 0.85rem;
}

.bp-select {
    width: auto;
    min-width: 130px;
    padding: 0.45rem 0.7rem;
    border-radius: 0.5rem;
    border: 1px solid var(--glass-border);
    background: rgba(30,30,50,0.9);
    color: var(--text-primary);
    font-size: 0.85rem;
}
.bp-select option {
    background: #1a1a2e;
    color: #fff;
}

.bp-check-label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    cursor: pointer;
}

.bp-check-label input {
    accent-color: var(--primary-light);
}

.code-link {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary-light);
    letter-spacing: 1px;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: rgba(98,0,238,0.3);
}

.code-link:hover {
    color: var(--primary);
    text-decoration-color: var(--primary);
}

.bp-type-c {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #f9a825;
    color: #1a1a2e;
    font-size: 0.65rem;
    font-weight: 800;
    margin-right: 4px;
    line-height: 1;
}

.bp-type-p {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #42a5f5;
    color: #1a1a2e;
    font-size: 0.65rem;
    font-weight: 800;
    margin-right: 4px;
    line-height: 1;
}

.partner-card-selected {
    border-color: var(--primary-light) !important;
    background: rgba(98, 0, 238, 0.06) !important;
}

.doc-summary {
    margin-top: 0.8rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--glass-border);
    font-size: 0.72rem;
}

.doc-summary-empty {
    color: var(--text-secondary);
    text-align: center;
    padding: 0.5rem;
}

.doc-summary-title {
    font-weight: 700;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.doc-summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.68rem;
}

.doc-summary-table th {
    text-align: left;
    padding: 2px 4px;
    color: var(--text-secondary);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 1px solid var(--glass-border);
}

.doc-summary-table td {
    padding: 2px 4px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.doc-summary-table tfoot td {
    border-top: 1px solid var(--glass-border);
    border-bottom: none;
    padding-top: 4px;
}

.doc-balance {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.doc-type-badge {
    display: inline-block;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: 600;
}

.doc-type-inv {
    background: rgba(33, 150, 243, 0.15);
    color: #64b5f6;
}

.doc-type-cn {
    background: rgba(255, 152, 0, 0.15);
    color: #ffb74d;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-header .code {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary-light);
    letter-spacing: 1px;
}

.card-header .date-badge {
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
}

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.card-body p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.card-body p span {
    font-weight: 700;
    color: var(--text-primary);
}

.card-body .bp-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.card-body .bp-code {
    background: rgba(100, 181, 246, 0.2);
    color: #64B5F6;
    padding: 0.15rem 0.4rem;
    border-radius: 0.3rem;
    font-size: 0.8rem;
    font-weight: 700;
}

.card-body .bp-name {
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-body .total-line {
    font-size: 1.1rem;
    font-weight: 700;
    color: #81C784;
}

.order-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.meta-curr {
    background: rgba(255, 213, 79, 0.15);
    color: #FFD54F;
    padding: 0.15rem 0.4rem;
    border-radius: 0.3rem;
    font-size: 0.7rem;
    font-weight: 700;
}

.due-line {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.4rem;
}

.comments-line {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 0.3rem;
    font-style: italic;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hidden { display: none !important; }

.empty-state {
    text-align: center;
    padding: 4rem;
    color: var(--text-secondary);
    font-size: 1.2rem;
}

/* Loader */
.loader-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.loader {
    width: 48px;
    height: 48px;
    border: 5px solid #FFF;
    border-bottom-color: var(--primary);
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-container {
    text-align: center;
    padding: 4rem;
    color: #ff8a80;
    max-width: 600px;
    margin: 0 auto;
}

.error-container h2 {
    margin-bottom: 1rem;
    font-weight: 900;
}

.error-container p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 900px) {
    .sidebar { width: 80px; }
    .logo-text, .logo-subtext, .nav-links span, .nav-bottom span { display: none; }
    .logo { padding: 0 0 3rem; justify-content: center; }
    .logo-img { max-height: 58px; }
    .nav-links li, .nav-bottom li { justify-content: center; padding: 1.5rem 0; }
}

@media (max-width: 600px) {
    .glass-container { flex-direction: column-reverse; }
    .sidebar { 
        width: 100%; 
        height: auto;
        min-height: 70px;
        flex-direction: row; 
        flex-wrap: wrap;
        padding: 0;
        border-right: none;
        border-top: 1px solid var(--glass-border);
    }
    .logo { display: none; }
    .nav-links { display: flex; width: 100%; justify-content: space-around; }
    .nav-links li { padding: 1rem 0; }
    .nav-bottom {
        display: flex;
        width: 100%;
        justify-content: space-around;
        border-top: 1px solid var(--glass-border);
        margin-top: 0;
    }
    .nav-bottom li {
        flex: 1;
        justify-content: center;
        padding: 0.8rem 0;
        border-left: none;
    }
    .nav-bottom span { display: inline; font-size: 10px; }
    .content-area { padding: 1rem; }
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    padding: 2.5rem;
    background: rgba(30, 30, 40, 0.95);
    border: 1px solid var(--glass-border);
    border-radius: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.btn-close {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.5;
    transition: var(--transition);
}

.btn-close:hover { opacity: 1; }

.scrollable { overflow-y: auto; }

/* Tables */
.stock-table, .detail-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
}

.stock-table th, .detail-table th {
    text-align: left;
    padding: 1rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.8rem;
    text-transform: uppercase;
}

.stock-table td, .detail-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stock-val { color: var(--secondary); font-weight: 700; }
.comm-val { color: #FF7043; }
.ord-val { color: #4FC3F7; }

/* Items Interactive */
.item-card.interactive { cursor: pointer; }
.item-card.interactive:active { transform: scale(0.98); }

.stock-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(3, 218, 198, 0.1);
    color: var(--secondary);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-weight: 700;
    font-size: 0.85rem;
    width: fit-content;
}

/* User Cards */
.user-card { position: relative; overflow: hidden; }
.user-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--primary);
    padding: 0.3rem 0.8rem;
    font-size: 0.6rem;
    font-weight: 900;
    border-radius: 0 0 0 1rem;
}

/* Auth Participants */
.auth-participants {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.auth-participants strong { color: var(--primary-light); }

/* Premium Auth Cards (Android Style) */
.auth-list-premium {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    max-width: 900px;
}

.auth-card-premium {
    background: rgba(255, 255, 255, 0.08); /* Semi-transparent white like Surface in Android */
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 1rem;
    padding: 1rem;
    backdrop-filter: blur(15px);
    transition: var(--transition);
}

.auth-card-premium:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.4);
}

.acp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
}

.acp-type-info {
    display: flex;
    flex-direction: column;
}

.acp-doc-label {
    color: #FFD54F; /* Amber from Android */
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
}

.acp-doc-num {
    color: white;
    font-size: 1rem;
    font-weight: 700;
}

.acp-auth-id {
    background: rgba(255, 255, 255, 0.1);
    color: #81C784; /* Light Green */
    padding: 0.4rem 0.8rem;
    border-radius: 0.6rem;
    font-weight: 900;
    font-size: 1rem;
}

.acp-row-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 1.2rem;
}

.acp-bp-container label, .acp-user-box label, .meta-date label {
    display: block;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.7rem;
    margin-bottom: 0.3rem;
}

.acp-bp-code-badge {
    display: inline-block;
    background: rgba(100, 181, 246, 0.2);
    color: #64B5F6;
    padding: 0.2rem 0.5rem;
    border-radius: 0.4rem;
    font-size: 0.8rem;
    font-weight: 800;
    margin-bottom: 0.3rem;
}

.acp-bp-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: white;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.acp-total {
    color: #81C784;
    font-size: 1.5rem;
    font-weight: 800;
}

.acp-participants {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    padding: 0.6rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.acp-user-box .user-purple {
    color: #CE93D8; /* Purple from Android */
    font-weight: 700;
    font-size: 0.9rem;
}

.status-badge-soft {
    background: rgba(255, 171, 145, 0.2);
    color: #FFAB91;
    padding: 0.3rem 0.6rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
}

.acp-meta-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.4rem;
}

.meta-date span {
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
}

.meta-status {
    background: rgba(255, 213, 79, 0.2);
    color: #FFD54F;
    padding: 0.3rem 0.6rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 900;
}

.acp-bp-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.acp-bp-code {
    background: rgba(100, 181, 246, 0.2);
    color: #64B5F6;
    padding: 0.2rem 0.5rem;
    border-radius: 0.4rem;
    font-size: 0.8rem;
    font-weight: 800;
}

.meta-currency, .meta-total {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.meta-currency label, .meta-total label, .meta-date label {
    display: block;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.7rem;
    margin-bottom: 0.3rem;
}

.meta-currency span {
    color: #81C784;
    font-size: 0.85rem;
    font-weight: 700;
}

.meta-total span {
    color: white;
    font-size: 0.85rem;
    font-weight: 700;
}

.acp-remarks {
    margin-top: 0.7rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.6rem;
    border-radius: 0.6rem;
}

.acp-remarks label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
}

.acp-remarks p {
    font-size: 0.85rem;
    font-style: italic;
    color: rgba(255, 255, 255, 0.8);
}

.acp-actions {
    margin-top: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Shimmer Effect */
.shimmer-line {
    height: 14px;
    background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 5px;
}

.s-60 { width: 60px; }
.s-80 { width: 80px; }
.s-100 { width: 100%; }

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.subtitle {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 300;
}


/* --- Android Style Authorization Details --- */
.android-detail-modal {
    max-width: 500px !important;
    width: 95% !important;
    background: #12121A !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 20px !important;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5) !important;
    padding: 0 !important;
    overflow: hidden !important;
}

.android-detail-modal .modal-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 16px 20px;
    margin-bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.android-detail-modal .modal-body {
    padding: 20px;
}

.android-info-box {
    background: #1E1E2E;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.aib-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.aib-row.margin-top {
    margin-top: 12px;
}

.aib-col {
    display: flex;
    flex-direction: column;
}

.aib-col.align-right {
    align-items: flex-end;
    text-align: right;
}

.aib-col label {
    font-size: 11px !important;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.5) !important;
    text-transform: capitalize;
    margin-bottom: 2px;
    display: block;
}

.val-amber {
    color: #FFD54F !important;
    font-weight: bold;
    font-size: 15px;
}

.val-white {
    color: #FFFFFF !important;
    font-weight: bold;
    font-size: 14px;
}

.val-white-small {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 13px;
    line-height: 1.4;
}

.val-blue {
    color: #64B5F6 !important;
    font-weight: bold;
    font-size: 14px;
}

.val-green-large {
    color: #81C784 !important;
    font-weight: 800;
    font-size: 20px;
}

.android-section-title {
    font-size: 16px !important;
    font-weight: bold;
    color: #FFFFFF !important;
    margin: 20px 0 12px 4px !important;
}

.android-lines-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.android-line-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.alc-left {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding-right: 10px;
}

.alc-item-code {
    color: #CE93D8 !important;
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 2px;
}

.alc-item-desc {
    color: #FFFFFF !important;
    font-size: 12px;
}

.alc-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 120px;
}

.alc-stat {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

.alc-line-total {
    color: #81C784 !important;
    font-weight: bold;
    font-size: 16px;
    margin-top: 4px;
}

.alc-vat-badge {
    display: inline-block;
    background: rgba(129, 199, 132, 0.2);
    color: #81C784;
    padding: 0.15rem 0.4rem;
    border-radius: 0.3rem;
    font-size: 0.65rem;
    font-weight: 700;
    margin-top: 4px;
}

.alc-exe-badge {
    display: inline-block;
    background: rgba(100, 181, 246, 0.2);
    color: #64B5F6;
    padding: 0.15rem 0.4rem;
    border-radius: 0.3rem;
    font-size: 0.65rem;
    font-weight: 700;
    margin-top: 4px;
}

/* Fix para el scroll del detalle */
.android-detail-modal {
    max-height: 95vh !important;
    display: flex !important;
    flex-direction: column !important;
}

.android-detail-modal .modal-body {
    flex: 1 !important;
    overflow-y: auto !important;
    padding-bottom: 30px !important;
}

.android-lines-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 20px;
}


/* --- Item Detail Premium Styles (Android Parity) --- */

.item-detail-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px 0 20px 0;
    text-align: center;
}

.item-code-pill {
    display: inline-block;
    background: rgba(102, 126, 234, 0.15);
    color: #667eea;
    font-weight: 800;
    font-size: 15px;
    padding: 6px 18px;
    border-radius: 20px;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.item-detail-name {
    color: #FFFFFF !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    margin: 0 0 18px 0 !important;
    line-height: 1.3;
}

.stock-total-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 188, 212, 0.1);
    border: 1px solid rgba(0, 188, 212, 0.3);
    border-radius: 12px;
    padding: 12px 28px;
}

.stock-total-label {
    font-size: 11px;
    font-weight: 700;
    color: #00BCD4;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.stock-total-value {
    font-size: 26px;
    font-weight: 900;
    color: #FFFFFF;
    margin-top: 2px;
}

.stock-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 24px 0 14px 0;
    font-size: 12px;
    font-weight: 800;
    color: #FFFFFF;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.dot-cyan {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00BCD4;
    flex-shrink: 0;
}

.stock-row {
    display: flex;
    align-items: center;
    padding: 11px 14px;
    border-radius: 12px;
    margin-bottom: 4px;
    background: rgba(255, 255, 255, 0.03);
    transition: background 0.2s;
}

.stock-row:hover {
    background: rgba(255, 255, 255, 0.06);
}

.stock-row-low {
    background: rgba(255, 82, 82, 0.05) !important;
}

.stock-header-row {
    background: transparent !important;
    padding: 6px 14px;
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.stock-header-row .stock-cell {
    color: rgba(255, 255, 255, 0.45) !important;
    font-size: 11px !important;
    font-weight: 700 !important;
}

.stock-cell {
    flex: 1;
    text-align: right;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

.stock-cell.wh-code {
    text-align: left;
    color: #FFFFFF;
    font-weight: 700;
    flex: 0.8;
}

.val-cyan {
    color: #00BCD4 !important;
}

.val-red {
    color: #FF8A80 !important;
}

.font-bold {
    font-weight: 900 !important;
}

.font-small {
    font-size: 10px !important;
}

.stock-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-bottom: 20px;
}

.scrollable {
    overflow-y: auto;
    max-height: calc(95vh - 60px);
}


/* --- Search Bar & Pagination Styles --- */

.search-bar-container {
    padding: 0 0 16px 0;
}

.search-bar {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 6px 8px 6px 18px;
    gap: 10px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.search-bar:focus-within {
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.15);
}

.search-icon {
    width: 18px;
    height: 18px;
    color: rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
}

.search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #FFFFFF;
    font-size: 14px;
    font-family: inherit;
    padding: 8px 0;
}

.search-bar input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.btn-search {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    color: white !important;
    border: none !important;
    border-radius: 50px !important;
    padding: 8px 20px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: 1px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.btn-search:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-clear-search {
    background: rgba(255, 82, 82, 0.15);
    border: none;
    color: #FF8A80;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}

.btn-clear-search:hover {
    background: rgba(255, 82, 82, 0.3);
}

.btn-clear-search i {
    width: 14px;
    height: 14px;
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 20px 0;
    margin-top: 10px;
}

.btn-page {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 50% !important;
    width: 42px !important;
    height: 42px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: #FFFFFF !important;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-page:hover:not([disabled]) {
    background: rgba(102, 126, 234, 0.2) !important;
    border-color: rgba(102, 126, 234, 0.4) !important;
    transform: scale(1.05);
}

.btn-page[disabled] {
    opacity: 0.3;
    cursor: not-allowed;
}

.btn-page i {
    width: 20px;
    height: 20px;
}

.page-indicator {
    color: #FFFFFF;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

/* ============ Purchase Requests ============ */
.pr-container { padding: 16px; }
.pr-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 8px; }
.pr-header h1 { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.pr-subtitle { color: var(--text-secondary); font-size: 12px; margin-top: 2px; }
.header-actions { display: flex; gap: 6px; align-items: center; }

/* Filters */
.pr-filters { padding: 12px; margin-bottom: 12px; }
.filter-row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.filter-group { display: flex; flex-direction: column; gap: 3px; min-width: 140px; }
.filter-group label { font-size: 10px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.4px; }
.filter-group select, .filter-group input { padding: 6px 8px; border-radius: 5px; border: 1px solid var(--glass-border); background: rgba(30,30,50,0.9); color: var(--text-primary); font-size: 12px; appearance: auto; -webkit-appearance: auto; box-sizing: border-box; height: 36px; }
.filter-group select option { background: #1a1a2e; color: #fff; }
.filter-group select:focus, .filter-group input:focus { outline: none; border-color: var(--primary-light); }
.filter-group input[type="date"] { color-scheme: dark; }

/* Table */
.pr-table-wrapper { padding: 0; overflow-x: auto; overflow-y: auto; max-height: calc(100vh - 320px); }
.pr-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.pr-table th { text-align: left; padding: 6px 6px; background: rgba(255,255,255,0.03); color: var(--text-secondary); font-size: 9px; text-transform: uppercase; letter-spacing: 0.3px; cursor: pointer; white-space: nowrap; user-select: none; }
.pr-table th:hover { background: rgba(255,255,255,0.06); }
.pr-table td { padding: 4px 6px; border-top: 1px solid var(--glass-border); }
.pr-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.pr-table tbody tr[onclick] { cursor: pointer; }
.pr-table tbody tr[onclick]:hover { background: rgba(255,255,255,0.06); }
.pr-table .text-right { text-align: right; }
.pr-table .text-center { text-align: center; }
.pr-table .cmt-col { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.65rem; }

/* Form card sections */
.pr-form { margin-bottom: 12px; padding: 14px; }
.pr-lines { margin-bottom: 12px; padding: 14px; }
.pr-lines h2 { font-size: 14px; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.pr-totals { margin-bottom: 12px; padding: 14px; }
.pr-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.table-scroll { overflow-x: auto; max-height: 400px; overflow-y: auto; }
.pr-lines-table { width: 100%; border-collapse: collapse; font-size: 11px; min-width: 800px; }
.pr-lines-table th { text-align: left; padding: 6px 6px; background: rgba(255,255,255,0.03); color: var(--text-secondary); font-size: 9px; text-transform: uppercase; letter-spacing: 0.3px; white-space: nowrap; }
.pr-lines-table td { padding: 4px 6px; border-top: 1px solid rgba(255,255,255,0.04); vertical-align: middle; }
.line-input { width: 100%; min-width: 60px; padding: 4px 6px; border-radius: 4px; border: 1px solid var(--glass-border); background: rgba(30,30,50,0.8); color: var(--text-primary); font-size: 11px; box-sizing: border-box; height: 28px; }
.line-input.num { text-align: right; }
.line-select { width: 100%; min-width: 70px; padding: 4px 6px; border-radius: 4px; border: 1px solid var(--glass-border); background: rgba(30,30,50,0.8); color: var(--text-primary); font-size: 11px; box-sizing: border-box; cursor: pointer; height: 28px; }
.line-select option { background: #1a1a2e; color: #fff; }
.line-actions { display: flex; gap: 6px; padding: 8px 0; }
.totals-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px; }
.totals-grand { font-weight: 700; font-size: 15px; border-top: 1px solid var(--glass-border); padding-top: 8px; margin-top: 4px; }
.is-hidden { display: none !important; }
.draft-toggle { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; cursor: pointer; }
.draft-toggle input { width: 14px; height: 14px; cursor: pointer; }

.sort-icon { width: 12px; height: 12px; vertical-align: middle; opacity: 0.5; }

.actions-cell { white-space: nowrap; display: flex; gap: 4px; }
.btn-icon { background: none; border: none; color: var(--text-secondary); cursor: pointer; padding: 4px 6px; border-radius: 4px; display: inline-flex; align-items: center; transition: var(--transition); }
.btn-icon:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }
.btn-icon.btn-danger:hover { background: rgba(244,67,54,0.15); color: #f44336; }
.btn-icon i { width: 16px; height: 16px; }
.actions-cell .btn-icon { padding: 3px 5px; }
.actions-cell .btn-icon i { width: 14px; height: 14px; }

/* Badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.pr-table .badge { padding: 2px 6px; font-size: 9px; }
.badge-draft { background: rgba(158,158,158,0.25); color: #e0e0e0; border: 1px solid rgba(158,158,158,0.4); text-shadow: 0 1px 2px rgba(0,0,0,0.3); }
.badge-open { background: rgba(33,150,243,0.25); color: #90CAF9; border: 1px solid rgba(33,150,243,0.4); text-shadow: 0 1px 2px rgba(0,0,0,0.3); }
.badge-closed { background: rgba(76,175,80,0.25); color: #A5D6A7; border: 1px solid rgba(76,175,80,0.4); text-shadow: 0 1px 2px rgba(0,0,0,0.3); }
.poa-badge-open { background: rgba(76,175,80,0.15); color: #4caf50; }
.poa-badge-closed { background: rgba(255,255,255,0.08); color: var(--text-secondary); }
.poa-status-dot.online { background: #4caf50; box-shadow: 0 0 6px rgba(76,175,80,0.5); }
.poa-status-dot.offline { background: #f44336; box-shadow: 0 0 6px rgba(244,67,54,0.5); }

/* === Bulk Import === */
.bulk-upload-area { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1rem; }
.bulk-file-group { display: flex; flex-direction: column; gap: 0.4rem; padding: 0.8rem; border-radius: 8px; border: 1px dashed var(--glass-border); background: rgba(255,255,255,0.02); }
.bulk-file-group label { font-size: 0.82rem; }
.bulk-file-group input[type="file"] { font-size: 0.82rem; color: var(--text-secondary); }
.bulk-file-info { font-size: 0.8rem; }
.bulk-ok { color: #4caf50; font-weight: 600; }
.bulk-progress { margin: 1rem 0; }
.bulk-progress-bar { height: 6px; background: rgba(255,255,255,0.08); border-radius: 3px; overflow: hidden; }
.bulk-progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-light)); border-radius: 3px; transition: width 0.3s ease; width: 0%; }
.bulk-progress-text { font-size: 0.82rem; color: var(--text-secondary); text-align: center; margin-top: 0.5rem; }
.bulk-results { margin: 1rem 0; }
.bulk-results .bulk-success { padding: 0.8rem; border-radius: 8px; background: rgba(76,175,80,0.1); border: 1px solid rgba(76,175,80,0.3); color: #4caf50; font-size: 0.85rem; }
.bulk-results .bulk-warning { padding: 0.8rem; border-radius: 8px; background: rgba(255,193,7,0.1); border: 1px solid rgba(255,193,7,0.3); color: #ffc107; font-size: 0.85rem; }
.bulk-results .bulk-error { padding: 0.8rem; border-radius: 8px; background: rgba(244,67,54,0.1); border: 1px solid rgba(244,67,54,0.3); color: #f44336; font-size: 0.85rem; }
.bulk-results pre { background: rgba(0,0,0,0.3); padding: 0.5rem; border-radius: 4px; font-size: 0.75rem; color: var(--text-secondary); margin-top: 0.5rem; white-space: pre-wrap; }

/* POA card layout */
.poa-card-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0.75rem; }
.poa-card { background: var(--card-bg); border: 1px solid var(--glass-border); border-radius: 10px; padding: 0.85rem; display: flex; flex-direction: column; gap: 0.4rem; }
.poa-card-top { display: flex; justify-content: space-between; align-items: center; }
.poa-card-id { font-weight: 700; font-size: 1.05rem; color: #FFD54F; }
.poa-card-top-right { display: flex; align-items: center; gap: 0.5rem; }
.poa-card-date { font-size: 0.75rem; color: var(--text-secondary); }
.poa-card-bp { display: flex; align-items: center; gap: 0.3rem; }
.poa-bp-code { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); }
.poa-bp-sep { font-size: 0.8rem; color: var(--text-secondary); }
.poa-bp-name { font-size: 0.75rem; color: var(--text-secondary); }
.poa-card-total { display: flex; align-items: baseline; gap: 0.3rem; margin-top: 0.2rem; }
.poa-total-amount { font-size: 1.1rem; font-weight: 700; }
.poa-total-curr { font-size: 0.7rem; color: var(--text-secondary); }
.poa-card-cmts { display: flex; flex-direction: column; border-top: 1px solid rgba(255,255,255,0.04); margin-top: 0.2rem; padding-top: 0.2rem; }
.poa-card-cmt { font-size: 0.83rem; color: var(--text-secondary); padding: 0.3rem 0; }
.poa-card-ar-cmt { background: rgba(255,183,77,0.08); border-left: 2px solid #ffb74d; padding-left: 0.4rem; margin-top: 0.1rem; }
.poa-cmt-label { font-weight: 600; color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; }
.poa-card-actions { display: flex; justify-content: flex-end; margin-top: 0.2rem; padding-top: 0.4rem; border-top: 1px solid rgba(255,255,255,0.04); }

/* === Adjuntos (Attachments) === */
.po-attachments-section { margin-bottom: 12px; padding: 14px; }
.po-attachments-section h2 { font-size: 14px; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.po-attach-existing { margin-bottom: 10px; }
.po-attach-subtitle { font-size: 11px; color: var(--text-secondary); margin-bottom: 6px; }
.po-attach-file { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; background: rgba(255,255,255,0.03); margin-bottom: 4px; font-size: 12px; }
.po-attach-file:hover { background: rgba(255,255,255,0.06); }
.po-attach-icon { display: flex; align-items: center; flex-shrink: 0; }
.po-attach-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-primary); }
.po-attach-size { font-size: 11px; color: var(--text-secondary); white-space: nowrap; }
.po-attach-date { font-size: 11px; color: var(--text-secondary); white-space: nowrap; }
.po-attach-dl { color: var(--primary-light); text-decoration: none; display: flex; align-items: center; padding: 2px; border-radius: 4px; flex-shrink: 0; }
.po-attach-dl:hover { background: rgba(124,77,255,0.15); }
.po-attach-empty { font-size: 12px; color: var(--text-secondary); padding: 4px 0; }
.po-attach-upload { margin-top: 8px; }
.po-attach-dropzone { border: 2px dashed var(--glass-border); border-radius: 10px; padding: 20px; text-align: center; cursor: pointer; transition: var(--transition); background: rgba(255,255,255,0.02); }
.po-attach-dropzone:hover { border-color: var(--primary-light); background: rgba(124,77,255,0.05); }
.po-attach-dropzone.drag-over { border-color: var(--primary); background: rgba(124,77,255,0.1); }
.po-attach-dropzone p { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.po-attach-hint { font-size: 11px; color: var(--text-secondary); margin-top: 8px; opacity: 0.6; }
.po-attach-pending { background: rgba(124,77,255,0.08); border: 1px solid rgba(124,77,255,0.2); }
#po-pending-files { margin-top: 8px; }

/* Loading overlay */
.loading-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    z-index: 99999;
}
.loading-overlay .loader {
    width: 48px; height: 48px;
    border: 5px solid rgba(255,255,255,0.2);
    border-bottom-color: var(--primary);
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}
.loading-overlay p {
    color: #fff;
    margin-top: 16px;
    font-size: 14px;
}
button:disabled,
.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

/* Clientes (customers) */
.cust-actions { margin-bottom: 1rem; }
.cust-form-card { margin-bottom: 1.25rem; }
.cust-form-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
.cust-form-card .card-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-light);
    font-size: 1rem;
}
.cust-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem 1rem;
    margin-top: 1rem;
}
.cust-save-group {
    display: flex;
    align-items: flex-end;
}
.screen-section-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 1rem 0 0.5rem;
}
.cust-detail { font-size: 0.8rem; color: var(--text-secondary); margin: 0.15rem 0; }
.cust-detail span { color: var(--text-primary); }

/* Rejected table */
.rj-table-wrap { padding: 0; overflow-x: auto; }
.rj-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.rj-table th { text-align: left; padding: 8px 10px; background: rgba(255,255,255,0.03); color: var(--text-secondary); font-size: 10px; text-transform: uppercase; letter-spacing: 0.3px; white-space: nowrap; user-select: none; }
.rj-table td { padding: 6px 10px; border-top: 1px solid var(--glass-border); }
.rj-table tbody tr:hover { background: rgba(255,255,255,0.04); }
.rj-table .text-right { text-align: right; }
.rj-table .actions-cell { white-space: nowrap; display: flex; gap: 2px; }
