/* ===== CSS Variables ===== */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --success: #10b981;
    --success-dark: #059669;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-input: #334155;
    --bg-hover: #475569;
    
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --border-color: #334155;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
    
    --radius: 12px;
    --radius-sm: 8px;
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ===== Login Page ===== */
.login-body {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 1rem;
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light), var(--info));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-header p {
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.login-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
}

.login-footer small {
    color: var(--text-secondary);
}

/* ===== Form Elements ===== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.875rem 1rem;
    font-size: 1rem;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-login {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), var(--success-dark));
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: #1e293b;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

/* ===== Header ===== */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-admin {
    background: linear-gradient(135deg, #1e1b4b, var(--bg-card));
}

.header-left,
.header-center,
.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-light);
}

.user-info {
    color: var(--text-secondary);
}

.sayim-info {
    background: var(--bg-input);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.admin-nav {
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ===== Main Content ===== */
.main-content {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.main-content h1 {
    margin-bottom: 2rem;
    font-size: 2rem;
}

/* ===== Cards ===== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.card-header h2 {
    font-size: 1.25rem;
}

.card-warning {
    border-color: var(--warning);
    background: rgba(245, 158, 11, 0.1);
}

/* ===== Stats Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--border-color);
}

.stat-card.stat-success { border-left: 4px solid var(--success); }
.stat-card.stat-warning { border-left: 4px solid var(--warning); }
.stat-card.stat-info { border-left: 4px solid var(--info); }

.stat-icon {
    font-size: 2.5rem;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== Tables ===== */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--bg-input);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

.table .text-right {
    text-align: right;
}

.total-row {
    background: var(--bg-input) !important;
}

.row-warning {
    background: rgba(245, 158, 11, 0.1);
}

/* ===== Badges ===== */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-success { background: rgba(16, 185, 129, 0.2); color: var(--success); }
.badge-secondary { background: var(--bg-input); color: var(--text-secondary); }
.badge-danger { background: rgba(239, 68, 68, 0.2); color: var(--danger); }
.badge-warning { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.badge-info { background: rgba(6, 182, 212, 0.2); color: var(--info); }

/* ===== Alerts ===== */
.alert {
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--danger);
    color: #fca5a5;
}

/* ===== Tabs ===== */
.input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.input-tabs {
    display: flex;
    gap: 0.5rem;
}

.tab {
    padding: 0.5rem 1rem;
    background: var(--bg-input);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab.active {
    background: var(--primary);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ===== Search Results ===== */
.search-results {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 1rem;
}

.search-item {
    padding: 1rem;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-item:hover {
    background: var(--bg-hover);
    transform: translateX(5px);
}

.search-item strong {
    display: block;
    margin-bottom: 0.25rem;
}

.search-item small {
    color: var(--text-muted);
}

/* ===== Voice Input ===== */
.voice-container {
    text-align: center;
    padding: 2rem;
}

.voice-btn {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    font-size: 2.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.voice-btn:hover {
    transform: scale(1.1);
}

.voice-btn.recording {
    animation: pulse 1s infinite;
    background: linear-gradient(135deg, var(--danger), #b91c1c);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.voice-result {
    margin-top: 1rem;
    font-size: 1.2rem;
    color: var(--primary-light);
}

/* ===== Product Card ===== */
.product-card {
    border: 2px solid var(--primary);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-info h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.quantity-row {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.quantity-input {
    display: flex;
    align-items: center;
}

.quantity-input button {
    width: 45px;
    height: 45px;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quantity-input button:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.quantity-input button:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.quantity-input button:hover {
    background: var(--primary);
}

.quantity-input input {
    width: 80px;
    height: 45px;
    border: 2px solid var(--border-color);
    border-left: none;
    border-right: none;
    background: var(--bg-input);
    color: var(--text-primary);
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
}

/* ===== Movements List ===== */
.movements-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.movements-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.total {
    font-size: 1.1rem;
}

.movements-list {
    max-height: 400px;
    overflow-y: auto;
}

/* ===== Barkodsuz Form ===== */
.barkodsuz-form {
    margin-top: 1rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-row input {
    flex: 1;
    min-width: 150px;
    padding: 0.75rem;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
}

/* ===== Modal ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--border-color);
}

.modal-content h3 {
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* ===== Filters ===== */
.filters {
    margin-bottom: 1.5rem;
}

.filter-form {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-form select,
.filter-form input {
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    min-width: 150px;
}

/* ===== Report Grid ===== */
.report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.report-card {
    text-align: center;
}

.report-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.report-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.report-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.report-stats {
    text-align: left;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

/* ===== Stats Detail ===== */
.stats-detail {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 2rem;
}

.stats-detail .stat-item {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
}

.stats-detail .stat-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.stats-detail .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
}

/* ===== Info Grid ===== */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-item label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.info-item span {
    font-size: 1.1rem;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.empty-state p {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

/* ===== Utilities ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-info { color: var(--info); }
.text-lg { font-size: 1.25rem; }

/* ===== Details/Summary ===== */
details {
    cursor: pointer;
}

details summary {
    font-weight: 600;
    padding: 0.5rem 0;
}

details[open] summary {
    margin-bottom: 1rem;
}

/* ===== New Sayim Card ===== */
.new-sayim-card {
    max-width: 500px;
    margin: 2rem auto;
    text-align: center;
}

.new-sayim-card h2 {
    margin-bottom: 2rem;
}

.new-sayim-form {
    text-align: left;
}

.new-sayim-form .form-group {
    margin-bottom: 1.5rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .header-left,
    .header-center,
    .header-right {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .admin-nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .main-content {
        padding: 1rem;
    }

    .quantity-row {
        flex-direction: column;
    }

    .quantity-row .form-group {
        width: 100%;
    }

    .table {
        font-size: 0.85rem;
    }

    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
    }
}
/* ===== Additional Utilities ===== */
.text-small { font-size: 0.85rem; color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

/* ===== Info Banner ===== */
.info-banner {
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid var(--info);
    color: var(--text-secondary);
}

/* ===== Quantity Display ===== */
.quantity {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: 600;
}

/* ===== List Card ===== */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.list-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ===== Quantity Form ===== */
.quantity-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    margin-top: 1rem;
}

.quantity-controls {
    display: flex;
    align-items: center;
}

.qty-btn {
    width: 45px;
    height: 45px;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.qty-btn:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.qty-btn:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

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

.quantity-controls input {
    width: 80px;
    height: 45px;
    border: 2px solid var(--border-color);
    border-left: none;
    border-right: none;
    background: var(--bg-input);
    color: var(--text-primary);
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
}
