/**
 * Sirket Stok Yonetimi - Frontend CSS
 * Namespace: .ssm-app (tema ile cakismayi onler)
 * Mobil oncelikli tasarim (360px+)
 */

.ssm-app {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	max-width: 800px;
	margin: 0 auto;
	padding: 16px;
	background: #f5f5f5;
	border-radius: 12px;
	color: #1d2327;
	line-height: 1.5;
}

.ssm-app * {
	box-sizing: border-box;
}

/* Header */
.ssm-app .ssm-header {
	margin-bottom: 20px;
}

.ssm-app .ssm-title {
	font-size: 22px;
	font-weight: 700;
	margin: 0;
	color: #1d2327;
}

/* Search Section */
.ssm-app .ssm-search-section {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 20px;
}

.ssm-app .ssm-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.ssm-app .ssm-field label {
	font-weight: 600;
	font-size: 14px;
	color: #3c434a;
}

.ssm-app .ssm-fe-input,
.ssm-app .ssm-fe-select {
	width: 100%;
	padding: 14px 16px;
	border: 2px solid #dcdcde;
	border-radius: 8px;
	font-size: 16px;
	background: #fff;
	transition: border-color 0.2s;
	-webkit-appearance: none;
	appearance: none;
}

.ssm-app .ssm-fe-input:focus,
.ssm-app .ssm-fe-select:focus {
	border-color: #0073aa;
	outline: none;
	box-shadow: 0 0 0 3px rgba(0,115,170,0.15);
}

.ssm-app .ssm-fe-select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	padding-right: 40px;
}

/* Buttons */
.ssm-app .ssm-btn {
	display: inline-block;
	padding: 14px 28px;
	border: none;
	border-radius: 8px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	text-align: center;
	text-decoration: none;
	transition: background 0.2s;
	min-height: 48px;
}

.ssm-app .ssm-btn-primary {
	background: #0073aa;
	color: #fff;
}

.ssm-app .ssm-btn-primary:hover {
	background: #005a87;
	color: #fff;
}

.ssm-app .ssm-btn-primary:disabled {
	background: #a0a5aa;
	cursor: not-allowed;
}

/* Loading */
.ssm-app .ssm-loading {
	text-align: center;
	padding: 30px;
}

.ssm-app .ssm-spinner {
	display: inline-block;
	width: 32px;
	height: 32px;
	border: 3px solid #dcdcde;
	border-top-color: #0073aa;
	border-radius: 50%;
	animation: ssm-spin 0.8s linear infinite;
}

@keyframes ssm-spin {
	to { transform: rotate(360deg); }
}

/* Results */
.ssm-app .ssm-results {
	margin-top: 16px;
}

.ssm-app .ssm-result-item {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 16px;
	margin-bottom: 10px;
	cursor: pointer;
	transition: box-shadow 0.2s;
}

.ssm-app .ssm-result-item:hover {
	box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ssm-app .ssm-result-code {
	font-weight: 700;
	font-size: 16px;
	color: #0073aa;
}

.ssm-app .ssm-result-name {
	font-size: 14px;
	color: #3c434a;
	margin-top: 2px;
}

.ssm-app .ssm-result-company {
	font-size: 12px;
	color: #787c82;
	margin-top: 2px;
}

.ssm-app .ssm-result-stock {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px solid #f0f0f1;
}

.ssm-app .ssm-result-qty {
	font-size: 18px;
	font-weight: 700;
}

.ssm-app .ssm-result-price {
	font-size: 14px;
	color: #3c434a;
}

/* Badge */
.ssm-app .ssm-badge {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 12px;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
}

/* Detail */
.ssm-app .ssm-detail {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 12px;
	padding: 24px;
	margin-top: 16px;
}

.ssm-app .ssm-detail-header {
	margin-bottom: 20px;
	padding-bottom: 16px;
	border-bottom: 2px solid #f0f0f1;
}

.ssm-app .ssm-detail-code {
	font-size: 24px;
	font-weight: 700;
	color: #0073aa;
}

.ssm-app .ssm-detail-name {
	font-size: 16px;
	color: #3c434a;
	margin-top: 4px;
}

.ssm-app .ssm-detail-company {
	font-size: 14px;
	color: #787c82;
	margin-top: 2px;
}

.ssm-app .ssm-detail-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.ssm-app .ssm-detail-item {
	padding: 12px;
	background: #f8f9fa;
	border-radius: 8px;
}

.ssm-app .ssm-detail-label {
	font-size: 12px;
	font-weight: 600;
	color: #787c82;
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

.ssm-app .ssm-detail-value {
	font-size: 18px;
	font-weight: 700;
	color: #1d2327;
	margin-top: 4px;
}

.ssm-app .ssm-detail-value.ssm-highlight {
	color: #0073aa;
	font-size: 22px;
}

.ssm-app .ssm-detail-back {
	margin-top: 16px;
}

/* Stats (Dashboard shortcode) */
.ssm-app .ssm-stats {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 12px;
	margin-bottom: 20px;
}

.ssm-app .ssm-stat {
	background: #fff;
	border-radius: 8px;
	padding: 16px;
	text-align: center;
	border: 1px solid #e0e0e0;
}

.ssm-app .ssm-stat-value {
	font-size: 28px;
	font-weight: 700;
	color: #0073aa;
}

.ssm-app .ssm-stat-label {
	font-size: 12px;
	color: #787c82;
	margin-top: 4px;
	text-transform: uppercase;
}

.ssm-app .ssm-stat-danger .ssm-stat-value {
	color: #dc3232;
}

/* Currency Section */
.ssm-app .ssm-currency-section {
	background: #fff;
	border-radius: 8px;
	padding: 16px;
	border: 1px solid #e0e0e0;
}

.ssm-app .ssm-currency-section h3 {
	margin-top: 0;
}

.ssm-app .ssm-currency-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
}

.ssm-app .ssm-currency-card {
	text-align: center;
	padding: 12px;
	background: #f8f9fa;
	border-radius: 8px;
}

.ssm-app .ssm-currency-code {
	font-size: 12px;
	font-weight: 600;
	color: #787c82;
}

.ssm-app .ssm-currency-amount {
	font-size: 18px;
	font-weight: 700;
	color: #1d2327;
	margin-top: 4px;
}

/* Table */
.ssm-app .ssm-table-wrapper {
	overflow-x: auto;
}

.ssm-app .ssm-table {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
	border-radius: 8px;
	overflow: hidden;
}

.ssm-app .ssm-table th,
.ssm-app .ssm-table td {
	padding: 12px 16px;
	text-align: left;
	border-bottom: 1px solid #f0f0f1;
}

.ssm-app .ssm-table th {
	background: #f8f9fa;
	font-weight: 600;
	font-size: 13px;
	color: #3c434a;
}

/* Company Grid */
.ssm-app .ssm-company-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 12px;
}

.ssm-app .ssm-company-card {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 16px;
	text-align: center;
}

.ssm-app .ssm-company-name {
	font-weight: 700;
	font-size: 15px;
}

.ssm-app .ssm-company-count {
	font-size: 13px;
	color: #787c82;
	margin-top: 4px;
}

/* Deduct (Stoktan Dus) */
.ssm-app .ssm-deduct {
	margin-top: 20px;
	padding: 16px;
	background: #f0f6fb;
	border: 1px solid #c5d9ed;
	border-radius: 8px;
}

.ssm-app .ssm-deduct-title {
	font-weight: 700;
	font-size: 15px;
	color: #1d2327;
	margin-bottom: 12px;
}

.ssm-app .ssm-deduct-form {
	display: flex;
	gap: 10px;
	align-items: stretch;
}

.ssm-app .ssm-deduct-input {
	flex: 1;
	min-width: 0;
}

.ssm-app .ssm-deduct-form .ssm-btn {
	flex-shrink: 0;
	padding: 14px 20px;
}

.ssm-app .ssm-deduct-msg {
	margin-top: 10px;
	font-size: 14px;
	font-weight: 600;
	min-height: 20px;
}

.ssm-app .ssm-deduct-msg.ssm-ok {
	color: #1e7e34;
}

.ssm-app .ssm-deduct-msg.ssm-err {
	color: #dc3232;
}

/* Admin Panel (stok_admin) */
.ssm-app .ssm-subtitle {
	margin: 4px 0 0;
	color: #787c82;
	font-size: 14px;
}

.ssm-app .ssm-tool-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 12px;
	margin-top: 20px;
}

.ssm-app .ssm-tool-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 22px 14px;
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 10px;
	cursor: pointer;
	text-align: center;
	transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
	font-family: inherit;
}

.ssm-app .ssm-tool-card:hover,
.ssm-app .ssm-tool-card:focus {
	border-color: #0073aa;
	box-shadow: 0 4px 14px rgba(0, 115, 170, .15);
	transform: translateY(-2px);
	outline: none;
}

.ssm-app .ssm-tool-icon {
	font-size: 30px;
	line-height: 1;
}

.ssm-app .ssm-tool-title {
	font-weight: 700;
	font-size: 15px;
	color: #1d2327;
}

.ssm-app .ssm-tool-desc {
	font-size: 12px;
	color: #787c82;
	line-height: 1.4;
}

.ssm-app .ssm-tool-content {
	margin-top: 20px;
}

.ssm-app .ssm-tool-content-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 16px;
	padding-bottom: 12px;
	border-bottom: 1px solid #e2e4e7;
}

.ssm-app .ssm-tool-content-head h3 {
	margin: 0;
	font-size: 18px;
	color: #1d2327;
}

.ssm-app .ssm-sec-title {
	margin: 22px 0 10px;
	font-size: 15px;
	font-weight: 700;
	color: #1d2327;
}

.ssm-app .ssm-form .ssm-field {
	margin-bottom: 14px;
}

.ssm-app .ssm-form .ssm-field label {
	display: block;
	font-weight: 600;
	font-size: 13px;
	margin-bottom: 6px;
	color: #1d2327;
}

.ssm-app .ssm-field-row {
	display: flex;
	gap: 12px;
}

.ssm-app .ssm-field-row .ssm-field {
	flex: 1;
	min-width: 0;
}

.ssm-app .ssm-inline-form {
	background: #f6f7f7;
	border: 1px solid #e2e4e7;
	border-radius: 8px;
	padding: 16px;
	margin-bottom: 18px;
}

/* Ozel kayit formlari normal stok girisinden ayri gorunur. */
.ssm-app .ssm-special-form {
	padding: 18px;
	border-radius: 10px;
	margin-bottom: 18px;
}

.ssm-app .ssm-customer-paint-form {
	background: #fff7ed;
	border: 1px solid #fdba74;
	border-left: 5px solid #ea580c;
}

.ssm-app .ssm-consumption-form {
	background: #f0fdf4;
	border: 1px solid #86efac;
	border-left: 5px solid #16a34a;
}

.ssm-app .ssm-special-note {
	margin: 0 0 16px;
	padding: 10px 12px;
	background: rgba(255,255,255,.72);
	border-radius: 7px;
	font-size: 14px;
	color: #3c434a;
}

.ssm-app .ssm-current-info {
	padding: 10px 12px;
	background: #f0f6fb;
	border: 1px solid #c5d9ed;
	border-radius: 6px;
	font-size: 14px;
	margin-bottom: 14px;
}

.ssm-app .ssm-current-info:empty {
	display: none;
}

.ssm-app .ssm-btn-light {
	background: #f6f7f7;
	border: 1px solid #dcdcde;
	color: #1d2327;
	padding: 10px 16px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 14px;
	text-decoration: none;
	display: inline-block;
}

.ssm-app .ssm-btn-light:hover {
	background: #e9ecef;
	color: #1d2327;
}

.ssm-app .ssm-btn-sm {
	padding: 6px 10px;
	font-size: 12px;
}

.ssm-app .ssm-actions {
	white-space: nowrap;
}

.ssm-app .ssm-row-inactive {
	opacity: .55;
}

.ssm-app .ssm-pagination {
	margin-top: 14px;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.ssm-app .ssm-page-active {
	background: #0073aa !important;
	color: #fff !important;
	border-color: #0073aa !important;
}

.ssm-app .ssm-hr {
	border: 0;
	border-top: 1px solid #e2e4e7;
	margin: 22px 0;
}

.ssm-app .ssm-table code {
	background: #f0f0f1;
	padding: 2px 6px;
	border-radius: 4px;
	font-size: 12px;
}

@media (max-width: 600px) {
	.ssm-app .ssm-tool-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.ssm-app .ssm-field-row {
		flex-direction: column;
		gap: 0;
	}
}

/* Login / No Access */
.ssm-app.ssm-login-required,
.ssm-app.ssm-no-access {
	text-align: center;
	padding: 40px 20px;
	background: #fff;
	border-radius: 12px;
}

/* Desktop */
@media (min-width: 600px) {
	.ssm-app .ssm-search-section {
		flex-direction: row;
		align-items: flex-end;
	}

	.ssm-app .ssm-field {
		flex: 1;
	}

	.ssm-app .ssm-btn {
		flex-shrink: 0;
	}

	.ssm-app .ssm-stats {
		grid-template-columns: repeat(4, 1fr);
	}

	.ssm-app .ssm-detail-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

/* Tehlikeli veri silme alani ([stok_admin] > Ayarlar). */
.ssm-app .ssm-danger-zone {
	margin-top: 28px;
	padding: 18px;
	border: 1px solid #dc2626;
	border-left: 5px solid #dc2626;
	border-radius: 10px;
	background: #fff5f5;
	color: #541616;
}

.ssm-app .ssm-danger-zone h4,
.ssm-app .ssm-danger-zone strong {
	color: #b91c1c;
}

.ssm-app .ssm-btn-danger,
.ssm-app button.ssm-btn-danger {
	background: #dc2626 !important;
	border-color: #b91c1c !important;
	color: #fff !important;
}

.ssm-app .ssm-btn-danger:hover,
.ssm-app .ssm-btn-danger:focus {
	background: #b91c1c !important;
	border-color: #991b1b !important;
}

.ssm-app .ssm-btn-danger:disabled {
	background: #f3a7a7 !important;
	border-color: #e78c8c !important;
	cursor: not-allowed !important;
	opacity: 0.75;
}

/* AJAX hata ve durum geri bildirimi */
.ssm-app .ssm-ajax-error {
	box-sizing: border-box;
	width: 100%;
	margin: 14px 0;
	padding: 14px 16px;
	border: 1px solid #f2b8b5;
	border-left: 4px solid #d63638;
	border-radius: 8px;
	background: #fff5f5;
	color: #5c1a1b;
	font-size: 14px;
	line-height: 1.5;
}

.ssm-app .ssm-ajax-error strong {
	display: block;
	margin: 0 0 4px;
	color: #9b1c1f;
}

.ssm-app .ssm-ajax-error p {
	margin: 0 0 10px;
}

.ssm-app .ssm-loading p {
	margin: 10px 0 0;
	color: #667085;
	font-size: 13px;
	text-align: center;
}

.ssm-app .ssm-field-help {
	margin: 6px 0 0;
	color: #667085;
	font-size: 12px;
	line-height: 1.45;
}

/* Kod/ad yazarak secim; tema kurallarindan izole. */
.ssm-app .ssm-product-combobox { position: relative; width: 100%; }
.ssm-app .ssm-product-suggestions { position: absolute; z-index: 100; left: 0; right: 0; top: 100%; max-height: 280px; overflow-y: auto; background: #fff; border: 1px solid #cbd5e1; border-radius: 6px; box-shadow: 0 6px 15px rgba(0,0,0,.12); }
.ssm-app button.ssm-product-suggestion { display: block; width: 100%; padding: 12px; margin: 0; text-align: left; background: #fff; border: 0; border-bottom: 1px solid #eee; border-radius: 0; color: #1e293b; font: inherit; cursor: pointer; }
.ssm-app button.ssm-product-suggestion:hover, .ssm-app button.ssm-product-suggestion.is-selected { background: #e0f2fe; color: #075985; }
.ssm-app .ssm-product-no-match { padding: 12px; color: #64748b; font-size: 13px; }
