/* Vendor Portal — Base Styles */

:root {
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-success: #16a34a;
    --color-warning: #d97706;
    --color-danger: #dc2626;
    --color-info: #0891b2;
    --color-bg: #f8fafc;
    --color-surface: #ffffff;
    --color-text: #1e293b;
    --color-text-muted: #64748b;
    --color-border: #e2e8f0;
    --color-sidebar: #1e293b;
    --color-sidebar-text: #e2e8f0;
    --radius: 6px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html,
body {
    height: 100%;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-text);
    background: var(--color-bg);
}

/* Layout */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 240px;
    background: var(--color-sidebar);
    color: var(--color-sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0.5rem 0;
}

.sidebar-nav a {
    display: block;
    padding: 0.6rem 1.25rem;
    color: var(--color-sidebar-text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.15s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 240px;
    display: flex;
    flex-direction: column;
}

/* Topbar */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    font-size: 1.2rem;
    font-weight: 600;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lang-switcher a {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-decoration: none;
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.lang-switcher a:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.user-name {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.btn-logout {
    font-size: 0.8rem;
    color: var(--color-danger);
    text-decoration: none;
}

/* Content Area */
.content-area {
    padding: 1.5rem;
    flex: 1;
}

/* Alerts / Flash Messages */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-info {
    background: #ecfeff;
    color: #155e75;
    border: 1px solid #a5f3fc;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.15s;
}

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

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

.btn-danger {
    background: var(--color-danger);
    color: #fff;
}

.btn-secondary {
    background: var(--color-border);
    color: var(--color-text);
}

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

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

th,
td {
    padding: 0.6rem 0.8rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.85rem;
}

th {
    background: #f1f5f9;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.3rem;
    color: var(--color-text);
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    transition: border-color 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-error {
    color: var(--color-danger);
    font-size: 0.8rem;
    margin-top: 0.2rem;
}

/* Cards */
.card {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
}

.card-header {
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.badge-active {
    background: #dcfce7;
    color: #166534;
}

.badge-suspended {
    background: #fef9c3;
    color: #854d0e;
}

.badge-revoked {
    background: #fef2f2;
    color: #991b1b;
}

.badge-expired {
    background: #f1f5f9;
    color: #475569;
}

.badge-draft {
    background: #e0e7ff;
    color: #3730a3;
}

.badge-published {
    background: #dcfce7;
    color: #166534;
}

/* Pagination */
.pagination {
    display: flex;
    gap: 0.25rem;
    margin-top: 1rem;
}

.pagination a,
.pagination span {
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.8rem;
    text-decoration: none;
    color: var(--color-text);
}

.pagination a:hover {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.pagination .current {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

/* Error Pages */
.error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

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

.error-container h1 {
    font-size: 4rem;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.error-container p {
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
}