/* Finden Inventory Design System - Base Styles */

/* Google Fonts - DM Sans & DM Mono */
@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:opsz,wght@9..40,400;500;600;700&display=swap');

/* Design Tokens */
:root {
    /* Primary Colors */
    --primary: #0f172a;
    --primary-light: #1e293b;

    /* Accent Colors */
    --accent: #f59e0b;
    --accent-hover: #d97706;

    /* Semantic Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* Backgrounds */
    --bg: #fafafa;
    --surface: #ffffff;

    /* Text Colors */
    --text: #0f172a;
    --text-muted: #64748b;

    /* Borders */
    --border: #e2e8f0;
    --border-light: #f1f5f9;

    /* Effects */
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    /* Spacing */
    --radius: 8px;
    --radius-sm: 4px;
}

/* Dark Theme */
[data-theme="dark"] {
    --primary: #f8fafc;
    --primary-light: #e2e8f0;
    --accent: #fbbf24;
    --accent-hover: #f59e0b;
    --bg: #0f172a;
    --surface: #1e293b;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
    --border-light: #1e293b;
}

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

body {
    font-family: "DM Sans", sans-serif;
    font-optical-sizing: auto;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.mono {
    font-family: "DM Mono", monospace;
}

.text-muted {
    color: var(--text-muted);
}

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

/* Links */
a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent-hover);
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Layout Components */
header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

main {
    padding: 32px 0;
}

footer {
    margin-top: 64px;
    padding: 32px 0;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* Typography */
h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    letter-spacing: -0.3px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 24px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -1px;
}

/* Button Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

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

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

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* Card Components */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

/* Table Components */
.table-container {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th {
    background: var(--border-light);
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
}

tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: var(--border-light);
}

/* Badge Components */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-pending {
    background: #fffbeb;
    color: #92400e;
}

.badge-approved {
    background: #f0fdf4;
    color: #166534;
}

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

/* Role Badge */
.role-badge {
    background: var(--primary);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Alert Components */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 14px;
    border-left: 4px solid;
}

.alert-success {
    background: #f0fdf4;
    border-color: var(--success);
    color: #166534;
}

.alert-danger {
    background: #fef2f2;
    border-color: var(--danger);
    color: #991b1b;
}

.alert-warning {
    background: #fffbeb;
    border-color: var(--warning);
    color: #92400e;
}

.alert-info {
    background: #eff6ff;
    border-color: var(--info);
    color: #1e40af;
}

/* Pagination */
.pagination {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 24px;
}

.pagination a, .pagination span {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    text-decoration: none;
    color: var(--text);
}

.pagination a:hover {
    background: var(--border-light);
}

.pagination .active {
    background: var(--accent);
    color: var(--primary);
    border-color: var(--accent);
}

/* Flexbox Utilities */
.flex {
    display: flex;
}

.flex-between {
    justify-content: space-between;
}

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

.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }

/* Margin Utilities */
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

main > * {
    animation: fadeIn 0.3s ease-out;
}

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

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

input, select, textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

textarea {
    min-height: 100px;
    resize: vertical;
}

/* Logo */
.logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--accent);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border-radius: var(--radius-sm);
}

/* Navigation */
nav {
    display: flex;
    gap: 8px;
    align-items: center;
}

nav a {
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.2s;
}

nav a:hover, nav a.active {
    background: var(--border-light);
    color: var(--text);
}

/* User Badge */
.user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--border-light);
    border-radius: var(--radius);
    font-size: 13px;
}

.user-avatar {
    width: 28px;
    height: 28px;
    background: var(--accent);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
}

/* Cart/Panel */
.cart-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.cart-item:last-child {
    border-bottom: none;
}

.empty-cart {
    text-align: center;
    padding: 32px;
    color: var(--text-muted);
}

/* Page Header */
.page-header {
    margin-bottom: 32px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.page-title-accent {
    color: var(--accent);
}

.page-subtitle {
    font-size: 15px;
    color: var(--text-muted);
}

/* Stats Header */
.stats-header {
    margin-bottom: 24px;
}

.stats-title {
    font-size: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: -0.3px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
}

.stats-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--accent);
}

/* Navigation Bar Styles */
.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand a {
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
}

.navbar-brand a:hover {
    color: var(--accent);
}

.navbar-brand a span {
    color: var(--accent);
}

.navbar-menu {
    display: flex;
    gap: 24px;
    align-items: center;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: "DM Mono", monospace;
    font-size: 13px;
    color: var(--text-muted);
}

.user-role {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent);
    font-weight: 600;
}

.navbar-link {
    font-family: "DM Mono", monospace;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.navbar-link:hover {
    color: var(--accent);
}

.navbar-link-logout {
    display: flex;
    align-items: center;
    gap: 6px;
}
