/* ===================================
   Portal Partners GetFlexify
   Brand: #e72060 (rosa), white bg, black text
   =================================== */

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f7;
    color: #1a1a1a;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: #e72060;
    text-decoration: none;
}

a:hover {
    color: #c41a52;
}

/* Navbar */
.navbar {
    background-color: #ffffff;
    border-bottom: 3px solid #e72060;
    padding: 0 24px;
    display: flex;
    align-items: center;
    height: 64px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand a {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.logo-text {
    font-size: 1.4rem;
    color: #1a1a1a;
    letter-spacing: -0.5px;
}

.logo-text strong {
    color: #e72060;
}

.logo-sub {
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 40px;
    flex: 1;
}

.nav-link {
    padding: 8px 16px;
    border-radius: 6px;
    color: #444;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-link:hover {
    background-color: #fce4ec;
    color: #e72060;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name {
    font-size: 0.9rem;
    color: #666;
}

/* Main Content */
.main-content {
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 24px;
    flex: 1;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h1 {
    font-size: 1.5rem;
    color: #1a1a1a;
    font-weight: 700;
}

.page-header p {
    color: #666;
    font-size: 0.9rem;
    width: 100%;
}

/* Cards */
.card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    padding: 24px;
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.card-header h2 {
    font-size: 1.1rem;
    color: #1a1a1a;
    font-weight: 600;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a1a1a;
}

.stat-label {
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-inline {
    border-left: 4px solid #e72060;
    padding: 12px 16px;
    margin-bottom: 8px;
}

.stat-inline .stat-label {
    text-transform: none;
    font-size: 0.85rem;
}

/* Grid layouts */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table th {
    text-align: left;
    padding: 10px 12px;
    font-weight: 600;
    color: #666;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #f0f0f0;
    white-space: nowrap;
}

.table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f5f5f5;
    color: #333;
}

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

.table-sm td, .table-sm th {
    padding: 6px 10px;
    font-size: 0.85rem;
}

.text-center {
    text-align: center;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    gap: 6px;
    white-space: nowrap;
}

.btn-primary {
    background-color: #e72060;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #c41a52;
    color: #ffffff;
}

.btn-outline {
    background-color: transparent;
    color: #666;
    border: 1px solid #ddd;
}

.btn-outline:hover {
    background-color: #f5f5f5;
    color: #333;
}

.btn-success {
    background-color: #7ab929;
    color: #ffffff;
}

.btn-success:hover {
    background-color: #68a222;
    color: #ffffff;
}

.btn-danger {
    background-color: #e72060;
    color: #ffffff;
}

.btn-danger:hover {
    background-color: #c41a52;
    color: #ffffff;
}

.btn-info {
    background-color: #2b4c9b;
    color: #ffffff;
}

.btn-info:hover {
    background-color: #1f3a7a;
    color: #ffffff;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #444;
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #333;
    transition: border-color 0.2s;
    background-color: #fff;
}

.form-control:focus {
    outline: none;
    border-color: #e72060;
    box-shadow: 0 0 0 3px rgba(231, 32, 96, 0.1);
}

select.form-control {
    appearance: auto;
}

textarea.form-control {
    resize: vertical;
    font-family: inherit;
}

.form-hint {
    font-size: 0.8rem;
    color: #999;
    margin-top: 4px;
    display: block;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 24px;
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.form-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
    align-items: flex-end;
}

.filter-bar .form-control {
    width: auto;
    min-width: 150px;
}

.filter-bar input[type="text"] {
    min-width: 250px;
}

/* Detail Grid */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.detail-item {
    padding: 8px 0;
}

.detail-item label {
    display: block;
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.detail-item span {
    font-size: 0.95rem;
    color: #1a1a1a;
    font-weight: 500;
}

/* Pagination */
.pagination {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #666;
    border: 1px solid #ddd;
    transition: all 0.2s;
}

.page-link:hover {
    background-color: #fce4ec;
    color: #e72060;
    border-color: #e72060;
}

.page-link.active {
    background-color: #e72060;
    color: #ffffff;
    border-color: #e72060;
}

/* Actions column */
.actions {
    display: flex;
    gap: 4px;
    white-space: nowrap;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.alert-success {
    background-color: #f0fae4;
    color: #3d6b00;
    border: 1px solid #c5e99e;
}

.alert-error {
    background-color: #fde8ee;
    color: #a31545;
    border: 1px solid #f5b3c5;
}

.alert-warning {
    background-color: #fff5e0;
    color: #8a5d00;
    border: 1px solid #ffd480;
}

.alert-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
}

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

/* Reports Grid */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.report-card {
    border: 1px solid #f0f0f0;
    border-radius: 10px;
    padding: 20px;
    transition: box-shadow 0.2s;
}

.report-card:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.report-card h3 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: #1a1a1a;
}

.report-card p {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 12px;
}

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

.report-form .form-control {
    width: 100%;
}

/* Import */
.import-results {
    margin-bottom: 20px;
}

.error-list {
    margin-top: 16px;
    padding: 16px;
    background-color: #fef7f9;
    border-radius: 8px;
}

.error-list h3 {
    font-size: 0.9rem;
    color: #e72060;
    margin-bottom: 8px;
}

.error-list ul {
    padding-left: 20px;
}

.error-list li {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 4px;
}

.import-format h3 {
    font-size: 0.95rem;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.import-format p {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 12px;
}

/* Login Page */
.login-page {
    background: linear-gradient(135deg, #e72060 0%, #f59c28 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header .logo-text {
    font-size: 2rem;
    display: block;
}

.login-header .logo-sub {
    font-size: 0.85rem;
    display: block;
    margin-top: 4px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form .btn-block {
    margin-top: 8px;
    padding: 12px;
    font-size: 1rem;
}

/* Footer */
.footer {
    background-color: #ffffff;
    border-top: 1px solid #eee;
    padding: 16px 24px;
    text-align: center;
    margin-top: auto;
}

.footer p {
    color: #999;
    font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-wrap: wrap;
        height: auto;
        padding: 12px 16px;
        gap: 8px;
    }

    .navbar-menu {
        margin-left: 0;
        order: 3;
        width: 100%;
        overflow-x: auto;
    }

    .main-content {
        padding: 16px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .filter-bar {
        flex-direction: column;
    }

    .filter-bar .form-control,
    .filter-bar input[type="text"] {
        width: 100%;
        min-width: unset;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .login-card {
        padding: 24px;
    }

    .reports-grid {
        grid-template-columns: 1fr;
    }
}
