/* Pilan ERP - Industrial Light Theme v2.0 */
/* Optimized for Speed & Readability */

:root {
    /* Industrial Palette */
    --pilan-blue: #0066cc;
    /* Professional Tech Blue */
    --pilan-dark: #2d3436;
    /* Soft Black */
    --pilan-light: #f8f9fa;
    /* Circuit Board White */
    --pilan-grey: #dfe6e9;
    /* Structure Grey */

    /* Semantic Colors */
    --sap-primary: var(--pilan-blue);
    --sap-success: #00b894;
    --sap-warning: #fdcb6e;
    --sap-danger: #d63031;

    --sap-card-bg: #ffffff;
    --sap-text-color: #2d3436;
    --sap-border-color: #e1e4e8;

    --card-radius: 12px;
    --header-height: 60px;
    --sidebar-width: 280px;
}

/* --- High Performance Background (CSS Only - No Images) --- */
body {
    font-family: 'Segoe UI', 'Roboto', Helvetica, Arial, sans-serif;
    color: var(--sap-text-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;

    /* Circuit Grid Pattern */
    background-color: var(--pilan-light);
    background-image:
        radial-gradient(var(--pilan-grey) 1px, transparent 1px),
        linear-gradient(to right, rgba(223, 230, 233, 0.4) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(223, 230, 233, 0.4) 1px, transparent 1px);
    background-size: 20px 20px, 40px 40px, 40px 40px;
    background-attachment: fixed;

    /* Reveal Animation */
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Shared Components --- */

/* Glass Cards */
.card,
.glass-card {
    background: #ffffff;
    /* Solid white for performance */
    /* backdrop-filter: blur(12px); <-- REMOVED for iPhone freeze fix */
    /* -webkit-backdrop-filter: blur(12px); <-- REMOVED */
    border: 1px solid #e1e4e8;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border-radius: var(--card-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

/* Subtle Top Accent for Industrial Feel */
.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--pilan-blue), transparent);
    opacity: 0.5;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--pilan-dark);
    margin-top: 0;
    font-weight: 600;
    letter-spacing: -0.5px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.4rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    text-decoration: none;
    gap: 0.5rem;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--pilan-blue);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(0, 118, 255, 0.39);
}

.btn-primary:hover {
    background: #0056b3;
    box-shadow: 0 6px 20px rgba(0, 118, 255, 0.23);
}

.btn-success {
    background: var(--sap-success);
    color: white;
}

.btn-danger {
    background: var(--sap-danger);
    color: white;
}

.btn-warning {
    background: var(--sap-warning);
    color: #2d3436;
}

/* Inputs */
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    background: #fdfdfd;
    transition: all 0.2s;
    font-size: 0.95rem;
    box-sizing: border-box;
}

.form-control:focus {
    border-color: var(--pilan-blue);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
    outline: none;
}

/* --- Layout --- */

/* Header */
header {
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--sap-border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: #fff;
    position: fixed;
    top: var(--header-height);
    bottom: 0;
    left: 0;
    border-right: 1px solid var(--sap-border-color);
    padding-top: 1rem;
    z-index: 900;
    overflow-y: auto;
    /* Allow scrolling */
}

.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 2.5rem;
}

/* Nav Links */
.nav-link {
    display: flex;
    align-items: center;
    padding: 0.8rem 1.5rem;
    color: #636e72;
    text-decoration: none;
    font-weight: 500;
    border-right: 3px solid transparent;
    transition: all 0.2s;
}

.nav-link:hover {
    background: #f1f2f6;
    color: var(--pilan-blue);
}

.nav-link.active {
    background: rgba(0, 102, 204, 0.05);
    color: var(--pilan-blue);
    border-right-color: var(--pilan-blue);
}

.nav-link i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

/* --- Specific Views --- */

/* Login Center */
body.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-card {
    width: 100%;
    max-width: 360px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: none;
    z-index: 10;
}

/* Dashboard Tiles */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 2rem;
}

.app-tile {
    background: #fff;
    border-radius: 12px;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid transparent;
}

.app-tile:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    border-color: var(--sap-primary);
}

.app-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    transition: transform 0.3s;
}

.app-tile:hover .app-icon {
    transform: rotate(10deg) scale(1.1);
}

.app-title {
    font-weight: 700;
    color: var(--pilan-dark);
    font-size: 1.1rem;
}

.app-desc {
    font-size: 0.85rem;
    color: #b2bec3;
    margin-top: 0.4rem;
}