/* Main CSS for ERP Doors & Windows */

:root {
    --primary-color: #333;
    --secondary-color: #f4f4f4;
    --text-color: #000;
    --bg-color: #fff;
    --border-color: #eee;
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 60px;
    --transition-speed: 0.3s;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background-color: var(--bg-color);
    border-right: 1px solid var(--border-color);
    transition: width var(--transition-speed);
    z-index: 1000;
    overflow-x: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-header h2 {
    font-size: 1.2rem;
    white-space: nowrap;
}

.sidebar-menu {
    list-style: none;
    padding: 10px 0;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-color);
    text-decoration: none;
    transition: background var(--transition-speed);
}

.sidebar-menu li a:hover {
    background-color: var(--secondary-color);
}

.sidebar-menu li a i {
    margin-right: 15px;
    width: 20px;
    text-align: center;
}

.sidebar.collapsed .sidebar-menu li a span {
    display: none;
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: 60px;
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    transition: left var(--transition-speed);
    z-index: 900;
}

.sidebar.collapsed + header {
    left: var(--sidebar-collapsed-width);
}

/* Main Content */
.content {
    margin-left: var(--sidebar-width);
    margin-top: 60px;
    padding: 20px;
    transition: margin-left var(--transition-speed);
}

.sidebar.collapsed ~ .content {
    margin-left: var(--sidebar-collapsed-width);
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background-color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    color: var(--text-color);
}

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

.btn-primary {
    background-color: #333;
    color: #fff;
    border-color: #333;
}

.btn-primary:hover {
    background-color: #000;
    border-color: #000;
}

.btn-danger {
    color: #d9534f;
}

.btn-danger:hover {
    background-color: #c82333;
    color: #fff;
}

/* Forms */
.form-card {
    background: #fff;
    border: 1px solid var(--border-color);
    padding: 25px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 0.85rem;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #000;
    border-radius: 0;
    font-size: 0.9rem;
}

.form-control:focus {
    outline: 2px solid #000;
    border-color: #000;
}

/* Tables */
.table-container {
    overflow-x: auto;
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    background-color: transparent;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border: 1px solid #000;
}

th {
    font-weight: 600;
    background-color: #fafafa;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

tr:hover {
    background-color: #fcfcfc;
}

/* Dashboard Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--border-color);
    padding: 20px;
    text-align: center;
}

.stat-card h3 {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
}

.stat-card .value {
    font-size: 1.8rem;
    font-weight: 700;
}

/* Utilities */
.text-right { text-align: right; }
.mb-20 { margin-bottom: 20px; }
/* Badges */
.badge {
    display: inline-block;
    padding: 0.25em 0.4em;
    font-size: 75%;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

.badge-danger {
    color: #fff;
    background-color: #dc3545;
}

.badge-warning {
    color: #212529;
    background-color: #ffc107;
}

.badge-success {
    color: #fff;
    background-color: #28a745;
}

.mt-20 { margin-top: 20px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

/* Item Table Excel-like Style */
.item-table {
    border-collapse: collapse;
    border: 1px solid #000;
}

.item-table th {
    padding: 8px;
    border: 1px solid #000;
    background-color: #f2f2f2;
    text-align: center;
}

.item-table td {
    padding: 0;
    border: 1px solid #000;
    vertical-align: top;
    text-align: center;
}

.item-table .form-control {
    border: none;
    padding: 8px;
    height: 100%;
    border-radius: 0;
    text-align: center;
}

/* Keep item name and description left aligned for better readability */
.item-table .product-search,
.item-table input[placeholder="Description"] {
    text-align: left;
}

.item-table select.form-control {
    padding: 7px;
}

.mt-1 {
    margin-top: 0;
    border-top: 1px solid #000 !important;
}

/* Print Layout */
@media print {
    .sidebar, header, .btn, .no-print {
        display: none !important;
    }
    .content {
        margin: 0 !important;
        padding: 0 !important;
    }
    .form-card {
        border: none !important;
    }
}
